diff --git a/cluster-autoscaler/cloudprovider/azure/azure_client.go b/cluster-autoscaler/cloudprovider/azure/azure_client.go index 6cb02343128d..ac9a8fa16f8d 100644 --- a/cluster-autoscaler/cloudprovider/azure/azure_client.go +++ b/cluster-autoscaler/cloudprovider/azure/azure_client.go @@ -24,7 +24,7 @@ import ( "os" "time" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources" "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-02-01/storage" "github.com/Azure/go-autorest/autorest" diff --git a/cluster-autoscaler/go.mod b/cluster-autoscaler/go.mod index 39e559f41406..28453364d15b 100644 --- a/cluster-autoscaler/go.mod +++ b/cluster-autoscaler/go.mod @@ -4,17 +4,17 @@ go 1.20 require ( cloud.google.com/go/compute/metadata v0.2.3 - github.com/Azure/azure-sdk-for-go v67.2.0+incompatible - github.com/Azure/go-autorest/autorest v0.11.28 - github.com/Azure/go-autorest/autorest/adal v0.9.21 + github.com/Azure/azure-sdk-for-go v68.0.0+incompatible + github.com/Azure/go-autorest/autorest v0.11.29 + github.com/Azure/go-autorest/autorest/adal v0.9.23 github.com/Azure/go-autorest/autorest/azure/auth v0.5.8 github.com/Azure/go-autorest/autorest/date v0.3.0 github.com/Azure/go-autorest/autorest/to v0.4.0 - github.com/Azure/skewer v0.0.14 + github.com/Azure/skewer v0.0.17 github.com/aws/aws-sdk-go v1.44.241 github.com/digitalocean/godo v1.27.0 github.com/ghodss/yaml v1.0.0 - github.com/gofrs/uuid v4.0.0+incompatible + github.com/gofrs/uuid v4.2.0+incompatible github.com/gogo/protobuf v1.3.2 github.com/golang/mock v1.6.0 github.com/google/go-cmp v0.5.9 @@ -26,11 +26,11 @@ require ( github.com/prometheus/client_golang v1.14.0 github.com/satori/go.uuid v1.2.0 github.com/spf13/pflag v1.0.5 - github.com/stretchr/testify v1.8.2 - golang.org/x/crypto v0.8.0 - golang.org/x/net v0.9.0 + github.com/stretchr/testify v1.8.4 + golang.org/x/crypto v0.9.0 + golang.org/x/net v0.10.0 golang.org/x/oauth2 v0.7.0 - golang.org/x/sys v0.7.0 + golang.org/x/sys v0.8.0 google.golang.org/api v0.114.0 google.golang.org/grpc v1.54.0 google.golang.org/protobuf v1.30.0 @@ -49,7 +49,7 @@ require ( k8s.io/kubernetes v1.27.2 k8s.io/legacy-cloud-providers v0.0.0 k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 - sigs.k8s.io/cloud-provider-azure v1.26.2 + sigs.k8s.io/cloud-provider-azure v1.27.5 ) require ( @@ -96,7 +96,7 @@ require ( github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/swag v0.22.3 // indirect github.com/godbus/dbus/v5 v5.0.6 // indirect - github.com/golang-jwt/jwt/v4 v4.4.2 // indirect + github.com/golang-jwt/jwt/v4 v4.5.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/cadvisor v0.47.1 // indirect @@ -164,8 +164,8 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.24.0 // indirect golang.org/x/exp v0.0.0-20230321023759-10a507213a29 // indirect - golang.org/x/sync v0.1.0 // indirect - golang.org/x/term v0.7.0 // indirect + golang.org/x/sync v0.2.0 // indirect + golang.org/x/term v0.8.0 // indirect golang.org/x/text v0.9.0 // indirect golang.org/x/time v0.3.0 // indirect google.golang.org/appengine v1.6.7 // indirect diff --git a/cluster-autoscaler/go.sum b/cluster-autoscaler/go.sum index c9e03027ac58..6afc0c768fe3 100644 --- a/cluster-autoscaler/go.sum +++ b/cluster-autoscaler/go.sum @@ -50,36 +50,30 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Azure/azure-sdk-for-go v46.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v67.2.0+incompatible h1:Uu/Ww6ernvPTrpq31kITVTIm/I5jlJ1wjtEH/bmSB2k= -github.com/Azure/azure-sdk-for-go v67.2.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= +github.com/Azure/azure-sdk-for-go v68.0.0+incompatible h1:fcYLmCpyNYRnvJbPerq7U0hS+6+I79yEDJBqVNcqUzU= +github.com/Azure/azure-sdk-for-go v68.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.11.4/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= github.com/Azure/go-autorest/autorest v0.11.17/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= -github.com/Azure/go-autorest/autorest v0.11.28 h1:ndAExarwr5Y+GaHE6VCaY1kyS/HwwGGyuimVhWsHOEM= -github.com/Azure/go-autorest/autorest v0.11.28/go.mod h1:MrkzG3Y3AH668QyF9KRk5neJnGgmhQ6krbhR8Q5eMvA= -github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= -github.com/Azure/go-autorest/autorest/adal v0.9.2/go.mod h1:/3SMAM86bP6wC9Ev35peQDUeqFZBMH07vvUOmg4z/fE= +github.com/Azure/go-autorest/autorest v0.11.29 h1:I4+HL/JDvErx2LjyzaVxllw2lRDB5/BT2Bm4g20iqYw= +github.com/Azure/go-autorest/autorest v0.11.29/go.mod h1:ZtEzC4Jy2JDrZLxvWs8LrBWEBycl1hbT1eknI8MtfAs= github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= github.com/Azure/go-autorest/autorest/adal v0.9.11/go.mod h1:nBKAnTomx8gDtl+3ZCJv2v0KACFHWTB2drffI1B68Pk= -github.com/Azure/go-autorest/autorest/adal v0.9.18/go.mod h1:XVVeme+LZwABT8K5Lc3hA4nAe8LDBVle26gTrguhhPQ= -github.com/Azure/go-autorest/autorest/adal v0.9.21 h1:jjQnVFXPfekaqb8vIsv2G1lxshoW+oGv4MDlhRtnYZk= -github.com/Azure/go-autorest/autorest/adal v0.9.21/go.mod h1:zua7mBUaCc5YnSLKYgGJR/w5ePdMDA6H56upLsHzA9U= +github.com/Azure/go-autorest/autorest/adal v0.9.22/go.mod h1:XuAbAEUv2Tta//+voMI038TrJBqjKam0me7qR+L8Cmk= +github.com/Azure/go-autorest/autorest/adal v0.9.23 h1:Yepx8CvFxwNKpH6ja7RZ+sKX+DWYNldbLiALMC3BTz8= +github.com/Azure/go-autorest/autorest/adal v0.9.23/go.mod h1:5pcMqFkdPhviJdlEy3kC/v1ZLnQl0MH6XA5YCcMhy4c= github.com/Azure/go-autorest/autorest/azure/auth v0.5.8 h1:TzPg6B6fTZ0G1zBf3T54aI7p3cAT6u//TOXGPmFMOXg= github.com/Azure/go-autorest/autorest/azure/auth v0.5.8/go.mod h1:kxyKZTSfKh8OVFWPAgOgQ/frrJgeYQJPyR5fLFmXko4= github.com/Azure/go-autorest/autorest/azure/cli v0.4.2 h1:dMOmEJfkLKW/7JsokJqkyoYSgmR08hi9KrhjZb+JALY= github.com/Azure/go-autorest/autorest/azure/cli v0.4.2/go.mod h1:7qkJkT+j6b+hIpzMOwPChJhTqS8VbsqqgULzMNRugoM= github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw= github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= -github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/autorest/mocks v0.4.2 h1:PGN4EDXnuQbojHbU0UWoNvmu9AGVwYHG9/fkDYhtAfw= github.com/Azure/go-autorest/autorest/mocks v0.4.2/go.mod h1:Vy7OitM9Kei0i1Oj+LvyAWMXJHeKH1MVlzFugfVrmyU= github.com/Azure/go-autorest/autorest/to v0.4.0 h1:oXVqrxakqqV1UZdSazDOPOLvOIz+XA683u8EctwboHk= github.com/Azure/go-autorest/autorest/to v0.4.0/go.mod h1:fE8iZBn7LQR7zH/9XU2NcPR4o9jEImooCeWJcYV/zLE= -github.com/Azure/go-autorest/autorest/validation v0.3.0/go.mod h1:yhLgjC0Wda5DYXl6JAsWyUe4KVNffhoDhG0zVzUMo3E= github.com/Azure/go-autorest/autorest/validation v0.3.1 h1:AgyqjAd94fwNAoTjl/WQXg4VvFeRFpO+UhNyRXqF1ac= github.com/Azure/go-autorest/autorest/validation v0.3.1/go.mod h1:yhLgjC0Wda5DYXl6JAsWyUe4KVNffhoDhG0zVzUMo3E= github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= @@ -87,8 +81,8 @@ github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+Z github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= -github.com/Azure/skewer v0.0.14 h1:0mzUJhspECkajYyynYsOCp//E2PSnYXrgP45bcskqfQ= -github.com/Azure/skewer v0.0.14/go.mod h1:6WTecuPyfGtuvS8Mh4JYWuHhO4kcWycGfsUBB+XTFG4= +github.com/Azure/skewer v0.0.17 h1:2jyvHdU+uO9UVylvVq/YEG3OIQLsCeFezFmJW00rEQc= +github.com/Azure/skewer v0.0.17/go.mod h1:5207ue3Zm+E8QW/e0MISrocDm8pSApfsTe048VaGnN0= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/GoogleCloudPlatform/k8s-cloud-provider v1.18.1-0.20220218231025-f11817397a1b h1:Heo1J/ttaQFgGJSVnCZquy3e5eH5j1nqxBuomztB3P0= @@ -267,22 +261,21 @@ github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.0.6 h1:mkgN1ofwASrYnJ5W6U/BxG15eXXXjirgZc7CLqkcaro= github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= -github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gofrs/uuid v4.2.0+incompatible h1:yyYWMnhkhrKwwr8gAOcOCYxOOscHgDS9yZgBrnJfGa0= +github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs= -github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= +github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= @@ -484,8 +477,8 @@ github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRW github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/onsi/ginkgo/v2 v2.9.1 h1:zie5Ly042PD3bsCvsSOPvRnFwyo3rKe64TJlD6nu0mk= -github.com/onsi/gomega v1.27.4 h1:Z2AnStgsdSayCMDiCU42qIz+HLqEPcgiOCXjAU/w+8E= +github.com/onsi/ginkgo/v2 v2.9.7 h1:06xGQy5www2oN160RtEZoTvnP2sPhEfePYmCDc2szss= +github.com/onsi/gomega v1.27.7 h1:fVih9JD6ogIiHUN6ePK7HJidyEDpWGVB5mzM7cWNXoU= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= @@ -592,8 +585,9 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 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 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= @@ -681,13 +675,13 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ= -golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= +golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= +golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= +golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -774,8 +768,9 @@ golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= -golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -810,8 +805,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/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 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= +golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -885,14 +880,16 @@ golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 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.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= -golang.org/x/term v0.7.0 h1:BEvjmm5fURWqcfbSKTdpkDXYBrUS1c0m8agp14W48vQ= -golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0 h1:n5xxQn2i3PC0yLAbjTpNT85q/Kgzcr2gIoX9OrJUols= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -904,6 +901,7 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.5.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 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -967,7 +965,7 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= +golang.org/x/tools v0.9.1 h1:8WMNJAz3zrtPmnYC7ISf5dEn3MT0gY7jBJfw27yrrLo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1216,8 +1214,8 @@ rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.1.2 h1:trsWhjU5jZrx6UvFu4WzQDrN7Pga4a7Qg+zcfcj64PA= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.1.2/go.mod h1:+qG7ISXqCDVVcyO8hLn12AKVYYUjM7ftlqsqmrhMZE0= -sigs.k8s.io/cloud-provider-azure v1.26.2 h1://Yr95O53fcY/sakPvXdekCW4o2QKhfs1kNtipR7LpE= -sigs.k8s.io/cloud-provider-azure v1.26.2/go.mod h1:9m8BqB9ubr94uWWgbIY8TyUmHhsE2UEKdAZZG8O/ymc= +sigs.k8s.io/cloud-provider-azure v1.27.5 h1:D/xONxiecBrWw+45YiygUryntb6MAoMNUsHYH/Lg1hc= +sigs.k8s.io/cloud-provider-azure v1.27.5/go.mod h1:kpbVqvl78SN95q4sE3AAj0SW96JxtCDm0Z4+8Q1lBOY= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE= diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/availabilitysets.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/availabilitysets.go deleted file mode 100644 index 037d43974cb6..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/availabilitysets.go +++ /dev/null @@ -1,652 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// AvailabilitySetsClient is the compute Client -type AvailabilitySetsClient struct { - BaseClient -} - -// NewAvailabilitySetsClient creates an instance of the AvailabilitySetsClient client. -func NewAvailabilitySetsClient(subscriptionID string) AvailabilitySetsClient { - return NewAvailabilitySetsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAvailabilitySetsClientWithBaseURI creates an instance of the AvailabilitySetsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewAvailabilitySetsClientWithBaseURI(baseURI string, subscriptionID string) AvailabilitySetsClient { - return AvailabilitySetsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update an availability set. -// Parameters: -// resourceGroupName - the name of the resource group. -// availabilitySetName - the name of the availability set. -// parameters - parameters supplied to the Create Availability Set operation. -func (client AvailabilitySetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySet) (result AvailabilitySet, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, availabilitySetName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client AvailabilitySetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySet) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "availabilitySetName": autorest.Encode("path", availabilitySetName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client AvailabilitySetsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client AvailabilitySetsClient) CreateOrUpdateResponder(resp *http.Response) (result AvailabilitySet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete an availability set. -// Parameters: -// resourceGroupName - the name of the resource group. -// availabilitySetName - the name of the availability set. -func (client AvailabilitySetsClient) Delete(ctx context.Context, resourceGroupName string, availabilitySetName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, availabilitySetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client AvailabilitySetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, availabilitySetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "availabilitySetName": autorest.Encode("path", availabilitySetName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client AvailabilitySetsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client AvailabilitySetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about an availability set. -// Parameters: -// resourceGroupName - the name of the resource group. -// availabilitySetName - the name of the availability set. -func (client AvailabilitySetsClient) Get(ctx context.Context, resourceGroupName string, availabilitySetName string) (result AvailabilitySet, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, availabilitySetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client AvailabilitySetsClient) GetPreparer(ctx context.Context, resourceGroupName string, availabilitySetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "availabilitySetName": autorest.Encode("path", availabilitySetName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client AvailabilitySetsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client AvailabilitySetsClient) GetResponder(resp *http.Response) (result AvailabilitySet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all availability sets in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client AvailabilitySetsClient) List(ctx context.Context, resourceGroupName string) (result AvailabilitySetListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.List") - defer func() { - sc := -1 - if result.aslr.Response.Response != nil { - sc = result.aslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.aslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", resp, "Failure sending request") - return - } - - result.aslr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", resp, "Failure responding to request") - return - } - if result.aslr.hasNextLink() && result.aslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client AvailabilitySetsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client AvailabilitySetsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client AvailabilitySetsClient) ListResponder(resp *http.Response) (result AvailabilitySetListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client AvailabilitySetsClient) listNextResults(ctx context.Context, lastResults AvailabilitySetListResult) (result AvailabilitySetListResult, err error) { - req, err := lastResults.availabilitySetListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AvailabilitySetsClient) ListComplete(ctx context.Context, resourceGroupName string) (result AvailabilitySetListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAvailableSizes lists all available virtual machine sizes that can be used to create a new virtual machine in an -// existing availability set. -// Parameters: -// resourceGroupName - the name of the resource group. -// availabilitySetName - the name of the availability set. -func (client AvailabilitySetsClient) ListAvailableSizes(ctx context.Context, resourceGroupName string, availabilitySetName string) (result VirtualMachineSizeListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListAvailableSizes") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListAvailableSizesPreparer(ctx, resourceGroupName, availabilitySetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", nil, "Failure preparing request") - return - } - - resp, err := client.ListAvailableSizesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", resp, "Failure sending request") - return - } - - result, err = client.ListAvailableSizesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", resp, "Failure responding to request") - return - } - - return -} - -// ListAvailableSizesPreparer prepares the ListAvailableSizes request. -func (client AvailabilitySetsClient) ListAvailableSizesPreparer(ctx context.Context, resourceGroupName string, availabilitySetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "availabilitySetName": autorest.Encode("path", availabilitySetName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAvailableSizesSender sends the ListAvailableSizes request. The method will close the -// http.Response Body if it receives an error. -func (client AvailabilitySetsClient) ListAvailableSizesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAvailableSizesResponder handles the response to the ListAvailableSizes request. The method always -// closes the http.Response Body. -func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListBySubscription lists all availability sets in a subscription. -// Parameters: -// expand - the expand expression to apply to the operation. Allowed values are 'instanceView'. -func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context, expand string) (result AvailabilitySetListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription") - defer func() { - sc := -1 - if result.aslr.Response.Response != nil { - sc = result.aslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.aslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result.aslr, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", resp, "Failure responding to request") - return - } - if result.aslr.hasNextLink() && result.aslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/availabilitySets", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListBySubscriptionSender sends the ListBySubscription request. The method will close the -// http.Response Body if it receives an error. -func (client AvailabilitySetsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client AvailabilitySetsClient) ListBySubscriptionResponder(resp *http.Response) (result AvailabilitySetListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listBySubscriptionNextResults retrieves the next set of results, if any. -func (client AvailabilitySetsClient) listBySubscriptionNextResults(ctx context.Context, lastResults AvailabilitySetListResult) (result AvailabilitySetListResult, err error) { - req, err := lastResults.availabilitySetListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context, expand string) (result AvailabilitySetListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListBySubscription(ctx, expand) - return -} - -// Update update an availability set. -// Parameters: -// resourceGroupName - the name of the resource group. -// availabilitySetName - the name of the availability set. -// parameters - parameters supplied to the Update Availability Set operation. -func (client AvailabilitySetsClient) Update(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySetUpdate) (result AvailabilitySet, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, availabilitySetName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client AvailabilitySetsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySetUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "availabilitySetName": autorest.Encode("path", availabilitySetName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client AvailabilitySetsClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client AvailabilitySetsClient) UpdateResponder(resp *http.Response) (result AvailabilitySet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/client.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/client.go deleted file mode 100644 index c7c4543154d5..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/client.go +++ /dev/null @@ -1,43 +0,0 @@ -// Deprecated: Please note, this package has been deprecated. A replacement package is available [github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute). We strongly encourage you to upgrade to continue receiving updates. See [Migration Guide](https://aka.ms/azsdk/golang/t2/migration) for guidance on upgrading. Refer to our [deprecation policy](https://azure.github.io/azure-sdk/policies_support.html) for more details. -// -// Package compute implements the Azure ARM Compute service API version . -// -// Compute Client -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "github.com/Azure/go-autorest/autorest" -) - -const ( - // DefaultBaseURI is the default URI used for the service Compute - DefaultBaseURI = "https://management.azure.com" -) - -// BaseClient is the base client for Compute. -type BaseClient struct { - autorest.Client - BaseURI string - SubscriptionID string -} - -// New creates an instance of the BaseClient client. -func New(subscriptionID string) BaseClient { - return NewWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with -// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { - return BaseClient{ - Client: autorest.NewClientWithUserAgent(UserAgent()), - BaseURI: baseURI, - SubscriptionID: subscriptionID, - } -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/containerservices.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/containerservices.go deleted file mode 100644 index b1c854615c25..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/containerservices.go +++ /dev/null @@ -1,538 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ContainerServicesClient is the compute Client -type ContainerServicesClient struct { - BaseClient -} - -// NewContainerServicesClient creates an instance of the ContainerServicesClient client. -func NewContainerServicesClient(subscriptionID string) ContainerServicesClient { - return NewContainerServicesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewContainerServicesClientWithBaseURI creates an instance of the ContainerServicesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewContainerServicesClientWithBaseURI(baseURI string, subscriptionID string) ContainerServicesClient { - return ContainerServicesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a container service with the specified configuration of orchestrator, masters, and -// agents. -// Parameters: -// resourceGroupName - the name of the resource group. -// containerServiceName - the name of the container service in the specified subscription and resource group. -// parameters - parameters supplied to the Create or Update a Container Service operation. -func (client ContainerServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, containerServiceName string, parameters ContainerService) (result ContainerServicesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.ContainerServiceProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.CustomProfile", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.CustomProfile.Orchestrator", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.ContainerServiceProperties.ServicePrincipalProfile", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.ServicePrincipalProfile.ClientID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ContainerServiceProperties.ServicePrincipalProfile.Secret", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "parameters.ContainerServiceProperties.MasterProfile", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.MasterProfile.DNSPrefix", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.ContainerServiceProperties.AgentPoolProfiles", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.ContainerServiceProperties.WindowsProfile", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.WindowsProfile.AdminUsername", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.WindowsProfile.AdminUsername", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([._]?[a-zA-Z0-9]+)*$`, Chain: nil}}}, - {Target: "parameters.ContainerServiceProperties.WindowsProfile.AdminPassword", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "parameters.ContainerServiceProperties.LinuxProfile", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.LinuxProfile.AdminUsername", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.LinuxProfile.AdminUsername", Name: validation.Pattern, Rule: `^[a-z][a-z0-9_-]*$`, Chain: nil}}}, - {Target: "parameters.ContainerServiceProperties.LinuxProfile.SSH", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.LinuxProfile.SSH.PublicKeys", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - {Target: "parameters.ContainerServiceProperties.DiagnosticsProfile", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.DiagnosticsProfile.VMDiagnostics", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.DiagnosticsProfile.VMDiagnostics.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.ContainerServicesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, containerServiceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ContainerServicesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, containerServiceName string, parameters ContainerService) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "containerServiceName": autorest.Encode("path", containerServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-01-31" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ContainerServicesClient) CreateOrUpdateSender(req *http.Request) (future ContainerServicesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ContainerServicesClient) CreateOrUpdateResponder(resp *http.Response) (result ContainerService, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified container service in the specified subscription and resource group. The operation does -// not delete other resources created as part of creating a container service, including storage accounts, VMs, and -// availability sets. All the other resources created with the container service are part of the same resource group -// and can be deleted individually. -// Parameters: -// resourceGroupName - the name of the resource group. -// containerServiceName - the name of the container service in the specified subscription and resource group. -func (client ContainerServicesClient) Delete(ctx context.Context, resourceGroupName string, containerServiceName string) (result ContainerServicesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, containerServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ContainerServicesClient) DeletePreparer(ctx context.Context, resourceGroupName string, containerServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "containerServiceName": autorest.Encode("path", containerServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-01-31" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ContainerServicesClient) DeleteSender(req *http.Request) (future ContainerServicesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ContainerServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets the properties of the specified container service in the specified subscription and resource group. The -// operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of masters -// and agents. -// Parameters: -// resourceGroupName - the name of the resource group. -// containerServiceName - the name of the container service in the specified subscription and resource group. -func (client ContainerServicesClient) Get(ctx context.Context, resourceGroupName string, containerServiceName string) (result ContainerService, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, containerServiceName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ContainerServicesClient) GetPreparer(ctx context.Context, resourceGroupName string, containerServiceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "containerServiceName": autorest.Encode("path", containerServiceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-01-31" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ContainerServicesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ContainerServicesClient) GetResponder(resp *http.Response) (result ContainerService, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets a list of container services in the specified subscription. The operation returns properties of each -// container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. -func (client ContainerServicesClient) List(ctx context.Context) (result ContainerServiceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.List") - defer func() { - sc := -1 - if result.cslr.Response.Response != nil { - sc = result.cslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.cslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "List", resp, "Failure sending request") - return - } - - result.cslr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "List", resp, "Failure responding to request") - return - } - if result.cslr.hasNextLink() && result.cslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ContainerServicesClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-01-31" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/containerServices", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ContainerServicesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ContainerServicesClient) ListResponder(resp *http.Response) (result ContainerServiceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ContainerServicesClient) listNextResults(ctx context.Context, lastResults ContainerServiceListResult) (result ContainerServiceListResult, err error) { - req, err := lastResults.containerServiceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ContainerServicesClient) ListComplete(ctx context.Context) (result ContainerServiceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup gets a list of container services in the specified subscription and resource group. The -// operation returns properties of each container service including state, orchestrator, number of masters and agents, -// and FQDNs of masters and agents. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client ContainerServicesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ContainerServiceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.cslr.Response.Response != nil { - sc = result.cslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.cslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.cslr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.cslr.hasNextLink() && result.cslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client ContainerServicesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2017-01-31" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client ContainerServicesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client ContainerServicesClient) ListByResourceGroupResponder(resp *http.Response) (result ContainerServiceListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client ContainerServicesClient) listByResourceGroupNextResults(ctx context.Context, lastResults ContainerServiceListResult) (result ContainerServiceListResult, err error) { - req, err := lastResults.containerServiceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client ContainerServicesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ContainerServiceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/dedicatedhostgroups.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/dedicatedhostgroups.go deleted file mode 100644 index 0c27cf401280..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/dedicatedhostgroups.go +++ /dev/null @@ -1,585 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DedicatedHostGroupsClient is the compute Client -type DedicatedHostGroupsClient struct { - BaseClient -} - -// NewDedicatedHostGroupsClient creates an instance of the DedicatedHostGroupsClient client. -func NewDedicatedHostGroupsClient(subscriptionID string) DedicatedHostGroupsClient { - return NewDedicatedHostGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDedicatedHostGroupsClientWithBaseURI creates an instance of the DedicatedHostGroupsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewDedicatedHostGroupsClientWithBaseURI(baseURI string, subscriptionID string) DedicatedHostGroupsClient { - return DedicatedHostGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups -// please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -// parameters - parameters supplied to the Create Dedicated Host Group. -func (client DedicatedHostGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroup) (result DedicatedHostGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.DedicatedHostGroupProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.DedicatedHostGroupProperties.PlatformFaultDomainCount", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.DedicatedHostGroupProperties.PlatformFaultDomainCount", Name: validation.InclusiveMaximum, Rule: int64(3), Chain: nil}, - {Target: "parameters.DedicatedHostGroupProperties.PlatformFaultDomainCount", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.DedicatedHostGroupsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, hostGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DedicatedHostGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroup) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client DedicatedHostGroupsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client DedicatedHostGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result DedicatedHostGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a dedicated host group. -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -func (client DedicatedHostGroupsClient) Delete(ctx context.Context, resourceGroupName string, hostGroupName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, hostGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client DedicatedHostGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, hostGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client DedicatedHostGroupsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client DedicatedHostGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about a dedicated host group. -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -func (client DedicatedHostGroupsClient) Get(ctx context.Context, resourceGroupName string, hostGroupName string) (result DedicatedHostGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, hostGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client DedicatedHostGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, hostGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client DedicatedHostGroupsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DedicatedHostGroupsClient) GetResponder(resp *http.Response) (result DedicatedHostGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByResourceGroup lists all of the dedicated host groups in the specified resource group. Use the nextLink -// property in the response to get the next page of dedicated host groups. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client DedicatedHostGroupsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DedicatedHostGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.dhglr.Response.Response != nil { - sc = result.dhglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.dhglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.dhglr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.dhglr.hasNextLink() && result.dhglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client DedicatedHostGroupsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client DedicatedHostGroupsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client DedicatedHostGroupsClient) ListByResourceGroupResponder(resp *http.Response) (result DedicatedHostGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client DedicatedHostGroupsClient) listByResourceGroupNextResults(ctx context.Context, lastResults DedicatedHostGroupListResult) (result DedicatedHostGroupListResult, err error) { - req, err := lastResults.dedicatedHostGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client DedicatedHostGroupsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result DedicatedHostGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// ListBySubscription lists all of the dedicated host groups in the subscription. Use the nextLink property in the -// response to get the next page of dedicated host groups. -func (client DedicatedHostGroupsClient) ListBySubscription(ctx context.Context) (result DedicatedHostGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.ListBySubscription") - defer func() { - sc := -1 - if result.dhglr.Response.Response != nil { - sc = result.dhglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.dhglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result.dhglr, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "ListBySubscription", resp, "Failure responding to request") - return - } - if result.dhglr.hasNextLink() && result.dhglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client DedicatedHostGroupsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/hostGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListBySubscriptionSender sends the ListBySubscription request. The method will close the -// http.Response Body if it receives an error. -func (client DedicatedHostGroupsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client DedicatedHostGroupsClient) ListBySubscriptionResponder(resp *http.Response) (result DedicatedHostGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listBySubscriptionNextResults retrieves the next set of results, if any. -func (client DedicatedHostGroupsClient) listBySubscriptionNextResults(ctx context.Context, lastResults DedicatedHostGroupListResult) (result DedicatedHostGroupListResult, err error) { - req, err := lastResults.dedicatedHostGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client DedicatedHostGroupsClient) ListBySubscriptionComplete(ctx context.Context) (result DedicatedHostGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.ListBySubscription") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListBySubscription(ctx) - return -} - -// Update update an dedicated host group. -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -// parameters - parameters supplied to the Update Dedicated Host Group operation. -func (client DedicatedHostGroupsClient) Update(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroupUpdate) (result DedicatedHostGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupsClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, hostGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostGroupsClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client DedicatedHostGroupsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, hostGroupName string, parameters DedicatedHostGroupUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client DedicatedHostGroupsClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client DedicatedHostGroupsClient) UpdateResponder(resp *http.Response) (result DedicatedHostGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/dedicatedhosts.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/dedicatedhosts.go deleted file mode 100644 index 7e603beede93..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/dedicatedhosts.go +++ /dev/null @@ -1,493 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DedicatedHostsClient is the compute Client -type DedicatedHostsClient struct { - BaseClient -} - -// NewDedicatedHostsClient creates an instance of the DedicatedHostsClient client. -func NewDedicatedHostsClient(subscriptionID string) DedicatedHostsClient { - return NewDedicatedHostsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDedicatedHostsClientWithBaseURI creates an instance of the DedicatedHostsClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewDedicatedHostsClientWithBaseURI(baseURI string, subscriptionID string) DedicatedHostsClient { - return DedicatedHostsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a dedicated host . -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -// hostName - the name of the dedicated host . -// parameters - parameters supplied to the Create Dedicated Host. -func (client DedicatedHostsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHost) (result DedicatedHostsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.DedicatedHostProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.DedicatedHostProperties.PlatformFaultDomain", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.DedicatedHostProperties.PlatformFaultDomain", Name: validation.InclusiveMaximum, Rule: int64(2), Chain: nil}, - {Target: "parameters.DedicatedHostProperties.PlatformFaultDomain", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}, - {Target: "parameters.Sku", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.DedicatedHostsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, hostGroupName, hostName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DedicatedHostsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHost) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "hostName": autorest.Encode("path", hostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client DedicatedHostsClient) CreateOrUpdateSender(req *http.Request) (future DedicatedHostsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client DedicatedHostsClient) CreateOrUpdateResponder(resp *http.Response) (result DedicatedHost, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a dedicated host. -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -// hostName - the name of the dedicated host. -func (client DedicatedHostsClient) Delete(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string) (result DedicatedHostsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, hostGroupName, hostName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client DedicatedHostsClient) DeletePreparer(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "hostName": autorest.Encode("path", hostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client DedicatedHostsClient) DeleteSender(req *http.Request) (future DedicatedHostsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client DedicatedHostsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about a dedicated host. -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -// hostName - the name of the dedicated host. -// expand - the expand expression to apply on the operation. -func (client DedicatedHostsClient) Get(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, expand InstanceViewTypes) (result DedicatedHost, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, hostGroupName, hostName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client DedicatedHostsClient) GetPreparer(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, expand InstanceViewTypes) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "hostName": autorest.Encode("path", hostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client DedicatedHostsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DedicatedHostsClient) GetResponder(resp *http.Response) (result DedicatedHost, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByHostGroup lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in -// the response to get the next page of dedicated hosts. -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -func (client DedicatedHostsClient) ListByHostGroup(ctx context.Context, resourceGroupName string, hostGroupName string) (result DedicatedHostListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.ListByHostGroup") - defer func() { - sc := -1 - if result.dhlr.Response.Response != nil { - sc = result.dhlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByHostGroupNextResults - req, err := client.ListByHostGroupPreparer(ctx, resourceGroupName, hostGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "ListByHostGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByHostGroupSender(req) - if err != nil { - result.dhlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "ListByHostGroup", resp, "Failure sending request") - return - } - - result.dhlr, err = client.ListByHostGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "ListByHostGroup", resp, "Failure responding to request") - return - } - if result.dhlr.hasNextLink() && result.dhlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByHostGroupPreparer prepares the ListByHostGroup request. -func (client DedicatedHostsClient) ListByHostGroupPreparer(ctx context.Context, resourceGroupName string, hostGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByHostGroupSender sends the ListByHostGroup request. The method will close the -// http.Response Body if it receives an error. -func (client DedicatedHostsClient) ListByHostGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByHostGroupResponder handles the response to the ListByHostGroup request. The method always -// closes the http.Response Body. -func (client DedicatedHostsClient) ListByHostGroupResponder(resp *http.Response) (result DedicatedHostListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByHostGroupNextResults retrieves the next set of results, if any. -func (client DedicatedHostsClient) listByHostGroupNextResults(ctx context.Context, lastResults DedicatedHostListResult) (result DedicatedHostListResult, err error) { - req, err := lastResults.dedicatedHostListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "listByHostGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByHostGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "listByHostGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByHostGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "listByHostGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByHostGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client DedicatedHostsClient) ListByHostGroupComplete(ctx context.Context, resourceGroupName string, hostGroupName string) (result DedicatedHostListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.ListByHostGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByHostGroup(ctx, resourceGroupName, hostGroupName) - return -} - -// Update update an dedicated host . -// Parameters: -// resourceGroupName - the name of the resource group. -// hostGroupName - the name of the dedicated host group. -// hostName - the name of the dedicated host . -// parameters - parameters supplied to the Update Dedicated Host operation. -func (client DedicatedHostsClient) Update(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHostUpdate) (result DedicatedHostsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, hostGroupName, hostName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client DedicatedHostsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, hostGroupName string, hostName string, parameters DedicatedHostUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "hostGroupName": autorest.Encode("path", hostGroupName), - "hostName": autorest.Encode("path", hostName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client DedicatedHostsClient) UpdateSender(req *http.Request) (future DedicatedHostsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client DedicatedHostsClient) UpdateResponder(resp *http.Response) (result DedicatedHost, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/diskencryptionsets.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/diskencryptionsets.go deleted file mode 100644 index 614e91345490..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/diskencryptionsets.go +++ /dev/null @@ -1,601 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DiskEncryptionSetsClient is the compute Client -type DiskEncryptionSetsClient struct { - BaseClient -} - -// NewDiskEncryptionSetsClient creates an instance of the DiskEncryptionSetsClient client. -func NewDiskEncryptionSetsClient(subscriptionID string) DiskEncryptionSetsClient { - return NewDiskEncryptionSetsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDiskEncryptionSetsClientWithBaseURI creates an instance of the DiskEncryptionSetsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewDiskEncryptionSetsClientWithBaseURI(baseURI string, subscriptionID string) DiskEncryptionSetsClient { - return DiskEncryptionSetsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a disk encryption set -// Parameters: -// resourceGroupName - the name of the resource group. -// diskEncryptionSetName - the name of the disk encryption set that is being created. The name can't be changed -// after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The -// maximum name length is 80 characters. -// diskEncryptionSet - disk encryption set object supplied in the body of the Put disk encryption set -// operation. -func (client DiskEncryptionSetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSet) (result DiskEncryptionSetsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: diskEncryptionSet, - Constraints: []validation.Constraint{{Target: "diskEncryptionSet.EncryptionSetProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "diskEncryptionSet.EncryptionSetProperties.ActiveKey", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "diskEncryptionSet.EncryptionSetProperties.ActiveKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "diskEncryptionSet.EncryptionSetProperties.ActiveKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.DiskEncryptionSetsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, diskEncryptionSetName, diskEncryptionSet) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DiskEncryptionSetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSet) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskEncryptionSetName": autorest.Encode("path", diskEncryptionSetName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", pathParameters), - autorest.WithJSON(diskEncryptionSet), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client DiskEncryptionSetsClient) CreateOrUpdateSender(req *http.Request) (future DiskEncryptionSetsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client DiskEncryptionSetsClient) CreateOrUpdateResponder(resp *http.Response) (result DiskEncryptionSet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a disk encryption set. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskEncryptionSetName - the name of the disk encryption set that is being created. The name can't be changed -// after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The -// maximum name length is 80 characters. -func (client DiskEncryptionSetsClient) Delete(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (result DiskEncryptionSetsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, diskEncryptionSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client DiskEncryptionSetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskEncryptionSetName": autorest.Encode("path", diskEncryptionSetName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client DiskEncryptionSetsClient) DeleteSender(req *http.Request) (future DiskEncryptionSetsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client DiskEncryptionSetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets information about a disk encryption set. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskEncryptionSetName - the name of the disk encryption set that is being created. The name can't be changed -// after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The -// maximum name length is 80 characters. -func (client DiskEncryptionSetsClient) Get(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (result DiskEncryptionSet, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, diskEncryptionSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client DiskEncryptionSetsClient) GetPreparer(ctx context.Context, resourceGroupName string, diskEncryptionSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskEncryptionSetName": autorest.Encode("path", diskEncryptionSetName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client DiskEncryptionSetsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DiskEncryptionSetsClient) GetResponder(resp *http.Response) (result DiskEncryptionSet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all the disk encryption sets under a subscription. -func (client DiskEncryptionSetsClient) List(ctx context.Context) (result DiskEncryptionSetListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.List") - defer func() { - sc := -1 - if result.desl.Response.Response != nil { - sc = result.desl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.desl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "List", resp, "Failure sending request") - return - } - - result.desl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "List", resp, "Failure responding to request") - return - } - if result.desl.hasNextLink() && result.desl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client DiskEncryptionSetsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/diskEncryptionSets", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client DiskEncryptionSetsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client DiskEncryptionSetsClient) ListResponder(resp *http.Response) (result DiskEncryptionSetList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client DiskEncryptionSetsClient) listNextResults(ctx context.Context, lastResults DiskEncryptionSetList) (result DiskEncryptionSetList, err error) { - req, err := lastResults.diskEncryptionSetListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client DiskEncryptionSetsClient) ListComplete(ctx context.Context) (result DiskEncryptionSetListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists all the disk encryption sets under a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client DiskEncryptionSetsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DiskEncryptionSetListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.desl.Response.Response != nil { - sc = result.desl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.desl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.desl, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.desl.hasNextLink() && result.desl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client DiskEncryptionSetsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client DiskEncryptionSetsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client DiskEncryptionSetsClient) ListByResourceGroupResponder(resp *http.Response) (result DiskEncryptionSetList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client DiskEncryptionSetsClient) listByResourceGroupNextResults(ctx context.Context, lastResults DiskEncryptionSetList) (result DiskEncryptionSetList, err error) { - req, err := lastResults.diskEncryptionSetListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client DiskEncryptionSetsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result DiskEncryptionSetListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// Update updates (patches) a disk encryption set. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskEncryptionSetName - the name of the disk encryption set that is being created. The name can't be changed -// after the disk encryption set is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The -// maximum name length is 80 characters. -// diskEncryptionSet - disk encryption set object supplied in the body of the Patch disk encryption set -// operation. -func (client DiskEncryptionSetsClient) Update(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSetUpdate) (result DiskEncryptionSetsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, diskEncryptionSetName, diskEncryptionSet) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client DiskEncryptionSetsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, diskEncryptionSetName string, diskEncryptionSet DiskEncryptionSetUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskEncryptionSetName": autorest.Encode("path", diskEncryptionSetName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{diskEncryptionSetName}", pathParameters), - autorest.WithJSON(diskEncryptionSet), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client DiskEncryptionSetsClient) UpdateSender(req *http.Request) (future DiskEncryptionSetsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client DiskEncryptionSetsClient) UpdateResponder(resp *http.Response) (result DiskEncryptionSet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/disks.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/disks.go deleted file mode 100644 index ad7cae61bb38..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/disks.go +++ /dev/null @@ -1,771 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DisksClient is the compute Client -type DisksClient struct { - BaseClient -} - -// NewDisksClient creates an instance of the DisksClient client. -func NewDisksClient(subscriptionID string) DisksClient { - return NewDisksClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDisksClientWithBaseURI creates an instance of the DisksClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewDisksClientWithBaseURI(baseURI string, subscriptionID string) DisksClient { - return DisksClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a disk. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is -// created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 -// characters. -// disk - disk object supplied in the body of the Put disk operation. -func (client DisksClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, diskName string, disk Disk) (result DisksCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: disk, - Constraints: []validation.Constraint{{Target: "disk.DiskProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "disk.DiskProperties.CreationData", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "disk.DiskProperties.CreationData.ImageReference", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "disk.DiskProperties.CreationData.ImageReference.ID", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - {Target: "disk.DiskProperties.EncryptionSettingsCollection", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "disk.DiskProperties.EncryptionSettingsCollection.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}, - }}}}}); err != nil { - return result, validation.NewError("compute.DisksClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, diskName, disk) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DisksClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, diskName string, disk Disk) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskName": autorest.Encode("path", diskName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - disk.ManagedBy = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters), - autorest.WithJSON(disk), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client DisksClient) CreateOrUpdateSender(req *http.Request) (future DisksCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client DisksClient) CreateOrUpdateResponder(resp *http.Response) (result Disk, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a disk. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is -// created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 -// characters. -func (client DisksClient) Delete(ctx context.Context, resourceGroupName string, diskName string) (result DisksDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, diskName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client DisksClient) DeletePreparer(ctx context.Context, resourceGroupName string, diskName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskName": autorest.Encode("path", diskName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client DisksClient) DeleteSender(req *http.Request) (future DisksDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client DisksClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets information about a disk. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is -// created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 -// characters. -func (client DisksClient) Get(ctx context.Context, resourceGroupName string, diskName string) (result Disk, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, diskName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DisksClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client DisksClient) GetPreparer(ctx context.Context, resourceGroupName string, diskName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskName": autorest.Encode("path", diskName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client DisksClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client DisksClient) GetResponder(resp *http.Response) (result Disk, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GrantAccess grants access to a disk. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is -// created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 -// characters. -// grantAccessData - access data object supplied in the body of the get disk access operation. -func (client DisksClient) GrantAccess(ctx context.Context, resourceGroupName string, diskName string, grantAccessData GrantAccessData) (result DisksGrantAccessFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.GrantAccess") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: grantAccessData, - Constraints: []validation.Constraint{{Target: "grantAccessData.DurationInSeconds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.DisksClient", "GrantAccess", err.Error()) - } - - req, err := client.GrantAccessPreparer(ctx, resourceGroupName, diskName, grantAccessData) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "GrantAccess", nil, "Failure preparing request") - return - } - - result, err = client.GrantAccessSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "GrantAccess", result.Response(), "Failure sending request") - return - } - - return -} - -// GrantAccessPreparer prepares the GrantAccess request. -func (client DisksClient) GrantAccessPreparer(ctx context.Context, resourceGroupName string, diskName string, grantAccessData GrantAccessData) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskName": autorest.Encode("path", diskName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess", pathParameters), - autorest.WithJSON(grantAccessData), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GrantAccessSender sends the GrantAccess request. The method will close the -// http.Response Body if it receives an error. -func (client DisksClient) GrantAccessSender(req *http.Request) (future DisksGrantAccessFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GrantAccessResponder handles the response to the GrantAccess request. The method always -// closes the http.Response Body. -func (client DisksClient) GrantAccessResponder(resp *http.Response) (result AccessURI, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all the disks under a subscription. -func (client DisksClient) List(ctx context.Context) (result DiskListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.List") - defer func() { - sc := -1 - if result.dl.Response.Response != nil { - sc = result.dl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.dl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DisksClient", "List", resp, "Failure sending request") - return - } - - result.dl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "List", resp, "Failure responding to request") - return - } - if result.dl.hasNextLink() && result.dl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client DisksClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/disks", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client DisksClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client DisksClient) ListResponder(resp *http.Response) (result DiskList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client DisksClient) listNextResults(ctx context.Context, lastResults DiskList) (result DiskList, err error) { - req, err := lastResults.diskListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DisksClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.DisksClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client DisksClient) ListComplete(ctx context.Context) (result DiskListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists all the disks under a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client DisksClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DiskListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.dl.Response.Response != nil { - sc = result.dl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.dl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.DisksClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.dl, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.dl.hasNextLink() && result.dl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client DisksClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client DisksClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client DisksClient) ListByResourceGroupResponder(resp *http.Response) (result DiskList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client DisksClient) listByResourceGroupNextResults(ctx context.Context, lastResults DiskList) (result DiskList, err error) { - req, err := lastResults.diskListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.DisksClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.DisksClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client DisksClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result DiskListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// RevokeAccess revokes access to a disk. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is -// created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 -// characters. -func (client DisksClient) RevokeAccess(ctx context.Context, resourceGroupName string, diskName string) (result DisksRevokeAccessFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.RevokeAccess") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RevokeAccessPreparer(ctx, resourceGroupName, diskName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "RevokeAccess", nil, "Failure preparing request") - return - } - - result, err = client.RevokeAccessSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "RevokeAccess", result.Response(), "Failure sending request") - return - } - - return -} - -// RevokeAccessPreparer prepares the RevokeAccess request. -func (client DisksClient) RevokeAccessPreparer(ctx context.Context, resourceGroupName string, diskName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskName": autorest.Encode("path", diskName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RevokeAccessSender sends the RevokeAccess request. The method will close the -// http.Response Body if it receives an error. -func (client DisksClient) RevokeAccessSender(req *http.Request) (future DisksRevokeAccessFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RevokeAccessResponder handles the response to the RevokeAccess request. The method always -// closes the http.Response Body. -func (client DisksClient) RevokeAccessResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Update updates (patches) a disk. -// Parameters: -// resourceGroupName - the name of the resource group. -// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is -// created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 -// characters. -// disk - disk object supplied in the body of the Patch disk operation. -func (client DisksClient) Update(ctx context.Context, resourceGroupName string, diskName string, disk DiskUpdate) (result DisksUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, diskName, disk) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client DisksClient) UpdatePreparer(ctx context.Context, resourceGroupName string, diskName string, disk DiskUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diskName": autorest.Encode("path", diskName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters), - autorest.WithJSON(disk), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client DisksClient) UpdateSender(req *http.Request) (future DisksUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client DisksClient) UpdateResponder(resp *http.Response) (result Disk, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/enums.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/enums.go deleted file mode 100644 index 4d6d9707d85b..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/enums.go +++ /dev/null @@ -1,1330 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -// AccessLevel enumerates the values for access level. -type AccessLevel string - -const ( - // None ... - None AccessLevel = "None" - // Read ... - Read AccessLevel = "Read" - // Write ... - Write AccessLevel = "Write" -) - -// PossibleAccessLevelValues returns an array of possible values for the AccessLevel const type. -func PossibleAccessLevelValues() []AccessLevel { - return []AccessLevel{None, Read, Write} -} - -// AggregatedReplicationState enumerates the values for aggregated replication state. -type AggregatedReplicationState string - -const ( - // Completed ... - Completed AggregatedReplicationState = "Completed" - // Failed ... - Failed AggregatedReplicationState = "Failed" - // InProgress ... - InProgress AggregatedReplicationState = "InProgress" - // Unknown ... - Unknown AggregatedReplicationState = "Unknown" -) - -// PossibleAggregatedReplicationStateValues returns an array of possible values for the AggregatedReplicationState const type. -func PossibleAggregatedReplicationStateValues() []AggregatedReplicationState { - return []AggregatedReplicationState{Completed, Failed, InProgress, Unknown} -} - -// AvailabilitySetSkuTypes enumerates the values for availability set sku types. -type AvailabilitySetSkuTypes string - -const ( - // Aligned ... - Aligned AvailabilitySetSkuTypes = "Aligned" - // Classic ... - Classic AvailabilitySetSkuTypes = "Classic" -) - -// PossibleAvailabilitySetSkuTypesValues returns an array of possible values for the AvailabilitySetSkuTypes const type. -func PossibleAvailabilitySetSkuTypesValues() []AvailabilitySetSkuTypes { - return []AvailabilitySetSkuTypes{Aligned, Classic} -} - -// CachingTypes enumerates the values for caching types. -type CachingTypes string - -const ( - // CachingTypesNone ... - CachingTypesNone CachingTypes = "None" - // CachingTypesReadOnly ... - CachingTypesReadOnly CachingTypes = "ReadOnly" - // CachingTypesReadWrite ... - CachingTypesReadWrite CachingTypes = "ReadWrite" -) - -// PossibleCachingTypesValues returns an array of possible values for the CachingTypes const type. -func PossibleCachingTypesValues() []CachingTypes { - return []CachingTypes{CachingTypesNone, CachingTypesReadOnly, CachingTypesReadWrite} -} - -// ComponentNames enumerates the values for component names. -type ComponentNames string - -const ( - // MicrosoftWindowsShellSetup ... - MicrosoftWindowsShellSetup ComponentNames = "Microsoft-Windows-Shell-Setup" -) - -// PossibleComponentNamesValues returns an array of possible values for the ComponentNames const type. -func PossibleComponentNamesValues() []ComponentNames { - return []ComponentNames{MicrosoftWindowsShellSetup} -} - -// ContainerServiceOrchestratorTypes enumerates the values for container service orchestrator types. -type ContainerServiceOrchestratorTypes string - -const ( - // Custom ... - Custom ContainerServiceOrchestratorTypes = "Custom" - // DCOS ... - DCOS ContainerServiceOrchestratorTypes = "DCOS" - // Kubernetes ... - Kubernetes ContainerServiceOrchestratorTypes = "Kubernetes" - // Swarm ... - Swarm ContainerServiceOrchestratorTypes = "Swarm" -) - -// PossibleContainerServiceOrchestratorTypesValues returns an array of possible values for the ContainerServiceOrchestratorTypes const type. -func PossibleContainerServiceOrchestratorTypesValues() []ContainerServiceOrchestratorTypes { - return []ContainerServiceOrchestratorTypes{Custom, DCOS, Kubernetes, Swarm} -} - -// ContainerServiceVMSizeTypes enumerates the values for container service vm size types. -type ContainerServiceVMSizeTypes string - -const ( - // StandardA0 ... - StandardA0 ContainerServiceVMSizeTypes = "Standard_A0" - // StandardA1 ... - StandardA1 ContainerServiceVMSizeTypes = "Standard_A1" - // StandardA10 ... - StandardA10 ContainerServiceVMSizeTypes = "Standard_A10" - // StandardA11 ... - StandardA11 ContainerServiceVMSizeTypes = "Standard_A11" - // StandardA2 ... - StandardA2 ContainerServiceVMSizeTypes = "Standard_A2" - // StandardA3 ... - StandardA3 ContainerServiceVMSizeTypes = "Standard_A3" - // StandardA4 ... - StandardA4 ContainerServiceVMSizeTypes = "Standard_A4" - // StandardA5 ... - StandardA5 ContainerServiceVMSizeTypes = "Standard_A5" - // StandardA6 ... - StandardA6 ContainerServiceVMSizeTypes = "Standard_A6" - // StandardA7 ... - StandardA7 ContainerServiceVMSizeTypes = "Standard_A7" - // StandardA8 ... - StandardA8 ContainerServiceVMSizeTypes = "Standard_A8" - // StandardA9 ... - StandardA9 ContainerServiceVMSizeTypes = "Standard_A9" - // StandardD1 ... - StandardD1 ContainerServiceVMSizeTypes = "Standard_D1" - // StandardD11 ... - StandardD11 ContainerServiceVMSizeTypes = "Standard_D11" - // StandardD11V2 ... - StandardD11V2 ContainerServiceVMSizeTypes = "Standard_D11_v2" - // StandardD12 ... - StandardD12 ContainerServiceVMSizeTypes = "Standard_D12" - // StandardD12V2 ... - StandardD12V2 ContainerServiceVMSizeTypes = "Standard_D12_v2" - // StandardD13 ... - StandardD13 ContainerServiceVMSizeTypes = "Standard_D13" - // StandardD13V2 ... - StandardD13V2 ContainerServiceVMSizeTypes = "Standard_D13_v2" - // StandardD14 ... - StandardD14 ContainerServiceVMSizeTypes = "Standard_D14" - // StandardD14V2 ... - StandardD14V2 ContainerServiceVMSizeTypes = "Standard_D14_v2" - // StandardD1V2 ... - StandardD1V2 ContainerServiceVMSizeTypes = "Standard_D1_v2" - // StandardD2 ... - StandardD2 ContainerServiceVMSizeTypes = "Standard_D2" - // StandardD2V2 ... - StandardD2V2 ContainerServiceVMSizeTypes = "Standard_D2_v2" - // StandardD3 ... - StandardD3 ContainerServiceVMSizeTypes = "Standard_D3" - // StandardD3V2 ... - StandardD3V2 ContainerServiceVMSizeTypes = "Standard_D3_v2" - // StandardD4 ... - StandardD4 ContainerServiceVMSizeTypes = "Standard_D4" - // StandardD4V2 ... - StandardD4V2 ContainerServiceVMSizeTypes = "Standard_D4_v2" - // StandardD5V2 ... - StandardD5V2 ContainerServiceVMSizeTypes = "Standard_D5_v2" - // StandardDS1 ... - StandardDS1 ContainerServiceVMSizeTypes = "Standard_DS1" - // StandardDS11 ... - StandardDS11 ContainerServiceVMSizeTypes = "Standard_DS11" - // StandardDS12 ... - StandardDS12 ContainerServiceVMSizeTypes = "Standard_DS12" - // StandardDS13 ... - StandardDS13 ContainerServiceVMSizeTypes = "Standard_DS13" - // StandardDS14 ... - StandardDS14 ContainerServiceVMSizeTypes = "Standard_DS14" - // StandardDS2 ... - StandardDS2 ContainerServiceVMSizeTypes = "Standard_DS2" - // StandardDS3 ... - StandardDS3 ContainerServiceVMSizeTypes = "Standard_DS3" - // StandardDS4 ... - StandardDS4 ContainerServiceVMSizeTypes = "Standard_DS4" - // StandardG1 ... - StandardG1 ContainerServiceVMSizeTypes = "Standard_G1" - // StandardG2 ... - StandardG2 ContainerServiceVMSizeTypes = "Standard_G2" - // StandardG3 ... - StandardG3 ContainerServiceVMSizeTypes = "Standard_G3" - // StandardG4 ... - StandardG4 ContainerServiceVMSizeTypes = "Standard_G4" - // StandardG5 ... - StandardG5 ContainerServiceVMSizeTypes = "Standard_G5" - // StandardGS1 ... - StandardGS1 ContainerServiceVMSizeTypes = "Standard_GS1" - // StandardGS2 ... - StandardGS2 ContainerServiceVMSizeTypes = "Standard_GS2" - // StandardGS3 ... - StandardGS3 ContainerServiceVMSizeTypes = "Standard_GS3" - // StandardGS4 ... - StandardGS4 ContainerServiceVMSizeTypes = "Standard_GS4" - // StandardGS5 ... - StandardGS5 ContainerServiceVMSizeTypes = "Standard_GS5" -) - -// PossibleContainerServiceVMSizeTypesValues returns an array of possible values for the ContainerServiceVMSizeTypes const type. -func PossibleContainerServiceVMSizeTypesValues() []ContainerServiceVMSizeTypes { - return []ContainerServiceVMSizeTypes{StandardA0, StandardA1, StandardA10, StandardA11, StandardA2, StandardA3, StandardA4, StandardA5, StandardA6, StandardA7, StandardA8, StandardA9, StandardD1, StandardD11, StandardD11V2, StandardD12, StandardD12V2, StandardD13, StandardD13V2, StandardD14, StandardD14V2, StandardD1V2, StandardD2, StandardD2V2, StandardD3, StandardD3V2, StandardD4, StandardD4V2, StandardD5V2, StandardDS1, StandardDS11, StandardDS12, StandardDS13, StandardDS14, StandardDS2, StandardDS3, StandardDS4, StandardG1, StandardG2, StandardG3, StandardG4, StandardG5, StandardGS1, StandardGS2, StandardGS3, StandardGS4, StandardGS5} -} - -// DedicatedHostLicenseTypes enumerates the values for dedicated host license types. -type DedicatedHostLicenseTypes string - -const ( - // DedicatedHostLicenseTypesNone ... - DedicatedHostLicenseTypesNone DedicatedHostLicenseTypes = "None" - // DedicatedHostLicenseTypesWindowsServerHybrid ... - DedicatedHostLicenseTypesWindowsServerHybrid DedicatedHostLicenseTypes = "Windows_Server_Hybrid" - // DedicatedHostLicenseTypesWindowsServerPerpetual ... - DedicatedHostLicenseTypesWindowsServerPerpetual DedicatedHostLicenseTypes = "Windows_Server_Perpetual" -) - -// PossibleDedicatedHostLicenseTypesValues returns an array of possible values for the DedicatedHostLicenseTypes const type. -func PossibleDedicatedHostLicenseTypesValues() []DedicatedHostLicenseTypes { - return []DedicatedHostLicenseTypes{DedicatedHostLicenseTypesNone, DedicatedHostLicenseTypesWindowsServerHybrid, DedicatedHostLicenseTypesWindowsServerPerpetual} -} - -// DiffDiskOptions enumerates the values for diff disk options. -type DiffDiskOptions string - -const ( - // Local ... - Local DiffDiskOptions = "Local" -) - -// PossibleDiffDiskOptionsValues returns an array of possible values for the DiffDiskOptions const type. -func PossibleDiffDiskOptionsValues() []DiffDiskOptions { - return []DiffDiskOptions{Local} -} - -// DiskCreateOption enumerates the values for disk create option. -type DiskCreateOption string - -const ( - // Attach Disk will be attached to a VM. - Attach DiskCreateOption = "Attach" - // Copy Create a new disk or snapshot by copying from a disk or snapshot specified by the given - // sourceResourceId. - Copy DiskCreateOption = "Copy" - // Empty Create an empty data disk of a size given by diskSizeGB. - Empty DiskCreateOption = "Empty" - // FromImage Create a new disk from a platform image specified by the given imageReference. - FromImage DiskCreateOption = "FromImage" - // Import Create a disk by importing from a blob specified by a sourceUri in a storage account specified by - // storageAccountId. - Import DiskCreateOption = "Import" - // Restore Create a new disk by copying from a backup recovery point. - Restore DiskCreateOption = "Restore" - // Upload Create a new disk by obtaining a write token and using it to directly upload the contents of the - // disk. - Upload DiskCreateOption = "Upload" -) - -// PossibleDiskCreateOptionValues returns an array of possible values for the DiskCreateOption const type. -func PossibleDiskCreateOptionValues() []DiskCreateOption { - return []DiskCreateOption{Attach, Copy, Empty, FromImage, Import, Restore, Upload} -} - -// DiskCreateOptionTypes enumerates the values for disk create option types. -type DiskCreateOptionTypes string - -const ( - // DiskCreateOptionTypesAttach ... - DiskCreateOptionTypesAttach DiskCreateOptionTypes = "Attach" - // DiskCreateOptionTypesEmpty ... - DiskCreateOptionTypesEmpty DiskCreateOptionTypes = "Empty" - // DiskCreateOptionTypesFromImage ... - DiskCreateOptionTypesFromImage DiskCreateOptionTypes = "FromImage" -) - -// PossibleDiskCreateOptionTypesValues returns an array of possible values for the DiskCreateOptionTypes const type. -func PossibleDiskCreateOptionTypesValues() []DiskCreateOptionTypes { - return []DiskCreateOptionTypes{DiskCreateOptionTypesAttach, DiskCreateOptionTypesEmpty, DiskCreateOptionTypesFromImage} -} - -// DiskEncryptionSetIdentityType enumerates the values for disk encryption set identity type. -type DiskEncryptionSetIdentityType string - -const ( - // SystemAssigned ... - SystemAssigned DiskEncryptionSetIdentityType = "SystemAssigned" -) - -// PossibleDiskEncryptionSetIdentityTypeValues returns an array of possible values for the DiskEncryptionSetIdentityType const type. -func PossibleDiskEncryptionSetIdentityTypeValues() []DiskEncryptionSetIdentityType { - return []DiskEncryptionSetIdentityType{SystemAssigned} -} - -// DiskState enumerates the values for disk state. -type DiskState string - -const ( - // ActiveSAS The disk currently has an Active SAS Uri associated with it. - ActiveSAS DiskState = "ActiveSAS" - // ActiveUpload A disk is created for upload and a write token has been issued for uploading to it. - ActiveUpload DiskState = "ActiveUpload" - // Attached The disk is currently mounted to a running VM. - Attached DiskState = "Attached" - // ReadyToUpload A disk is ready to be created by upload by requesting a write token. - ReadyToUpload DiskState = "ReadyToUpload" - // Reserved The disk is mounted to a stopped-deallocated VM - Reserved DiskState = "Reserved" - // Unattached The disk is not being used and can be attached to a VM. - Unattached DiskState = "Unattached" -) - -// PossibleDiskStateValues returns an array of possible values for the DiskState const type. -func PossibleDiskStateValues() []DiskState { - return []DiskState{ActiveSAS, ActiveUpload, Attached, ReadyToUpload, Reserved, Unattached} -} - -// DiskStorageAccountTypes enumerates the values for disk storage account types. -type DiskStorageAccountTypes string - -const ( - // PremiumLRS Premium SSD locally redundant storage. Best for production and performance sensitive - // workloads. - PremiumLRS DiskStorageAccountTypes = "Premium_LRS" - // StandardLRS Standard HDD locally redundant storage. Best for backup, non-critical, and infrequent - // access. - StandardLRS DiskStorageAccountTypes = "Standard_LRS" - // StandardSSDLRS Standard SSD locally redundant storage. Best for web servers, lightly used enterprise - // applications and dev/test. - StandardSSDLRS DiskStorageAccountTypes = "StandardSSD_LRS" - // UltraSSDLRS Ultra SSD locally redundant storage. Best for IO-intensive workloads such as SAP HANA, top - // tier databases (for example, SQL, Oracle), and other transaction-heavy workloads. - UltraSSDLRS DiskStorageAccountTypes = "UltraSSD_LRS" -) - -// PossibleDiskStorageAccountTypesValues returns an array of possible values for the DiskStorageAccountTypes const type. -func PossibleDiskStorageAccountTypesValues() []DiskStorageAccountTypes { - return []DiskStorageAccountTypes{PremiumLRS, StandardLRS, StandardSSDLRS, UltraSSDLRS} -} - -// EncryptionType enumerates the values for encryption type. -type EncryptionType string - -const ( - // EncryptionAtRestWithCustomerKey Disk is encrypted with Customer managed key at rest. - EncryptionAtRestWithCustomerKey EncryptionType = "EncryptionAtRestWithCustomerKey" - // EncryptionAtRestWithPlatformKey Disk is encrypted with XStore managed key at rest. It is the default - // encryption type. - EncryptionAtRestWithPlatformKey EncryptionType = "EncryptionAtRestWithPlatformKey" -) - -// PossibleEncryptionTypeValues returns an array of possible values for the EncryptionType const type. -func PossibleEncryptionTypeValues() []EncryptionType { - return []EncryptionType{EncryptionAtRestWithCustomerKey, EncryptionAtRestWithPlatformKey} -} - -// HostCaching enumerates the values for host caching. -type HostCaching string - -const ( - // HostCachingNone ... - HostCachingNone HostCaching = "None" - // HostCachingReadOnly ... - HostCachingReadOnly HostCaching = "ReadOnly" - // HostCachingReadWrite ... - HostCachingReadWrite HostCaching = "ReadWrite" -) - -// PossibleHostCachingValues returns an array of possible values for the HostCaching const type. -func PossibleHostCachingValues() []HostCaching { - return []HostCaching{HostCachingNone, HostCachingReadOnly, HostCachingReadWrite} -} - -// HyperVGeneration enumerates the values for hyper v generation. -type HyperVGeneration string - -const ( - // V1 ... - V1 HyperVGeneration = "V1" - // V2 ... - V2 HyperVGeneration = "V2" -) - -// PossibleHyperVGenerationValues returns an array of possible values for the HyperVGeneration const type. -func PossibleHyperVGenerationValues() []HyperVGeneration { - return []HyperVGeneration{V1, V2} -} - -// HyperVGenerationType enumerates the values for hyper v generation type. -type HyperVGenerationType string - -const ( - // HyperVGenerationTypeV1 ... - HyperVGenerationTypeV1 HyperVGenerationType = "V1" - // HyperVGenerationTypeV2 ... - HyperVGenerationTypeV2 HyperVGenerationType = "V2" -) - -// PossibleHyperVGenerationTypeValues returns an array of possible values for the HyperVGenerationType const type. -func PossibleHyperVGenerationTypeValues() []HyperVGenerationType { - return []HyperVGenerationType{HyperVGenerationTypeV1, HyperVGenerationTypeV2} -} - -// HyperVGenerationTypes enumerates the values for hyper v generation types. -type HyperVGenerationTypes string - -const ( - // HyperVGenerationTypesV1 ... - HyperVGenerationTypesV1 HyperVGenerationTypes = "V1" - // HyperVGenerationTypesV2 ... - HyperVGenerationTypesV2 HyperVGenerationTypes = "V2" -) - -// PossibleHyperVGenerationTypesValues returns an array of possible values for the HyperVGenerationTypes const type. -func PossibleHyperVGenerationTypesValues() []HyperVGenerationTypes { - return []HyperVGenerationTypes{HyperVGenerationTypesV1, HyperVGenerationTypesV2} -} - -// InstanceViewTypes enumerates the values for instance view types. -type InstanceViewTypes string - -const ( - // InstanceView ... - InstanceView InstanceViewTypes = "instanceView" -) - -// PossibleInstanceViewTypesValues returns an array of possible values for the InstanceViewTypes const type. -func PossibleInstanceViewTypesValues() []InstanceViewTypes { - return []InstanceViewTypes{InstanceView} -} - -// IntervalInMins enumerates the values for interval in mins. -type IntervalInMins string - -const ( - // FiveMins ... - FiveMins IntervalInMins = "FiveMins" - // SixtyMins ... - SixtyMins IntervalInMins = "SixtyMins" - // ThirtyMins ... - ThirtyMins IntervalInMins = "ThirtyMins" - // ThreeMins ... - ThreeMins IntervalInMins = "ThreeMins" -) - -// PossibleIntervalInMinsValues returns an array of possible values for the IntervalInMins const type. -func PossibleIntervalInMinsValues() []IntervalInMins { - return []IntervalInMins{FiveMins, SixtyMins, ThirtyMins, ThreeMins} -} - -// IPVersion enumerates the values for ip version. -type IPVersion string - -const ( - // IPv4 ... - IPv4 IPVersion = "IPv4" - // IPv6 ... - IPv6 IPVersion = "IPv6" -) - -// PossibleIPVersionValues returns an array of possible values for the IPVersion const type. -func PossibleIPVersionValues() []IPVersion { - return []IPVersion{IPv4, IPv6} -} - -// MaintenanceOperationResultCodeTypes enumerates the values for maintenance operation result code types. -type MaintenanceOperationResultCodeTypes string - -const ( - // MaintenanceOperationResultCodeTypesMaintenanceAborted ... - MaintenanceOperationResultCodeTypesMaintenanceAborted MaintenanceOperationResultCodeTypes = "MaintenanceAborted" - // MaintenanceOperationResultCodeTypesMaintenanceCompleted ... - MaintenanceOperationResultCodeTypesMaintenanceCompleted MaintenanceOperationResultCodeTypes = "MaintenanceCompleted" - // MaintenanceOperationResultCodeTypesNone ... - MaintenanceOperationResultCodeTypesNone MaintenanceOperationResultCodeTypes = "None" - // MaintenanceOperationResultCodeTypesRetryLater ... - MaintenanceOperationResultCodeTypesRetryLater MaintenanceOperationResultCodeTypes = "RetryLater" -) - -// PossibleMaintenanceOperationResultCodeTypesValues returns an array of possible values for the MaintenanceOperationResultCodeTypes const type. -func PossibleMaintenanceOperationResultCodeTypesValues() []MaintenanceOperationResultCodeTypes { - return []MaintenanceOperationResultCodeTypes{MaintenanceOperationResultCodeTypesMaintenanceAborted, MaintenanceOperationResultCodeTypesMaintenanceCompleted, MaintenanceOperationResultCodeTypesNone, MaintenanceOperationResultCodeTypesRetryLater} -} - -// OperatingSystemStateTypes enumerates the values for operating system state types. -type OperatingSystemStateTypes string - -const ( - // Generalized Generalized image. Needs to be provisioned during deployment time. - Generalized OperatingSystemStateTypes = "Generalized" - // Specialized Specialized image. Contains already provisioned OS Disk. - Specialized OperatingSystemStateTypes = "Specialized" -) - -// PossibleOperatingSystemStateTypesValues returns an array of possible values for the OperatingSystemStateTypes const type. -func PossibleOperatingSystemStateTypesValues() []OperatingSystemStateTypes { - return []OperatingSystemStateTypes{Generalized, Specialized} -} - -// OperatingSystemTypes enumerates the values for operating system types. -type OperatingSystemTypes string - -const ( - // Linux ... - Linux OperatingSystemTypes = "Linux" - // Windows ... - Windows OperatingSystemTypes = "Windows" -) - -// PossibleOperatingSystemTypesValues returns an array of possible values for the OperatingSystemTypes const type. -func PossibleOperatingSystemTypesValues() []OperatingSystemTypes { - return []OperatingSystemTypes{Linux, Windows} -} - -// PassNames enumerates the values for pass names. -type PassNames string - -const ( - // OobeSystem ... - OobeSystem PassNames = "OobeSystem" -) - -// PossiblePassNamesValues returns an array of possible values for the PassNames const type. -func PossiblePassNamesValues() []PassNames { - return []PassNames{OobeSystem} -} - -// ProtocolTypes enumerates the values for protocol types. -type ProtocolTypes string - -const ( - // HTTP ... - HTTP ProtocolTypes = "Http" - // HTTPS ... - HTTPS ProtocolTypes = "Https" -) - -// PossibleProtocolTypesValues returns an array of possible values for the ProtocolTypes const type. -func PossibleProtocolTypesValues() []ProtocolTypes { - return []ProtocolTypes{HTTP, HTTPS} -} - -// ProvisioningState enumerates the values for provisioning state. -type ProvisioningState string - -const ( - // ProvisioningStateCreating ... - ProvisioningStateCreating ProvisioningState = "Creating" - // ProvisioningStateDeleting ... - ProvisioningStateDeleting ProvisioningState = "Deleting" - // ProvisioningStateFailed ... - ProvisioningStateFailed ProvisioningState = "Failed" - // ProvisioningStateMigrating ... - ProvisioningStateMigrating ProvisioningState = "Migrating" - // ProvisioningStateSucceeded ... - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - // ProvisioningStateUpdating ... - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. -func PossibleProvisioningStateValues() []ProvisioningState { - return []ProvisioningState{ProvisioningStateCreating, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateMigrating, ProvisioningStateSucceeded, ProvisioningStateUpdating} -} - -// ProvisioningState1 enumerates the values for provisioning state 1. -type ProvisioningState1 string - -const ( - // ProvisioningState1Creating ... - ProvisioningState1Creating ProvisioningState1 = "Creating" - // ProvisioningState1Deleting ... - ProvisioningState1Deleting ProvisioningState1 = "Deleting" - // ProvisioningState1Failed ... - ProvisioningState1Failed ProvisioningState1 = "Failed" - // ProvisioningState1Migrating ... - ProvisioningState1Migrating ProvisioningState1 = "Migrating" - // ProvisioningState1Succeeded ... - ProvisioningState1Succeeded ProvisioningState1 = "Succeeded" - // ProvisioningState1Updating ... - ProvisioningState1Updating ProvisioningState1 = "Updating" -) - -// PossibleProvisioningState1Values returns an array of possible values for the ProvisioningState1 const type. -func PossibleProvisioningState1Values() []ProvisioningState1 { - return []ProvisioningState1{ProvisioningState1Creating, ProvisioningState1Deleting, ProvisioningState1Failed, ProvisioningState1Migrating, ProvisioningState1Succeeded, ProvisioningState1Updating} -} - -// ProvisioningState2 enumerates the values for provisioning state 2. -type ProvisioningState2 string - -const ( - // ProvisioningState2Creating ... - ProvisioningState2Creating ProvisioningState2 = "Creating" - // ProvisioningState2Deleting ... - ProvisioningState2Deleting ProvisioningState2 = "Deleting" - // ProvisioningState2Failed ... - ProvisioningState2Failed ProvisioningState2 = "Failed" - // ProvisioningState2Migrating ... - ProvisioningState2Migrating ProvisioningState2 = "Migrating" - // ProvisioningState2Succeeded ... - ProvisioningState2Succeeded ProvisioningState2 = "Succeeded" - // ProvisioningState2Updating ... - ProvisioningState2Updating ProvisioningState2 = "Updating" -) - -// PossibleProvisioningState2Values returns an array of possible values for the ProvisioningState2 const type. -func PossibleProvisioningState2Values() []ProvisioningState2 { - return []ProvisioningState2{ProvisioningState2Creating, ProvisioningState2Deleting, ProvisioningState2Failed, ProvisioningState2Migrating, ProvisioningState2Succeeded, ProvisioningState2Updating} -} - -// ProvisioningState3 enumerates the values for provisioning state 3. -type ProvisioningState3 string - -const ( - // ProvisioningState3Creating ... - ProvisioningState3Creating ProvisioningState3 = "Creating" - // ProvisioningState3Deleting ... - ProvisioningState3Deleting ProvisioningState3 = "Deleting" - // ProvisioningState3Failed ... - ProvisioningState3Failed ProvisioningState3 = "Failed" - // ProvisioningState3Migrating ... - ProvisioningState3Migrating ProvisioningState3 = "Migrating" - // ProvisioningState3Succeeded ... - ProvisioningState3Succeeded ProvisioningState3 = "Succeeded" - // ProvisioningState3Updating ... - ProvisioningState3Updating ProvisioningState3 = "Updating" -) - -// PossibleProvisioningState3Values returns an array of possible values for the ProvisioningState3 const type. -func PossibleProvisioningState3Values() []ProvisioningState3 { - return []ProvisioningState3{ProvisioningState3Creating, ProvisioningState3Deleting, ProvisioningState3Failed, ProvisioningState3Migrating, ProvisioningState3Succeeded, ProvisioningState3Updating} -} - -// ProximityPlacementGroupType enumerates the values for proximity placement group type. -type ProximityPlacementGroupType string - -const ( - // Standard ... - Standard ProximityPlacementGroupType = "Standard" - // Ultra ... - Ultra ProximityPlacementGroupType = "Ultra" -) - -// PossibleProximityPlacementGroupTypeValues returns an array of possible values for the ProximityPlacementGroupType const type. -func PossibleProximityPlacementGroupTypeValues() []ProximityPlacementGroupType { - return []ProximityPlacementGroupType{Standard, Ultra} -} - -// ReplicationState enumerates the values for replication state. -type ReplicationState string - -const ( - // ReplicationStateCompleted ... - ReplicationStateCompleted ReplicationState = "Completed" - // ReplicationStateFailed ... - ReplicationStateFailed ReplicationState = "Failed" - // ReplicationStateReplicating ... - ReplicationStateReplicating ReplicationState = "Replicating" - // ReplicationStateUnknown ... - ReplicationStateUnknown ReplicationState = "Unknown" -) - -// PossibleReplicationStateValues returns an array of possible values for the ReplicationState const type. -func PossibleReplicationStateValues() []ReplicationState { - return []ReplicationState{ReplicationStateCompleted, ReplicationStateFailed, ReplicationStateReplicating, ReplicationStateUnknown} -} - -// ReplicationStatusTypes enumerates the values for replication status types. -type ReplicationStatusTypes string - -const ( - // ReplicationStatusTypesReplicationStatus ... - ReplicationStatusTypesReplicationStatus ReplicationStatusTypes = "ReplicationStatus" -) - -// PossibleReplicationStatusTypesValues returns an array of possible values for the ReplicationStatusTypes const type. -func PossibleReplicationStatusTypesValues() []ReplicationStatusTypes { - return []ReplicationStatusTypes{ReplicationStatusTypesReplicationStatus} -} - -// ResourceIdentityType enumerates the values for resource identity type. -type ResourceIdentityType string - -const ( - // ResourceIdentityTypeNone ... - ResourceIdentityTypeNone ResourceIdentityType = "None" - // ResourceIdentityTypeSystemAssigned ... - ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" - // ResourceIdentityTypeSystemAssignedUserAssigned ... - ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" - // ResourceIdentityTypeUserAssigned ... - ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" -) - -// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. -func PossibleResourceIdentityTypeValues() []ResourceIdentityType { - return []ResourceIdentityType{ResourceIdentityTypeNone, ResourceIdentityTypeSystemAssigned, ResourceIdentityTypeSystemAssignedUserAssigned, ResourceIdentityTypeUserAssigned} -} - -// ResourceSkuCapacityScaleType enumerates the values for resource sku capacity scale type. -type ResourceSkuCapacityScaleType string - -const ( - // ResourceSkuCapacityScaleTypeAutomatic ... - ResourceSkuCapacityScaleTypeAutomatic ResourceSkuCapacityScaleType = "Automatic" - // ResourceSkuCapacityScaleTypeManual ... - ResourceSkuCapacityScaleTypeManual ResourceSkuCapacityScaleType = "Manual" - // ResourceSkuCapacityScaleTypeNone ... - ResourceSkuCapacityScaleTypeNone ResourceSkuCapacityScaleType = "None" -) - -// PossibleResourceSkuCapacityScaleTypeValues returns an array of possible values for the ResourceSkuCapacityScaleType const type. -func PossibleResourceSkuCapacityScaleTypeValues() []ResourceSkuCapacityScaleType { - return []ResourceSkuCapacityScaleType{ResourceSkuCapacityScaleTypeAutomatic, ResourceSkuCapacityScaleTypeManual, ResourceSkuCapacityScaleTypeNone} -} - -// ResourceSkuRestrictionsReasonCode enumerates the values for resource sku restrictions reason code. -type ResourceSkuRestrictionsReasonCode string - -const ( - // NotAvailableForSubscription ... - NotAvailableForSubscription ResourceSkuRestrictionsReasonCode = "NotAvailableForSubscription" - // QuotaID ... - QuotaID ResourceSkuRestrictionsReasonCode = "QuotaId" -) - -// PossibleResourceSkuRestrictionsReasonCodeValues returns an array of possible values for the ResourceSkuRestrictionsReasonCode const type. -func PossibleResourceSkuRestrictionsReasonCodeValues() []ResourceSkuRestrictionsReasonCode { - return []ResourceSkuRestrictionsReasonCode{NotAvailableForSubscription, QuotaID} -} - -// ResourceSkuRestrictionsType enumerates the values for resource sku restrictions type. -type ResourceSkuRestrictionsType string - -const ( - // Location ... - Location ResourceSkuRestrictionsType = "Location" - // Zone ... - Zone ResourceSkuRestrictionsType = "Zone" -) - -// PossibleResourceSkuRestrictionsTypeValues returns an array of possible values for the ResourceSkuRestrictionsType const type. -func PossibleResourceSkuRestrictionsTypeValues() []ResourceSkuRestrictionsType { - return []ResourceSkuRestrictionsType{Location, Zone} -} - -// RollingUpgradeActionType enumerates the values for rolling upgrade action type. -type RollingUpgradeActionType string - -const ( - // Cancel ... - Cancel RollingUpgradeActionType = "Cancel" - // Start ... - Start RollingUpgradeActionType = "Start" -) - -// PossibleRollingUpgradeActionTypeValues returns an array of possible values for the RollingUpgradeActionType const type. -func PossibleRollingUpgradeActionTypeValues() []RollingUpgradeActionType { - return []RollingUpgradeActionType{Cancel, Start} -} - -// RollingUpgradeStatusCode enumerates the values for rolling upgrade status code. -type RollingUpgradeStatusCode string - -const ( - // RollingUpgradeStatusCodeCancelled ... - RollingUpgradeStatusCodeCancelled RollingUpgradeStatusCode = "Cancelled" - // RollingUpgradeStatusCodeCompleted ... - RollingUpgradeStatusCodeCompleted RollingUpgradeStatusCode = "Completed" - // RollingUpgradeStatusCodeFaulted ... - RollingUpgradeStatusCodeFaulted RollingUpgradeStatusCode = "Faulted" - // RollingUpgradeStatusCodeRollingForward ... - RollingUpgradeStatusCodeRollingForward RollingUpgradeStatusCode = "RollingForward" -) - -// PossibleRollingUpgradeStatusCodeValues returns an array of possible values for the RollingUpgradeStatusCode const type. -func PossibleRollingUpgradeStatusCodeValues() []RollingUpgradeStatusCode { - return []RollingUpgradeStatusCode{RollingUpgradeStatusCodeCancelled, RollingUpgradeStatusCodeCompleted, RollingUpgradeStatusCodeFaulted, RollingUpgradeStatusCodeRollingForward} -} - -// SettingNames enumerates the values for setting names. -type SettingNames string - -const ( - // AutoLogon ... - AutoLogon SettingNames = "AutoLogon" - // FirstLogonCommands ... - FirstLogonCommands SettingNames = "FirstLogonCommands" -) - -// PossibleSettingNamesValues returns an array of possible values for the SettingNames const type. -func PossibleSettingNamesValues() []SettingNames { - return []SettingNames{AutoLogon, FirstLogonCommands} -} - -// SnapshotStorageAccountTypes enumerates the values for snapshot storage account types. -type SnapshotStorageAccountTypes string - -const ( - // SnapshotStorageAccountTypesPremiumLRS Premium SSD locally redundant storage - SnapshotStorageAccountTypesPremiumLRS SnapshotStorageAccountTypes = "Premium_LRS" - // SnapshotStorageAccountTypesStandardLRS Standard HDD locally redundant storage - SnapshotStorageAccountTypesStandardLRS SnapshotStorageAccountTypes = "Standard_LRS" - // SnapshotStorageAccountTypesStandardZRS Standard zone redundant storage - SnapshotStorageAccountTypesStandardZRS SnapshotStorageAccountTypes = "Standard_ZRS" -) - -// PossibleSnapshotStorageAccountTypesValues returns an array of possible values for the SnapshotStorageAccountTypes const type. -func PossibleSnapshotStorageAccountTypesValues() []SnapshotStorageAccountTypes { - return []SnapshotStorageAccountTypes{SnapshotStorageAccountTypesPremiumLRS, SnapshotStorageAccountTypesStandardLRS, SnapshotStorageAccountTypesStandardZRS} -} - -// StatusLevelTypes enumerates the values for status level types. -type StatusLevelTypes string - -const ( - // Error ... - Error StatusLevelTypes = "Error" - // Info ... - Info StatusLevelTypes = "Info" - // Warning ... - Warning StatusLevelTypes = "Warning" -) - -// PossibleStatusLevelTypesValues returns an array of possible values for the StatusLevelTypes const type. -func PossibleStatusLevelTypesValues() []StatusLevelTypes { - return []StatusLevelTypes{Error, Info, Warning} -} - -// StorageAccountType enumerates the values for storage account type. -type StorageAccountType string - -const ( - // StorageAccountTypeStandardLRS ... - StorageAccountTypeStandardLRS StorageAccountType = "Standard_LRS" - // StorageAccountTypeStandardZRS ... - StorageAccountTypeStandardZRS StorageAccountType = "Standard_ZRS" -) - -// PossibleStorageAccountTypeValues returns an array of possible values for the StorageAccountType const type. -func PossibleStorageAccountTypeValues() []StorageAccountType { - return []StorageAccountType{StorageAccountTypeStandardLRS, StorageAccountTypeStandardZRS} -} - -// StorageAccountTypes enumerates the values for storage account types. -type StorageAccountTypes string - -const ( - // StorageAccountTypesPremiumLRS ... - StorageAccountTypesPremiumLRS StorageAccountTypes = "Premium_LRS" - // StorageAccountTypesStandardLRS ... - StorageAccountTypesStandardLRS StorageAccountTypes = "Standard_LRS" - // StorageAccountTypesStandardSSDLRS ... - StorageAccountTypesStandardSSDLRS StorageAccountTypes = "StandardSSD_LRS" - // StorageAccountTypesUltraSSDLRS ... - StorageAccountTypesUltraSSDLRS StorageAccountTypes = "UltraSSD_LRS" -) - -// PossibleStorageAccountTypesValues returns an array of possible values for the StorageAccountTypes const type. -func PossibleStorageAccountTypesValues() []StorageAccountTypes { - return []StorageAccountTypes{StorageAccountTypesPremiumLRS, StorageAccountTypesStandardLRS, StorageAccountTypesStandardSSDLRS, StorageAccountTypesUltraSSDLRS} -} - -// UpgradeMode enumerates the values for upgrade mode. -type UpgradeMode string - -const ( - // Automatic ... - Automatic UpgradeMode = "Automatic" - // Manual ... - Manual UpgradeMode = "Manual" - // Rolling ... - Rolling UpgradeMode = "Rolling" -) - -// PossibleUpgradeModeValues returns an array of possible values for the UpgradeMode const type. -func PossibleUpgradeModeValues() []UpgradeMode { - return []UpgradeMode{Automatic, Manual, Rolling} -} - -// UpgradeOperationInvoker enumerates the values for upgrade operation invoker. -type UpgradeOperationInvoker string - -const ( - // UpgradeOperationInvokerPlatform ... - UpgradeOperationInvokerPlatform UpgradeOperationInvoker = "Platform" - // UpgradeOperationInvokerUnknown ... - UpgradeOperationInvokerUnknown UpgradeOperationInvoker = "Unknown" - // UpgradeOperationInvokerUser ... - UpgradeOperationInvokerUser UpgradeOperationInvoker = "User" -) - -// PossibleUpgradeOperationInvokerValues returns an array of possible values for the UpgradeOperationInvoker const type. -func PossibleUpgradeOperationInvokerValues() []UpgradeOperationInvoker { - return []UpgradeOperationInvoker{UpgradeOperationInvokerPlatform, UpgradeOperationInvokerUnknown, UpgradeOperationInvokerUser} -} - -// UpgradeState enumerates the values for upgrade state. -type UpgradeState string - -const ( - // UpgradeStateCancelled ... - UpgradeStateCancelled UpgradeState = "Cancelled" - // UpgradeStateCompleted ... - UpgradeStateCompleted UpgradeState = "Completed" - // UpgradeStateFaulted ... - UpgradeStateFaulted UpgradeState = "Faulted" - // UpgradeStateRollingForward ... - UpgradeStateRollingForward UpgradeState = "RollingForward" -) - -// PossibleUpgradeStateValues returns an array of possible values for the UpgradeState const type. -func PossibleUpgradeStateValues() []UpgradeState { - return []UpgradeState{UpgradeStateCancelled, UpgradeStateCompleted, UpgradeStateFaulted, UpgradeStateRollingForward} -} - -// VirtualMachineEvictionPolicyTypes enumerates the values for virtual machine eviction policy types. -type VirtualMachineEvictionPolicyTypes string - -const ( - // Deallocate ... - Deallocate VirtualMachineEvictionPolicyTypes = "Deallocate" - // Delete ... - Delete VirtualMachineEvictionPolicyTypes = "Delete" -) - -// PossibleVirtualMachineEvictionPolicyTypesValues returns an array of possible values for the VirtualMachineEvictionPolicyTypes const type. -func PossibleVirtualMachineEvictionPolicyTypesValues() []VirtualMachineEvictionPolicyTypes { - return []VirtualMachineEvictionPolicyTypes{Deallocate, Delete} -} - -// VirtualMachinePriorityTypes enumerates the values for virtual machine priority types. -type VirtualMachinePriorityTypes string - -const ( - // Low ... - Low VirtualMachinePriorityTypes = "Low" - // Regular ... - Regular VirtualMachinePriorityTypes = "Regular" - // Spot ... - Spot VirtualMachinePriorityTypes = "Spot" -) - -// PossibleVirtualMachinePriorityTypesValues returns an array of possible values for the VirtualMachinePriorityTypes const type. -func PossibleVirtualMachinePriorityTypesValues() []VirtualMachinePriorityTypes { - return []VirtualMachinePriorityTypes{Low, Regular, Spot} -} - -// VirtualMachineScaleSetScaleInRules enumerates the values for virtual machine scale set scale in rules. -type VirtualMachineScaleSetScaleInRules string - -const ( - // Default ... - Default VirtualMachineScaleSetScaleInRules = "Default" - // NewestVM ... - NewestVM VirtualMachineScaleSetScaleInRules = "NewestVM" - // OldestVM ... - OldestVM VirtualMachineScaleSetScaleInRules = "OldestVM" -) - -// PossibleVirtualMachineScaleSetScaleInRulesValues returns an array of possible values for the VirtualMachineScaleSetScaleInRules const type. -func PossibleVirtualMachineScaleSetScaleInRulesValues() []VirtualMachineScaleSetScaleInRules { - return []VirtualMachineScaleSetScaleInRules{Default, NewestVM, OldestVM} -} - -// VirtualMachineScaleSetSkuScaleType enumerates the values for virtual machine scale set sku scale type. -type VirtualMachineScaleSetSkuScaleType string - -const ( - // VirtualMachineScaleSetSkuScaleTypeAutomatic ... - VirtualMachineScaleSetSkuScaleTypeAutomatic VirtualMachineScaleSetSkuScaleType = "Automatic" - // VirtualMachineScaleSetSkuScaleTypeNone ... - VirtualMachineScaleSetSkuScaleTypeNone VirtualMachineScaleSetSkuScaleType = "None" -) - -// PossibleVirtualMachineScaleSetSkuScaleTypeValues returns an array of possible values for the VirtualMachineScaleSetSkuScaleType const type. -func PossibleVirtualMachineScaleSetSkuScaleTypeValues() []VirtualMachineScaleSetSkuScaleType { - return []VirtualMachineScaleSetSkuScaleType{VirtualMachineScaleSetSkuScaleTypeAutomatic, VirtualMachineScaleSetSkuScaleTypeNone} -} - -// VirtualMachineSizeTypes enumerates the values for virtual machine size types. -type VirtualMachineSizeTypes string - -const ( - // VirtualMachineSizeTypesBasicA0 ... - VirtualMachineSizeTypesBasicA0 VirtualMachineSizeTypes = "Basic_A0" - // VirtualMachineSizeTypesBasicA1 ... - VirtualMachineSizeTypesBasicA1 VirtualMachineSizeTypes = "Basic_A1" - // VirtualMachineSizeTypesBasicA2 ... - VirtualMachineSizeTypesBasicA2 VirtualMachineSizeTypes = "Basic_A2" - // VirtualMachineSizeTypesBasicA3 ... - VirtualMachineSizeTypesBasicA3 VirtualMachineSizeTypes = "Basic_A3" - // VirtualMachineSizeTypesBasicA4 ... - VirtualMachineSizeTypesBasicA4 VirtualMachineSizeTypes = "Basic_A4" - // VirtualMachineSizeTypesStandardA0 ... - VirtualMachineSizeTypesStandardA0 VirtualMachineSizeTypes = "Standard_A0" - // VirtualMachineSizeTypesStandardA1 ... - VirtualMachineSizeTypesStandardA1 VirtualMachineSizeTypes = "Standard_A1" - // VirtualMachineSizeTypesStandardA10 ... - VirtualMachineSizeTypesStandardA10 VirtualMachineSizeTypes = "Standard_A10" - // VirtualMachineSizeTypesStandardA11 ... - VirtualMachineSizeTypesStandardA11 VirtualMachineSizeTypes = "Standard_A11" - // VirtualMachineSizeTypesStandardA1V2 ... - VirtualMachineSizeTypesStandardA1V2 VirtualMachineSizeTypes = "Standard_A1_v2" - // VirtualMachineSizeTypesStandardA2 ... - VirtualMachineSizeTypesStandardA2 VirtualMachineSizeTypes = "Standard_A2" - // VirtualMachineSizeTypesStandardA2mV2 ... - VirtualMachineSizeTypesStandardA2mV2 VirtualMachineSizeTypes = "Standard_A2m_v2" - // VirtualMachineSizeTypesStandardA2V2 ... - VirtualMachineSizeTypesStandardA2V2 VirtualMachineSizeTypes = "Standard_A2_v2" - // VirtualMachineSizeTypesStandardA3 ... - VirtualMachineSizeTypesStandardA3 VirtualMachineSizeTypes = "Standard_A3" - // VirtualMachineSizeTypesStandardA4 ... - VirtualMachineSizeTypesStandardA4 VirtualMachineSizeTypes = "Standard_A4" - // VirtualMachineSizeTypesStandardA4mV2 ... - VirtualMachineSizeTypesStandardA4mV2 VirtualMachineSizeTypes = "Standard_A4m_v2" - // VirtualMachineSizeTypesStandardA4V2 ... - VirtualMachineSizeTypesStandardA4V2 VirtualMachineSizeTypes = "Standard_A4_v2" - // VirtualMachineSizeTypesStandardA5 ... - VirtualMachineSizeTypesStandardA5 VirtualMachineSizeTypes = "Standard_A5" - // VirtualMachineSizeTypesStandardA6 ... - VirtualMachineSizeTypesStandardA6 VirtualMachineSizeTypes = "Standard_A6" - // VirtualMachineSizeTypesStandardA7 ... - VirtualMachineSizeTypesStandardA7 VirtualMachineSizeTypes = "Standard_A7" - // VirtualMachineSizeTypesStandardA8 ... - VirtualMachineSizeTypesStandardA8 VirtualMachineSizeTypes = "Standard_A8" - // VirtualMachineSizeTypesStandardA8mV2 ... - VirtualMachineSizeTypesStandardA8mV2 VirtualMachineSizeTypes = "Standard_A8m_v2" - // VirtualMachineSizeTypesStandardA8V2 ... - VirtualMachineSizeTypesStandardA8V2 VirtualMachineSizeTypes = "Standard_A8_v2" - // VirtualMachineSizeTypesStandardA9 ... - VirtualMachineSizeTypesStandardA9 VirtualMachineSizeTypes = "Standard_A9" - // VirtualMachineSizeTypesStandardB1ms ... - VirtualMachineSizeTypesStandardB1ms VirtualMachineSizeTypes = "Standard_B1ms" - // VirtualMachineSizeTypesStandardB1s ... - VirtualMachineSizeTypesStandardB1s VirtualMachineSizeTypes = "Standard_B1s" - // VirtualMachineSizeTypesStandardB2ms ... - VirtualMachineSizeTypesStandardB2ms VirtualMachineSizeTypes = "Standard_B2ms" - // VirtualMachineSizeTypesStandardB2s ... - VirtualMachineSizeTypesStandardB2s VirtualMachineSizeTypes = "Standard_B2s" - // VirtualMachineSizeTypesStandardB4ms ... - VirtualMachineSizeTypesStandardB4ms VirtualMachineSizeTypes = "Standard_B4ms" - // VirtualMachineSizeTypesStandardB8ms ... - VirtualMachineSizeTypesStandardB8ms VirtualMachineSizeTypes = "Standard_B8ms" - // VirtualMachineSizeTypesStandardD1 ... - VirtualMachineSizeTypesStandardD1 VirtualMachineSizeTypes = "Standard_D1" - // VirtualMachineSizeTypesStandardD11 ... - VirtualMachineSizeTypesStandardD11 VirtualMachineSizeTypes = "Standard_D11" - // VirtualMachineSizeTypesStandardD11V2 ... - VirtualMachineSizeTypesStandardD11V2 VirtualMachineSizeTypes = "Standard_D11_v2" - // VirtualMachineSizeTypesStandardD12 ... - VirtualMachineSizeTypesStandardD12 VirtualMachineSizeTypes = "Standard_D12" - // VirtualMachineSizeTypesStandardD12V2 ... - VirtualMachineSizeTypesStandardD12V2 VirtualMachineSizeTypes = "Standard_D12_v2" - // VirtualMachineSizeTypesStandardD13 ... - VirtualMachineSizeTypesStandardD13 VirtualMachineSizeTypes = "Standard_D13" - // VirtualMachineSizeTypesStandardD13V2 ... - VirtualMachineSizeTypesStandardD13V2 VirtualMachineSizeTypes = "Standard_D13_v2" - // VirtualMachineSizeTypesStandardD14 ... - VirtualMachineSizeTypesStandardD14 VirtualMachineSizeTypes = "Standard_D14" - // VirtualMachineSizeTypesStandardD14V2 ... - VirtualMachineSizeTypesStandardD14V2 VirtualMachineSizeTypes = "Standard_D14_v2" - // VirtualMachineSizeTypesStandardD15V2 ... - VirtualMachineSizeTypesStandardD15V2 VirtualMachineSizeTypes = "Standard_D15_v2" - // VirtualMachineSizeTypesStandardD16sV3 ... - VirtualMachineSizeTypesStandardD16sV3 VirtualMachineSizeTypes = "Standard_D16s_v3" - // VirtualMachineSizeTypesStandardD16V3 ... - VirtualMachineSizeTypesStandardD16V3 VirtualMachineSizeTypes = "Standard_D16_v3" - // VirtualMachineSizeTypesStandardD1V2 ... - VirtualMachineSizeTypesStandardD1V2 VirtualMachineSizeTypes = "Standard_D1_v2" - // VirtualMachineSizeTypesStandardD2 ... - VirtualMachineSizeTypesStandardD2 VirtualMachineSizeTypes = "Standard_D2" - // VirtualMachineSizeTypesStandardD2sV3 ... - VirtualMachineSizeTypesStandardD2sV3 VirtualMachineSizeTypes = "Standard_D2s_v3" - // VirtualMachineSizeTypesStandardD2V2 ... - VirtualMachineSizeTypesStandardD2V2 VirtualMachineSizeTypes = "Standard_D2_v2" - // VirtualMachineSizeTypesStandardD2V3 ... - VirtualMachineSizeTypesStandardD2V3 VirtualMachineSizeTypes = "Standard_D2_v3" - // VirtualMachineSizeTypesStandardD3 ... - VirtualMachineSizeTypesStandardD3 VirtualMachineSizeTypes = "Standard_D3" - // VirtualMachineSizeTypesStandardD32sV3 ... - VirtualMachineSizeTypesStandardD32sV3 VirtualMachineSizeTypes = "Standard_D32s_v3" - // VirtualMachineSizeTypesStandardD32V3 ... - VirtualMachineSizeTypesStandardD32V3 VirtualMachineSizeTypes = "Standard_D32_v3" - // VirtualMachineSizeTypesStandardD3V2 ... - VirtualMachineSizeTypesStandardD3V2 VirtualMachineSizeTypes = "Standard_D3_v2" - // VirtualMachineSizeTypesStandardD4 ... - VirtualMachineSizeTypesStandardD4 VirtualMachineSizeTypes = "Standard_D4" - // VirtualMachineSizeTypesStandardD4sV3 ... - VirtualMachineSizeTypesStandardD4sV3 VirtualMachineSizeTypes = "Standard_D4s_v3" - // VirtualMachineSizeTypesStandardD4V2 ... - VirtualMachineSizeTypesStandardD4V2 VirtualMachineSizeTypes = "Standard_D4_v2" - // VirtualMachineSizeTypesStandardD4V3 ... - VirtualMachineSizeTypesStandardD4V3 VirtualMachineSizeTypes = "Standard_D4_v3" - // VirtualMachineSizeTypesStandardD5V2 ... - VirtualMachineSizeTypesStandardD5V2 VirtualMachineSizeTypes = "Standard_D5_v2" - // VirtualMachineSizeTypesStandardD64sV3 ... - VirtualMachineSizeTypesStandardD64sV3 VirtualMachineSizeTypes = "Standard_D64s_v3" - // VirtualMachineSizeTypesStandardD64V3 ... - VirtualMachineSizeTypesStandardD64V3 VirtualMachineSizeTypes = "Standard_D64_v3" - // VirtualMachineSizeTypesStandardD8sV3 ... - VirtualMachineSizeTypesStandardD8sV3 VirtualMachineSizeTypes = "Standard_D8s_v3" - // VirtualMachineSizeTypesStandardD8V3 ... - VirtualMachineSizeTypesStandardD8V3 VirtualMachineSizeTypes = "Standard_D8_v3" - // VirtualMachineSizeTypesStandardDS1 ... - VirtualMachineSizeTypesStandardDS1 VirtualMachineSizeTypes = "Standard_DS1" - // VirtualMachineSizeTypesStandardDS11 ... - VirtualMachineSizeTypesStandardDS11 VirtualMachineSizeTypes = "Standard_DS11" - // VirtualMachineSizeTypesStandardDS11V2 ... - VirtualMachineSizeTypesStandardDS11V2 VirtualMachineSizeTypes = "Standard_DS11_v2" - // VirtualMachineSizeTypesStandardDS12 ... - VirtualMachineSizeTypesStandardDS12 VirtualMachineSizeTypes = "Standard_DS12" - // VirtualMachineSizeTypesStandardDS12V2 ... - VirtualMachineSizeTypesStandardDS12V2 VirtualMachineSizeTypes = "Standard_DS12_v2" - // VirtualMachineSizeTypesStandardDS13 ... - VirtualMachineSizeTypesStandardDS13 VirtualMachineSizeTypes = "Standard_DS13" - // VirtualMachineSizeTypesStandardDS132V2 ... - VirtualMachineSizeTypesStandardDS132V2 VirtualMachineSizeTypes = "Standard_DS13-2_v2" - // VirtualMachineSizeTypesStandardDS134V2 ... - VirtualMachineSizeTypesStandardDS134V2 VirtualMachineSizeTypes = "Standard_DS13-4_v2" - // VirtualMachineSizeTypesStandardDS13V2 ... - VirtualMachineSizeTypesStandardDS13V2 VirtualMachineSizeTypes = "Standard_DS13_v2" - // VirtualMachineSizeTypesStandardDS14 ... - VirtualMachineSizeTypesStandardDS14 VirtualMachineSizeTypes = "Standard_DS14" - // VirtualMachineSizeTypesStandardDS144V2 ... - VirtualMachineSizeTypesStandardDS144V2 VirtualMachineSizeTypes = "Standard_DS14-4_v2" - // VirtualMachineSizeTypesStandardDS148V2 ... - VirtualMachineSizeTypesStandardDS148V2 VirtualMachineSizeTypes = "Standard_DS14-8_v2" - // VirtualMachineSizeTypesStandardDS14V2 ... - VirtualMachineSizeTypesStandardDS14V2 VirtualMachineSizeTypes = "Standard_DS14_v2" - // VirtualMachineSizeTypesStandardDS15V2 ... - VirtualMachineSizeTypesStandardDS15V2 VirtualMachineSizeTypes = "Standard_DS15_v2" - // VirtualMachineSizeTypesStandardDS1V2 ... - VirtualMachineSizeTypesStandardDS1V2 VirtualMachineSizeTypes = "Standard_DS1_v2" - // VirtualMachineSizeTypesStandardDS2 ... - VirtualMachineSizeTypesStandardDS2 VirtualMachineSizeTypes = "Standard_DS2" - // VirtualMachineSizeTypesStandardDS2V2 ... - VirtualMachineSizeTypesStandardDS2V2 VirtualMachineSizeTypes = "Standard_DS2_v2" - // VirtualMachineSizeTypesStandardDS3 ... - VirtualMachineSizeTypesStandardDS3 VirtualMachineSizeTypes = "Standard_DS3" - // VirtualMachineSizeTypesStandardDS3V2 ... - VirtualMachineSizeTypesStandardDS3V2 VirtualMachineSizeTypes = "Standard_DS3_v2" - // VirtualMachineSizeTypesStandardDS4 ... - VirtualMachineSizeTypesStandardDS4 VirtualMachineSizeTypes = "Standard_DS4" - // VirtualMachineSizeTypesStandardDS4V2 ... - VirtualMachineSizeTypesStandardDS4V2 VirtualMachineSizeTypes = "Standard_DS4_v2" - // VirtualMachineSizeTypesStandardDS5V2 ... - VirtualMachineSizeTypesStandardDS5V2 VirtualMachineSizeTypes = "Standard_DS5_v2" - // VirtualMachineSizeTypesStandardE16sV3 ... - VirtualMachineSizeTypesStandardE16sV3 VirtualMachineSizeTypes = "Standard_E16s_v3" - // VirtualMachineSizeTypesStandardE16V3 ... - VirtualMachineSizeTypesStandardE16V3 VirtualMachineSizeTypes = "Standard_E16_v3" - // VirtualMachineSizeTypesStandardE2sV3 ... - VirtualMachineSizeTypesStandardE2sV3 VirtualMachineSizeTypes = "Standard_E2s_v3" - // VirtualMachineSizeTypesStandardE2V3 ... - VirtualMachineSizeTypesStandardE2V3 VirtualMachineSizeTypes = "Standard_E2_v3" - // VirtualMachineSizeTypesStandardE3216V3 ... - VirtualMachineSizeTypesStandardE3216V3 VirtualMachineSizeTypes = "Standard_E32-16_v3" - // VirtualMachineSizeTypesStandardE328sV3 ... - VirtualMachineSizeTypesStandardE328sV3 VirtualMachineSizeTypes = "Standard_E32-8s_v3" - // VirtualMachineSizeTypesStandardE32sV3 ... - VirtualMachineSizeTypesStandardE32sV3 VirtualMachineSizeTypes = "Standard_E32s_v3" - // VirtualMachineSizeTypesStandardE32V3 ... - VirtualMachineSizeTypesStandardE32V3 VirtualMachineSizeTypes = "Standard_E32_v3" - // VirtualMachineSizeTypesStandardE4sV3 ... - VirtualMachineSizeTypesStandardE4sV3 VirtualMachineSizeTypes = "Standard_E4s_v3" - // VirtualMachineSizeTypesStandardE4V3 ... - VirtualMachineSizeTypesStandardE4V3 VirtualMachineSizeTypes = "Standard_E4_v3" - // VirtualMachineSizeTypesStandardE6416sV3 ... - VirtualMachineSizeTypesStandardE6416sV3 VirtualMachineSizeTypes = "Standard_E64-16s_v3" - // VirtualMachineSizeTypesStandardE6432sV3 ... - VirtualMachineSizeTypesStandardE6432sV3 VirtualMachineSizeTypes = "Standard_E64-32s_v3" - // VirtualMachineSizeTypesStandardE64sV3 ... - VirtualMachineSizeTypesStandardE64sV3 VirtualMachineSizeTypes = "Standard_E64s_v3" - // VirtualMachineSizeTypesStandardE64V3 ... - VirtualMachineSizeTypesStandardE64V3 VirtualMachineSizeTypes = "Standard_E64_v3" - // VirtualMachineSizeTypesStandardE8sV3 ... - VirtualMachineSizeTypesStandardE8sV3 VirtualMachineSizeTypes = "Standard_E8s_v3" - // VirtualMachineSizeTypesStandardE8V3 ... - VirtualMachineSizeTypesStandardE8V3 VirtualMachineSizeTypes = "Standard_E8_v3" - // VirtualMachineSizeTypesStandardF1 ... - VirtualMachineSizeTypesStandardF1 VirtualMachineSizeTypes = "Standard_F1" - // VirtualMachineSizeTypesStandardF16 ... - VirtualMachineSizeTypesStandardF16 VirtualMachineSizeTypes = "Standard_F16" - // VirtualMachineSizeTypesStandardF16s ... - VirtualMachineSizeTypesStandardF16s VirtualMachineSizeTypes = "Standard_F16s" - // VirtualMachineSizeTypesStandardF16sV2 ... - VirtualMachineSizeTypesStandardF16sV2 VirtualMachineSizeTypes = "Standard_F16s_v2" - // VirtualMachineSizeTypesStandardF1s ... - VirtualMachineSizeTypesStandardF1s VirtualMachineSizeTypes = "Standard_F1s" - // VirtualMachineSizeTypesStandardF2 ... - VirtualMachineSizeTypesStandardF2 VirtualMachineSizeTypes = "Standard_F2" - // VirtualMachineSizeTypesStandardF2s ... - VirtualMachineSizeTypesStandardF2s VirtualMachineSizeTypes = "Standard_F2s" - // VirtualMachineSizeTypesStandardF2sV2 ... - VirtualMachineSizeTypesStandardF2sV2 VirtualMachineSizeTypes = "Standard_F2s_v2" - // VirtualMachineSizeTypesStandardF32sV2 ... - VirtualMachineSizeTypesStandardF32sV2 VirtualMachineSizeTypes = "Standard_F32s_v2" - // VirtualMachineSizeTypesStandardF4 ... - VirtualMachineSizeTypesStandardF4 VirtualMachineSizeTypes = "Standard_F4" - // VirtualMachineSizeTypesStandardF4s ... - VirtualMachineSizeTypesStandardF4s VirtualMachineSizeTypes = "Standard_F4s" - // VirtualMachineSizeTypesStandardF4sV2 ... - VirtualMachineSizeTypesStandardF4sV2 VirtualMachineSizeTypes = "Standard_F4s_v2" - // VirtualMachineSizeTypesStandardF64sV2 ... - VirtualMachineSizeTypesStandardF64sV2 VirtualMachineSizeTypes = "Standard_F64s_v2" - // VirtualMachineSizeTypesStandardF72sV2 ... - VirtualMachineSizeTypesStandardF72sV2 VirtualMachineSizeTypes = "Standard_F72s_v2" - // VirtualMachineSizeTypesStandardF8 ... - VirtualMachineSizeTypesStandardF8 VirtualMachineSizeTypes = "Standard_F8" - // VirtualMachineSizeTypesStandardF8s ... - VirtualMachineSizeTypesStandardF8s VirtualMachineSizeTypes = "Standard_F8s" - // VirtualMachineSizeTypesStandardF8sV2 ... - VirtualMachineSizeTypesStandardF8sV2 VirtualMachineSizeTypes = "Standard_F8s_v2" - // VirtualMachineSizeTypesStandardG1 ... - VirtualMachineSizeTypesStandardG1 VirtualMachineSizeTypes = "Standard_G1" - // VirtualMachineSizeTypesStandardG2 ... - VirtualMachineSizeTypesStandardG2 VirtualMachineSizeTypes = "Standard_G2" - // VirtualMachineSizeTypesStandardG3 ... - VirtualMachineSizeTypesStandardG3 VirtualMachineSizeTypes = "Standard_G3" - // VirtualMachineSizeTypesStandardG4 ... - VirtualMachineSizeTypesStandardG4 VirtualMachineSizeTypes = "Standard_G4" - // VirtualMachineSizeTypesStandardG5 ... - VirtualMachineSizeTypesStandardG5 VirtualMachineSizeTypes = "Standard_G5" - // VirtualMachineSizeTypesStandardGS1 ... - VirtualMachineSizeTypesStandardGS1 VirtualMachineSizeTypes = "Standard_GS1" - // VirtualMachineSizeTypesStandardGS2 ... - VirtualMachineSizeTypesStandardGS2 VirtualMachineSizeTypes = "Standard_GS2" - // VirtualMachineSizeTypesStandardGS3 ... - VirtualMachineSizeTypesStandardGS3 VirtualMachineSizeTypes = "Standard_GS3" - // VirtualMachineSizeTypesStandardGS4 ... - VirtualMachineSizeTypesStandardGS4 VirtualMachineSizeTypes = "Standard_GS4" - // VirtualMachineSizeTypesStandardGS44 ... - VirtualMachineSizeTypesStandardGS44 VirtualMachineSizeTypes = "Standard_GS4-4" - // VirtualMachineSizeTypesStandardGS48 ... - VirtualMachineSizeTypesStandardGS48 VirtualMachineSizeTypes = "Standard_GS4-8" - // VirtualMachineSizeTypesStandardGS5 ... - VirtualMachineSizeTypesStandardGS5 VirtualMachineSizeTypes = "Standard_GS5" - // VirtualMachineSizeTypesStandardGS516 ... - VirtualMachineSizeTypesStandardGS516 VirtualMachineSizeTypes = "Standard_GS5-16" - // VirtualMachineSizeTypesStandardGS58 ... - VirtualMachineSizeTypesStandardGS58 VirtualMachineSizeTypes = "Standard_GS5-8" - // VirtualMachineSizeTypesStandardH16 ... - VirtualMachineSizeTypesStandardH16 VirtualMachineSizeTypes = "Standard_H16" - // VirtualMachineSizeTypesStandardH16m ... - VirtualMachineSizeTypesStandardH16m VirtualMachineSizeTypes = "Standard_H16m" - // VirtualMachineSizeTypesStandardH16mr ... - VirtualMachineSizeTypesStandardH16mr VirtualMachineSizeTypes = "Standard_H16mr" - // VirtualMachineSizeTypesStandardH16r ... - VirtualMachineSizeTypesStandardH16r VirtualMachineSizeTypes = "Standard_H16r" - // VirtualMachineSizeTypesStandardH8 ... - VirtualMachineSizeTypesStandardH8 VirtualMachineSizeTypes = "Standard_H8" - // VirtualMachineSizeTypesStandardH8m ... - VirtualMachineSizeTypesStandardH8m VirtualMachineSizeTypes = "Standard_H8m" - // VirtualMachineSizeTypesStandardL16s ... - VirtualMachineSizeTypesStandardL16s VirtualMachineSizeTypes = "Standard_L16s" - // VirtualMachineSizeTypesStandardL32s ... - VirtualMachineSizeTypesStandardL32s VirtualMachineSizeTypes = "Standard_L32s" - // VirtualMachineSizeTypesStandardL4s ... - VirtualMachineSizeTypesStandardL4s VirtualMachineSizeTypes = "Standard_L4s" - // VirtualMachineSizeTypesStandardL8s ... - VirtualMachineSizeTypesStandardL8s VirtualMachineSizeTypes = "Standard_L8s" - // VirtualMachineSizeTypesStandardM12832ms ... - VirtualMachineSizeTypesStandardM12832ms VirtualMachineSizeTypes = "Standard_M128-32ms" - // VirtualMachineSizeTypesStandardM12864ms ... - VirtualMachineSizeTypesStandardM12864ms VirtualMachineSizeTypes = "Standard_M128-64ms" - // VirtualMachineSizeTypesStandardM128ms ... - VirtualMachineSizeTypesStandardM128ms VirtualMachineSizeTypes = "Standard_M128ms" - // VirtualMachineSizeTypesStandardM128s ... - VirtualMachineSizeTypesStandardM128s VirtualMachineSizeTypes = "Standard_M128s" - // VirtualMachineSizeTypesStandardM6416ms ... - VirtualMachineSizeTypesStandardM6416ms VirtualMachineSizeTypes = "Standard_M64-16ms" - // VirtualMachineSizeTypesStandardM6432ms ... - VirtualMachineSizeTypesStandardM6432ms VirtualMachineSizeTypes = "Standard_M64-32ms" - // VirtualMachineSizeTypesStandardM64ms ... - VirtualMachineSizeTypesStandardM64ms VirtualMachineSizeTypes = "Standard_M64ms" - // VirtualMachineSizeTypesStandardM64s ... - VirtualMachineSizeTypesStandardM64s VirtualMachineSizeTypes = "Standard_M64s" - // VirtualMachineSizeTypesStandardNC12 ... - VirtualMachineSizeTypesStandardNC12 VirtualMachineSizeTypes = "Standard_NC12" - // VirtualMachineSizeTypesStandardNC12sV2 ... - VirtualMachineSizeTypesStandardNC12sV2 VirtualMachineSizeTypes = "Standard_NC12s_v2" - // VirtualMachineSizeTypesStandardNC12sV3 ... - VirtualMachineSizeTypesStandardNC12sV3 VirtualMachineSizeTypes = "Standard_NC12s_v3" - // VirtualMachineSizeTypesStandardNC24 ... - VirtualMachineSizeTypesStandardNC24 VirtualMachineSizeTypes = "Standard_NC24" - // VirtualMachineSizeTypesStandardNC24r ... - VirtualMachineSizeTypesStandardNC24r VirtualMachineSizeTypes = "Standard_NC24r" - // VirtualMachineSizeTypesStandardNC24rsV2 ... - VirtualMachineSizeTypesStandardNC24rsV2 VirtualMachineSizeTypes = "Standard_NC24rs_v2" - // VirtualMachineSizeTypesStandardNC24rsV3 ... - VirtualMachineSizeTypesStandardNC24rsV3 VirtualMachineSizeTypes = "Standard_NC24rs_v3" - // VirtualMachineSizeTypesStandardNC24sV2 ... - VirtualMachineSizeTypesStandardNC24sV2 VirtualMachineSizeTypes = "Standard_NC24s_v2" - // VirtualMachineSizeTypesStandardNC24sV3 ... - VirtualMachineSizeTypesStandardNC24sV3 VirtualMachineSizeTypes = "Standard_NC24s_v3" - // VirtualMachineSizeTypesStandardNC6 ... - VirtualMachineSizeTypesStandardNC6 VirtualMachineSizeTypes = "Standard_NC6" - // VirtualMachineSizeTypesStandardNC6sV2 ... - VirtualMachineSizeTypesStandardNC6sV2 VirtualMachineSizeTypes = "Standard_NC6s_v2" - // VirtualMachineSizeTypesStandardNC6sV3 ... - VirtualMachineSizeTypesStandardNC6sV3 VirtualMachineSizeTypes = "Standard_NC6s_v3" - // VirtualMachineSizeTypesStandardND12s ... - VirtualMachineSizeTypesStandardND12s VirtualMachineSizeTypes = "Standard_ND12s" - // VirtualMachineSizeTypesStandardND24rs ... - VirtualMachineSizeTypesStandardND24rs VirtualMachineSizeTypes = "Standard_ND24rs" - // VirtualMachineSizeTypesStandardND24s ... - VirtualMachineSizeTypesStandardND24s VirtualMachineSizeTypes = "Standard_ND24s" - // VirtualMachineSizeTypesStandardND6s ... - VirtualMachineSizeTypesStandardND6s VirtualMachineSizeTypes = "Standard_ND6s" - // VirtualMachineSizeTypesStandardNV12 ... - VirtualMachineSizeTypesStandardNV12 VirtualMachineSizeTypes = "Standard_NV12" - // VirtualMachineSizeTypesStandardNV24 ... - VirtualMachineSizeTypesStandardNV24 VirtualMachineSizeTypes = "Standard_NV24" - // VirtualMachineSizeTypesStandardNV6 ... - VirtualMachineSizeTypesStandardNV6 VirtualMachineSizeTypes = "Standard_NV6" -) - -// PossibleVirtualMachineSizeTypesValues returns an array of possible values for the VirtualMachineSizeTypes const type. -func PossibleVirtualMachineSizeTypesValues() []VirtualMachineSizeTypes { - return []VirtualMachineSizeTypes{VirtualMachineSizeTypesBasicA0, VirtualMachineSizeTypesBasicA1, VirtualMachineSizeTypesBasicA2, VirtualMachineSizeTypesBasicA3, VirtualMachineSizeTypesBasicA4, VirtualMachineSizeTypesStandardA0, VirtualMachineSizeTypesStandardA1, VirtualMachineSizeTypesStandardA10, VirtualMachineSizeTypesStandardA11, VirtualMachineSizeTypesStandardA1V2, VirtualMachineSizeTypesStandardA2, VirtualMachineSizeTypesStandardA2mV2, VirtualMachineSizeTypesStandardA2V2, VirtualMachineSizeTypesStandardA3, VirtualMachineSizeTypesStandardA4, VirtualMachineSizeTypesStandardA4mV2, VirtualMachineSizeTypesStandardA4V2, VirtualMachineSizeTypesStandardA5, VirtualMachineSizeTypesStandardA6, VirtualMachineSizeTypesStandardA7, VirtualMachineSizeTypesStandardA8, VirtualMachineSizeTypesStandardA8mV2, VirtualMachineSizeTypesStandardA8V2, VirtualMachineSizeTypesStandardA9, VirtualMachineSizeTypesStandardB1ms, VirtualMachineSizeTypesStandardB1s, VirtualMachineSizeTypesStandardB2ms, VirtualMachineSizeTypesStandardB2s, VirtualMachineSizeTypesStandardB4ms, VirtualMachineSizeTypesStandardB8ms, VirtualMachineSizeTypesStandardD1, VirtualMachineSizeTypesStandardD11, VirtualMachineSizeTypesStandardD11V2, VirtualMachineSizeTypesStandardD12, VirtualMachineSizeTypesStandardD12V2, VirtualMachineSizeTypesStandardD13, VirtualMachineSizeTypesStandardD13V2, VirtualMachineSizeTypesStandardD14, VirtualMachineSizeTypesStandardD14V2, VirtualMachineSizeTypesStandardD15V2, VirtualMachineSizeTypesStandardD16sV3, VirtualMachineSizeTypesStandardD16V3, VirtualMachineSizeTypesStandardD1V2, VirtualMachineSizeTypesStandardD2, VirtualMachineSizeTypesStandardD2sV3, VirtualMachineSizeTypesStandardD2V2, VirtualMachineSizeTypesStandardD2V3, VirtualMachineSizeTypesStandardD3, VirtualMachineSizeTypesStandardD32sV3, VirtualMachineSizeTypesStandardD32V3, VirtualMachineSizeTypesStandardD3V2, VirtualMachineSizeTypesStandardD4, VirtualMachineSizeTypesStandardD4sV3, VirtualMachineSizeTypesStandardD4V2, VirtualMachineSizeTypesStandardD4V3, VirtualMachineSizeTypesStandardD5V2, VirtualMachineSizeTypesStandardD64sV3, VirtualMachineSizeTypesStandardD64V3, VirtualMachineSizeTypesStandardD8sV3, VirtualMachineSizeTypesStandardD8V3, VirtualMachineSizeTypesStandardDS1, VirtualMachineSizeTypesStandardDS11, VirtualMachineSizeTypesStandardDS11V2, VirtualMachineSizeTypesStandardDS12, VirtualMachineSizeTypesStandardDS12V2, VirtualMachineSizeTypesStandardDS13, VirtualMachineSizeTypesStandardDS132V2, VirtualMachineSizeTypesStandardDS134V2, VirtualMachineSizeTypesStandardDS13V2, VirtualMachineSizeTypesStandardDS14, VirtualMachineSizeTypesStandardDS144V2, VirtualMachineSizeTypesStandardDS148V2, VirtualMachineSizeTypesStandardDS14V2, VirtualMachineSizeTypesStandardDS15V2, VirtualMachineSizeTypesStandardDS1V2, VirtualMachineSizeTypesStandardDS2, VirtualMachineSizeTypesStandardDS2V2, VirtualMachineSizeTypesStandardDS3, VirtualMachineSizeTypesStandardDS3V2, VirtualMachineSizeTypesStandardDS4, VirtualMachineSizeTypesStandardDS4V2, VirtualMachineSizeTypesStandardDS5V2, VirtualMachineSizeTypesStandardE16sV3, VirtualMachineSizeTypesStandardE16V3, VirtualMachineSizeTypesStandardE2sV3, VirtualMachineSizeTypesStandardE2V3, VirtualMachineSizeTypesStandardE3216V3, VirtualMachineSizeTypesStandardE328sV3, VirtualMachineSizeTypesStandardE32sV3, VirtualMachineSizeTypesStandardE32V3, VirtualMachineSizeTypesStandardE4sV3, VirtualMachineSizeTypesStandardE4V3, VirtualMachineSizeTypesStandardE6416sV3, VirtualMachineSizeTypesStandardE6432sV3, VirtualMachineSizeTypesStandardE64sV3, VirtualMachineSizeTypesStandardE64V3, VirtualMachineSizeTypesStandardE8sV3, VirtualMachineSizeTypesStandardE8V3, VirtualMachineSizeTypesStandardF1, VirtualMachineSizeTypesStandardF16, VirtualMachineSizeTypesStandardF16s, VirtualMachineSizeTypesStandardF16sV2, VirtualMachineSizeTypesStandardF1s, VirtualMachineSizeTypesStandardF2, VirtualMachineSizeTypesStandardF2s, VirtualMachineSizeTypesStandardF2sV2, VirtualMachineSizeTypesStandardF32sV2, VirtualMachineSizeTypesStandardF4, VirtualMachineSizeTypesStandardF4s, VirtualMachineSizeTypesStandardF4sV2, VirtualMachineSizeTypesStandardF64sV2, VirtualMachineSizeTypesStandardF72sV2, VirtualMachineSizeTypesStandardF8, VirtualMachineSizeTypesStandardF8s, VirtualMachineSizeTypesStandardF8sV2, VirtualMachineSizeTypesStandardG1, VirtualMachineSizeTypesStandardG2, VirtualMachineSizeTypesStandardG3, VirtualMachineSizeTypesStandardG4, VirtualMachineSizeTypesStandardG5, VirtualMachineSizeTypesStandardGS1, VirtualMachineSizeTypesStandardGS2, VirtualMachineSizeTypesStandardGS3, VirtualMachineSizeTypesStandardGS4, VirtualMachineSizeTypesStandardGS44, VirtualMachineSizeTypesStandardGS48, VirtualMachineSizeTypesStandardGS5, VirtualMachineSizeTypesStandardGS516, VirtualMachineSizeTypesStandardGS58, VirtualMachineSizeTypesStandardH16, VirtualMachineSizeTypesStandardH16m, VirtualMachineSizeTypesStandardH16mr, VirtualMachineSizeTypesStandardH16r, VirtualMachineSizeTypesStandardH8, VirtualMachineSizeTypesStandardH8m, VirtualMachineSizeTypesStandardL16s, VirtualMachineSizeTypesStandardL32s, VirtualMachineSizeTypesStandardL4s, VirtualMachineSizeTypesStandardL8s, VirtualMachineSizeTypesStandardM12832ms, VirtualMachineSizeTypesStandardM12864ms, VirtualMachineSizeTypesStandardM128ms, VirtualMachineSizeTypesStandardM128s, VirtualMachineSizeTypesStandardM6416ms, VirtualMachineSizeTypesStandardM6432ms, VirtualMachineSizeTypesStandardM64ms, VirtualMachineSizeTypesStandardM64s, VirtualMachineSizeTypesStandardNC12, VirtualMachineSizeTypesStandardNC12sV2, VirtualMachineSizeTypesStandardNC12sV3, VirtualMachineSizeTypesStandardNC24, VirtualMachineSizeTypesStandardNC24r, VirtualMachineSizeTypesStandardNC24rsV2, VirtualMachineSizeTypesStandardNC24rsV3, VirtualMachineSizeTypesStandardNC24sV2, VirtualMachineSizeTypesStandardNC24sV3, VirtualMachineSizeTypesStandardNC6, VirtualMachineSizeTypesStandardNC6sV2, VirtualMachineSizeTypesStandardNC6sV3, VirtualMachineSizeTypesStandardND12s, VirtualMachineSizeTypesStandardND24rs, VirtualMachineSizeTypesStandardND24s, VirtualMachineSizeTypesStandardND6s, VirtualMachineSizeTypesStandardNV12, VirtualMachineSizeTypesStandardNV24, VirtualMachineSizeTypesStandardNV6} -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/galleries.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/galleries.go deleted file mode 100644 index 44089eca5d9a..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/galleries.go +++ /dev/null @@ -1,580 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// GalleriesClient is the compute Client -type GalleriesClient struct { - BaseClient -} - -// NewGalleriesClient creates an instance of the GalleriesClient client. -func NewGalleriesClient(subscriptionID string) GalleriesClient { - return NewGalleriesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewGalleriesClientWithBaseURI creates an instance of the GalleriesClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewGalleriesClientWithBaseURI(baseURI string, subscriptionID string) GalleriesClient { - return GalleriesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a Shared Image Gallery. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery. The allowed characters are alphabets and numbers with -// dots and periods allowed in the middle. The maximum length is 80 characters. -// gallery - parameters supplied to the create or update Shared Image Gallery operation. -func (client GalleriesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, gallery Gallery) (result GalleriesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, galleryName, gallery) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client GalleriesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, gallery Gallery) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}", pathParameters), - autorest.WithJSON(gallery), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client GalleriesClient) CreateOrUpdateSender(req *http.Request) (future GalleriesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client GalleriesClient) CreateOrUpdateResponder(resp *http.Response) (result Gallery, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a Shared Image Gallery. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery to be deleted. -func (client GalleriesClient) Delete(ctx context.Context, resourceGroupName string, galleryName string) (result GalleriesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, galleryName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client GalleriesClient) DeletePreparer(ctx context.Context, resourceGroupName string, galleryName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client GalleriesClient) DeleteSender(req *http.Request) (future GalleriesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client GalleriesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about a Shared Image Gallery. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery. -func (client GalleriesClient) Get(ctx context.Context, resourceGroupName string, galleryName string) (result Gallery, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, galleryName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client GalleriesClient) GetPreparer(ctx context.Context, resourceGroupName string, galleryName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client GalleriesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client GalleriesClient) GetResponder(resp *http.Response) (result Gallery, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List list galleries under a subscription. -func (client GalleriesClient) List(ctx context.Context) (result GalleryListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.List") - defer func() { - sc := -1 - if result.gl.Response.Response != nil { - sc = result.gl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.gl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "List", resp, "Failure sending request") - return - } - - result.gl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "List", resp, "Failure responding to request") - return - } - if result.gl.hasNextLink() && result.gl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client GalleriesClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/galleries", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client GalleriesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client GalleriesClient) ListResponder(resp *http.Response) (result GalleryList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client GalleriesClient) listNextResults(ctx context.Context, lastResults GalleryList) (result GalleryList, err error) { - req, err := lastResults.galleryListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.GalleriesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.GalleriesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client GalleriesClient) ListComplete(ctx context.Context) (result GalleryListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup list galleries under a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client GalleriesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result GalleryListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.gl.Response.Response != nil { - sc = result.gl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.gl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.gl, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.gl.hasNextLink() && result.gl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client GalleriesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client GalleriesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client GalleriesClient) ListByResourceGroupResponder(resp *http.Response) (result GalleryList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client GalleriesClient) listByResourceGroupNextResults(ctx context.Context, lastResults GalleryList) (result GalleryList, err error) { - req, err := lastResults.galleryListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.GalleriesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.GalleriesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client GalleriesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result GalleryListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// Update update a Shared Image Gallery. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery. The allowed characters are alphabets and numbers with -// dots and periods allowed in the middle. The maximum length is 80 characters. -// gallery - parameters supplied to the update Shared Image Gallery operation. -func (client GalleriesClient) Update(ctx context.Context, resourceGroupName string, galleryName string, gallery GalleryUpdate) (result GalleriesUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleriesClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, galleryName, gallery) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client GalleriesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, gallery GalleryUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}", pathParameters), - autorest.WithJSON(gallery), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client GalleriesClient) UpdateSender(req *http.Request) (future GalleriesUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client GalleriesClient) UpdateResponder(resp *http.Response) (result Gallery, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/galleryapplications.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/galleryapplications.go deleted file mode 100644 index 073662554d51..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/galleryapplications.go +++ /dev/null @@ -1,485 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// GalleryApplicationsClient is the compute Client -type GalleryApplicationsClient struct { - BaseClient -} - -// NewGalleryApplicationsClient creates an instance of the GalleryApplicationsClient client. -func NewGalleryApplicationsClient(subscriptionID string) GalleryApplicationsClient { - return NewGalleryApplicationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewGalleryApplicationsClientWithBaseURI creates an instance of the GalleryApplicationsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewGalleryApplicationsClientWithBaseURI(baseURI string, subscriptionID string) GalleryApplicationsClient { - return GalleryApplicationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a gallery Application Definition. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Application Gallery in which the Application Definition is to be -// created. -// galleryApplicationName - the name of the gallery Application Definition to be created or updated. The -// allowed characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The -// maximum length is 80 characters. -// galleryApplication - parameters supplied to the create or update gallery Application operation. -func (client GalleryApplicationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplication) (result GalleryApplicationsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplication) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client GalleryApplicationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplication) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}", pathParameters), - autorest.WithJSON(galleryApplication), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryApplicationsClient) CreateOrUpdateSender(req *http.Request) (future GalleryApplicationsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client GalleryApplicationsClient) CreateOrUpdateResponder(resp *http.Response) (result GalleryApplication, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a gallery Application. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Application Gallery in which the Application Definition is to be -// deleted. -// galleryApplicationName - the name of the gallery Application Definition to be deleted. -func (client GalleryApplicationsClient) Delete(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (result GalleryApplicationsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client GalleryApplicationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryApplicationsClient) DeleteSender(req *http.Request) (future GalleryApplicationsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client GalleryApplicationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about a gallery Application Definition. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Application Gallery from which the Application Definitions are to be -// retrieved. -// galleryApplicationName - the name of the gallery Application Definition to be retrieved. -func (client GalleryApplicationsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (result GalleryApplication, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, galleryName, galleryApplicationName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client GalleryApplicationsClient) GetPreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryApplicationsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client GalleryApplicationsClient) GetResponder(resp *http.Response) (result GalleryApplication, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByGallery list gallery Application Definitions in a gallery. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Application Gallery from which Application Definitions are to be -// listed. -func (client GalleryApplicationsClient) ListByGallery(ctx context.Context, resourceGroupName string, galleryName string) (result GalleryApplicationListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.ListByGallery") - defer func() { - sc := -1 - if result.gal.Response.Response != nil { - sc = result.gal.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByGalleryNextResults - req, err := client.ListByGalleryPreparer(ctx, resourceGroupName, galleryName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "ListByGallery", nil, "Failure preparing request") - return - } - - resp, err := client.ListByGallerySender(req) - if err != nil { - result.gal.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "ListByGallery", resp, "Failure sending request") - return - } - - result.gal, err = client.ListByGalleryResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "ListByGallery", resp, "Failure responding to request") - return - } - if result.gal.hasNextLink() && result.gal.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByGalleryPreparer prepares the ListByGallery request. -func (client GalleryApplicationsClient) ListByGalleryPreparer(ctx context.Context, resourceGroupName string, galleryName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByGallerySender sends the ListByGallery request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryApplicationsClient) ListByGallerySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByGalleryResponder handles the response to the ListByGallery request. The method always -// closes the http.Response Body. -func (client GalleryApplicationsClient) ListByGalleryResponder(resp *http.Response) (result GalleryApplicationList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByGalleryNextResults retrieves the next set of results, if any. -func (client GalleryApplicationsClient) listByGalleryNextResults(ctx context.Context, lastResults GalleryApplicationList) (result GalleryApplicationList, err error) { - req, err := lastResults.galleryApplicationListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "listByGalleryNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByGallerySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "listByGalleryNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByGalleryResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "listByGalleryNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByGalleryComplete enumerates all values, automatically crossing page boundaries as required. -func (client GalleryApplicationsClient) ListByGalleryComplete(ctx context.Context, resourceGroupName string, galleryName string) (result GalleryApplicationListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.ListByGallery") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByGallery(ctx, resourceGroupName, galleryName) - return -} - -// Update update a gallery Application Definition. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Application Gallery in which the Application Definition is to be -// updated. -// galleryApplicationName - the name of the gallery Application Definition to be updated. The allowed -// characters are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum -// length is 80 characters. -// galleryApplication - parameters supplied to the update gallery Application operation. -func (client GalleryApplicationsClient) Update(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplicationUpdate) (result GalleryApplicationsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplication) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client GalleryApplicationsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplication GalleryApplicationUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}", pathParameters), - autorest.WithJSON(galleryApplication), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryApplicationsClient) UpdateSender(req *http.Request) (future GalleryApplicationsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client GalleryApplicationsClient) UpdateResponder(resp *http.Response) (result GalleryApplication, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/galleryapplicationversions.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/galleryapplicationversions.go deleted file mode 100644 index 2fa93086ead3..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/galleryapplicationversions.go +++ /dev/null @@ -1,514 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// GalleryApplicationVersionsClient is the compute Client -type GalleryApplicationVersionsClient struct { - BaseClient -} - -// NewGalleryApplicationVersionsClient creates an instance of the GalleryApplicationVersionsClient client. -func NewGalleryApplicationVersionsClient(subscriptionID string) GalleryApplicationVersionsClient { - return NewGalleryApplicationVersionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewGalleryApplicationVersionsClientWithBaseURI creates an instance of the GalleryApplicationVersionsClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewGalleryApplicationVersionsClientWithBaseURI(baseURI string, subscriptionID string) GalleryApplicationVersionsClient { - return GalleryApplicationVersionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a gallery Application Version. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Application Gallery in which the Application Definition resides. -// galleryApplicationName - the name of the gallery Application Definition in which the Application Version is -// to be created. -// galleryApplicationVersionName - the name of the gallery Application Version to be created. Needs to follow -// semantic version name pattern: The allowed characters are digit and period. Digits must be within the range -// of a 32-bit integer. Format: .. -// galleryApplicationVersion - parameters supplied to the create or update gallery Application Version -// operation. -func (client GalleryApplicationVersionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersion) (result GalleryApplicationVersionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: galleryApplicationVersion, - Constraints: []validation.Constraint{{Target: "galleryApplicationVersion.GalleryApplicationVersionProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile.Source", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile.Source.FileName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "galleryApplicationVersion.GalleryApplicationVersionProperties.PublishingProfile.Source.MediaLink", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.GalleryApplicationVersionsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client GalleryApplicationVersionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersion) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryApplicationVersionName": autorest.Encode("path", galleryApplicationVersionName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", pathParameters), - autorest.WithJSON(galleryApplicationVersion), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryApplicationVersionsClient) CreateOrUpdateSender(req *http.Request) (future GalleryApplicationVersionsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client GalleryApplicationVersionsClient) CreateOrUpdateResponder(resp *http.Response) (result GalleryApplicationVersion, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a gallery Application Version. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Application Gallery in which the Application Definition resides. -// galleryApplicationName - the name of the gallery Application Definition in which the Application Version -// resides. -// galleryApplicationVersionName - the name of the gallery Application Version to be deleted. -func (client GalleryApplicationVersionsClient) Delete(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string) (result GalleryApplicationVersionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client GalleryApplicationVersionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryApplicationVersionName": autorest.Encode("path", galleryApplicationVersionName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryApplicationVersionsClient) DeleteSender(req *http.Request) (future GalleryApplicationVersionsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client GalleryApplicationVersionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about a gallery Application Version. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Application Gallery in which the Application Definition resides. -// galleryApplicationName - the name of the gallery Application Definition in which the Application Version -// resides. -// galleryApplicationVersionName - the name of the gallery Application Version to be retrieved. -// expand - the expand expression to apply on the operation. -func (client GalleryApplicationVersionsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, expand ReplicationStatusTypes) (result GalleryApplicationVersion, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client GalleryApplicationVersionsClient) GetPreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, expand ReplicationStatusTypes) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryApplicationVersionName": autorest.Encode("path", galleryApplicationVersionName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryApplicationVersionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client GalleryApplicationVersionsClient) GetResponder(resp *http.Response) (result GalleryApplicationVersion, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByGalleryApplication list gallery Application Versions in a gallery Application Definition. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Application Gallery in which the Application Definition resides. -// galleryApplicationName - the name of the Shared Application Gallery Application Definition from which the -// Application Versions are to be listed. -func (client GalleryApplicationVersionsClient) ListByGalleryApplication(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (result GalleryApplicationVersionListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.ListByGalleryApplication") - defer func() { - sc := -1 - if result.gavl.Response.Response != nil { - sc = result.gavl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByGalleryApplicationNextResults - req, err := client.ListByGalleryApplicationPreparer(ctx, resourceGroupName, galleryName, galleryApplicationName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "ListByGalleryApplication", nil, "Failure preparing request") - return - } - - resp, err := client.ListByGalleryApplicationSender(req) - if err != nil { - result.gavl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "ListByGalleryApplication", resp, "Failure sending request") - return - } - - result.gavl, err = client.ListByGalleryApplicationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "ListByGalleryApplication", resp, "Failure responding to request") - return - } - if result.gavl.hasNextLink() && result.gavl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByGalleryApplicationPreparer prepares the ListByGalleryApplication request. -func (client GalleryApplicationVersionsClient) ListByGalleryApplicationPreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByGalleryApplicationSender sends the ListByGalleryApplication request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryApplicationVersionsClient) ListByGalleryApplicationSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByGalleryApplicationResponder handles the response to the ListByGalleryApplication request. The method always -// closes the http.Response Body. -func (client GalleryApplicationVersionsClient) ListByGalleryApplicationResponder(resp *http.Response) (result GalleryApplicationVersionList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByGalleryApplicationNextResults retrieves the next set of results, if any. -func (client GalleryApplicationVersionsClient) listByGalleryApplicationNextResults(ctx context.Context, lastResults GalleryApplicationVersionList) (result GalleryApplicationVersionList, err error) { - req, err := lastResults.galleryApplicationVersionListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "listByGalleryApplicationNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByGalleryApplicationSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "listByGalleryApplicationNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByGalleryApplicationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "listByGalleryApplicationNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByGalleryApplicationComplete enumerates all values, automatically crossing page boundaries as required. -func (client GalleryApplicationVersionsClient) ListByGalleryApplicationComplete(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string) (result GalleryApplicationVersionListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.ListByGalleryApplication") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByGalleryApplication(ctx, resourceGroupName, galleryName, galleryApplicationName) - return -} - -// Update update a gallery Application Version. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Application Gallery in which the Application Definition resides. -// galleryApplicationName - the name of the gallery Application Definition in which the Application Version is -// to be updated. -// galleryApplicationVersionName - the name of the gallery Application Version to be updated. Needs to follow -// semantic version name pattern: The allowed characters are digit and period. Digits must be within the range -// of a 32-bit integer. Format: .. -// galleryApplicationVersion - parameters supplied to the update gallery Application Version operation. -func (client GalleryApplicationVersionsClient) Update(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersionUpdate) (result GalleryApplicationVersionsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, galleryName, galleryApplicationName, galleryApplicationVersionName, galleryApplicationVersion) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client GalleryApplicationVersionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryApplicationName string, galleryApplicationVersionName string, galleryApplicationVersion GalleryApplicationVersionUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryApplicationName": autorest.Encode("path", galleryApplicationName), - "galleryApplicationVersionName": autorest.Encode("path", galleryApplicationVersionName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/applications/{galleryApplicationName}/versions/{galleryApplicationVersionName}", pathParameters), - autorest.WithJSON(galleryApplicationVersion), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryApplicationVersionsClient) UpdateSender(req *http.Request) (future GalleryApplicationVersionsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client GalleryApplicationVersionsClient) UpdateResponder(resp *http.Response) (result GalleryApplicationVersion, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/galleryimages.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/galleryimages.go deleted file mode 100644 index b6a600ecbeb0..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/galleryimages.go +++ /dev/null @@ -1,492 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// GalleryImagesClient is the compute Client -type GalleryImagesClient struct { - BaseClient -} - -// NewGalleryImagesClient creates an instance of the GalleryImagesClient client. -func NewGalleryImagesClient(subscriptionID string) GalleryImagesClient { - return NewGalleryImagesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewGalleryImagesClientWithBaseURI creates an instance of the GalleryImagesClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewGalleryImagesClientWithBaseURI(baseURI string, subscriptionID string) GalleryImagesClient { - return GalleryImagesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a gallery Image Definition. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery in which the Image Definition is to be created. -// galleryImageName - the name of the gallery Image Definition to be created or updated. The allowed characters -// are alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 -// characters. -// galleryImage - parameters supplied to the create or update gallery image operation. -func (client GalleryImagesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImage) (result GalleryImagesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: galleryImage, - Constraints: []validation.Constraint{{Target: "galleryImage.GalleryImageProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "galleryImage.GalleryImageProperties.Identifier", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "galleryImage.GalleryImageProperties.Identifier.Publisher", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "galleryImage.GalleryImageProperties.Identifier.Offer", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "galleryImage.GalleryImageProperties.Identifier.Sku", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.GalleryImagesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, galleryName, galleryImageName, galleryImage) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client GalleryImagesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImage) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}", pathParameters), - autorest.WithJSON(galleryImage), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryImagesClient) CreateOrUpdateSender(req *http.Request) (future GalleryImagesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client GalleryImagesClient) CreateOrUpdateResponder(resp *http.Response) (result GalleryImage, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a gallery image. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery in which the Image Definition is to be deleted. -// galleryImageName - the name of the gallery Image Definition to be deleted. -func (client GalleryImagesClient) Delete(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (result GalleryImagesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, galleryName, galleryImageName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client GalleryImagesClient) DeletePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryImagesClient) DeleteSender(req *http.Request) (future GalleryImagesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client GalleryImagesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about a gallery Image Definition. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery from which the Image Definitions are to be retrieved. -// galleryImageName - the name of the gallery Image Definition to be retrieved. -func (client GalleryImagesClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (result GalleryImage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, galleryName, galleryImageName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client GalleryImagesClient) GetPreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryImagesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client GalleryImagesClient) GetResponder(resp *http.Response) (result GalleryImage, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByGallery list gallery Image Definitions in a gallery. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery from which Image Definitions are to be listed. -func (client GalleryImagesClient) ListByGallery(ctx context.Context, resourceGroupName string, galleryName string) (result GalleryImageListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.ListByGallery") - defer func() { - sc := -1 - if result.gil.Response.Response != nil { - sc = result.gil.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByGalleryNextResults - req, err := client.ListByGalleryPreparer(ctx, resourceGroupName, galleryName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "ListByGallery", nil, "Failure preparing request") - return - } - - resp, err := client.ListByGallerySender(req) - if err != nil { - result.gil.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "ListByGallery", resp, "Failure sending request") - return - } - - result.gil, err = client.ListByGalleryResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "ListByGallery", resp, "Failure responding to request") - return - } - if result.gil.hasNextLink() && result.gil.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByGalleryPreparer prepares the ListByGallery request. -func (client GalleryImagesClient) ListByGalleryPreparer(ctx context.Context, resourceGroupName string, galleryName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByGallerySender sends the ListByGallery request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryImagesClient) ListByGallerySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByGalleryResponder handles the response to the ListByGallery request. The method always -// closes the http.Response Body. -func (client GalleryImagesClient) ListByGalleryResponder(resp *http.Response) (result GalleryImageList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByGalleryNextResults retrieves the next set of results, if any. -func (client GalleryImagesClient) listByGalleryNextResults(ctx context.Context, lastResults GalleryImageList) (result GalleryImageList, err error) { - req, err := lastResults.galleryImageListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "listByGalleryNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByGallerySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "listByGalleryNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByGalleryResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "listByGalleryNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByGalleryComplete enumerates all values, automatically crossing page boundaries as required. -func (client GalleryImagesClient) ListByGalleryComplete(ctx context.Context, resourceGroupName string, galleryName string) (result GalleryImageListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.ListByGallery") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByGallery(ctx, resourceGroupName, galleryName) - return -} - -// Update update a gallery Image Definition. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery in which the Image Definition is to be updated. -// galleryImageName - the name of the gallery Image Definition to be updated. The allowed characters are -// alphabets and numbers with dots, dashes, and periods allowed in the middle. The maximum length is 80 -// characters. -// galleryImage - parameters supplied to the update gallery image operation. -func (client GalleryImagesClient) Update(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImageUpdate) (result GalleryImagesUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, galleryName, galleryImageName, galleryImage) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client GalleryImagesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImage GalleryImageUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}", pathParameters), - autorest.WithJSON(galleryImage), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryImagesClient) UpdateSender(req *http.Request) (future GalleryImagesUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client GalleryImagesClient) UpdateResponder(resp *http.Response) (result GalleryImage, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/galleryimageversions.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/galleryimageversions.go deleted file mode 100644 index 234c932abb2a..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/galleryimageversions.go +++ /dev/null @@ -1,503 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// GalleryImageVersionsClient is the compute Client -type GalleryImageVersionsClient struct { - BaseClient -} - -// NewGalleryImageVersionsClient creates an instance of the GalleryImageVersionsClient client. -func NewGalleryImageVersionsClient(subscriptionID string) GalleryImageVersionsClient { - return NewGalleryImageVersionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewGalleryImageVersionsClientWithBaseURI creates an instance of the GalleryImageVersionsClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewGalleryImageVersionsClientWithBaseURI(baseURI string, subscriptionID string) GalleryImageVersionsClient { - return GalleryImageVersionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a gallery Image Version. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery in which the Image Definition resides. -// galleryImageName - the name of the gallery Image Definition in which the Image Version is to be created. -// galleryImageVersionName - the name of the gallery Image Version to be created. Needs to follow semantic -// version name pattern: The allowed characters are digit and period. Digits must be within the range of a -// 32-bit integer. Format: .. -// galleryImageVersion - parameters supplied to the create or update gallery Image Version operation. -func (client GalleryImageVersionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersion) (result GalleryImageVersionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: galleryImageVersion, - Constraints: []validation.Constraint{{Target: "galleryImageVersion.GalleryImageVersionProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "galleryImageVersion.GalleryImageVersionProperties.StorageProfile", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("compute.GalleryImageVersionsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client GalleryImageVersionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersion) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryImageVersionName": autorest.Encode("path", galleryImageVersionName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", pathParameters), - autorest.WithJSON(galleryImageVersion), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryImageVersionsClient) CreateOrUpdateSender(req *http.Request) (future GalleryImageVersionsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client GalleryImageVersionsClient) CreateOrUpdateResponder(resp *http.Response) (result GalleryImageVersion, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a gallery Image Version. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery in which the Image Definition resides. -// galleryImageName - the name of the gallery Image Definition in which the Image Version resides. -// galleryImageVersionName - the name of the gallery Image Version to be deleted. -func (client GalleryImageVersionsClient) Delete(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string) (result GalleryImageVersionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client GalleryImageVersionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryImageVersionName": autorest.Encode("path", galleryImageVersionName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryImageVersionsClient) DeleteSender(req *http.Request) (future GalleryImageVersionsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client GalleryImageVersionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about a gallery Image Version. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery in which the Image Definition resides. -// galleryImageName - the name of the gallery Image Definition in which the Image Version resides. -// galleryImageVersionName - the name of the gallery Image Version to be retrieved. -// expand - the expand expression to apply on the operation. -func (client GalleryImageVersionsClient) Get(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, expand ReplicationStatusTypes) (result GalleryImageVersion, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client GalleryImageVersionsClient) GetPreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, expand ReplicationStatusTypes) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryImageVersionName": autorest.Encode("path", galleryImageVersionName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryImageVersionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client GalleryImageVersionsClient) GetResponder(resp *http.Response) (result GalleryImageVersion, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByGalleryImage list gallery Image Versions in a gallery Image Definition. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery in which the Image Definition resides. -// galleryImageName - the name of the Shared Image Gallery Image Definition from which the Image Versions are -// to be listed. -func (client GalleryImageVersionsClient) ListByGalleryImage(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (result GalleryImageVersionListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionsClient.ListByGalleryImage") - defer func() { - sc := -1 - if result.givl.Response.Response != nil { - sc = result.givl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByGalleryImageNextResults - req, err := client.ListByGalleryImagePreparer(ctx, resourceGroupName, galleryName, galleryImageName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "ListByGalleryImage", nil, "Failure preparing request") - return - } - - resp, err := client.ListByGalleryImageSender(req) - if err != nil { - result.givl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "ListByGalleryImage", resp, "Failure sending request") - return - } - - result.givl, err = client.ListByGalleryImageResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "ListByGalleryImage", resp, "Failure responding to request") - return - } - if result.givl.hasNextLink() && result.givl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByGalleryImagePreparer prepares the ListByGalleryImage request. -func (client GalleryImageVersionsClient) ListByGalleryImagePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByGalleryImageSender sends the ListByGalleryImage request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryImageVersionsClient) ListByGalleryImageSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByGalleryImageResponder handles the response to the ListByGalleryImage request. The method always -// closes the http.Response Body. -func (client GalleryImageVersionsClient) ListByGalleryImageResponder(resp *http.Response) (result GalleryImageVersionList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByGalleryImageNextResults retrieves the next set of results, if any. -func (client GalleryImageVersionsClient) listByGalleryImageNextResults(ctx context.Context, lastResults GalleryImageVersionList) (result GalleryImageVersionList, err error) { - req, err := lastResults.galleryImageVersionListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "listByGalleryImageNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByGalleryImageSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "listByGalleryImageNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByGalleryImageResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "listByGalleryImageNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByGalleryImageComplete enumerates all values, automatically crossing page boundaries as required. -func (client GalleryImageVersionsClient) ListByGalleryImageComplete(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string) (result GalleryImageVersionListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionsClient.ListByGalleryImage") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByGalleryImage(ctx, resourceGroupName, galleryName, galleryImageName) - return -} - -// Update update a gallery Image Version. -// Parameters: -// resourceGroupName - the name of the resource group. -// galleryName - the name of the Shared Image Gallery in which the Image Definition resides. -// galleryImageName - the name of the gallery Image Definition in which the Image Version is to be updated. -// galleryImageVersionName - the name of the gallery Image Version to be updated. Needs to follow semantic -// version name pattern: The allowed characters are digit and period. Digits must be within the range of a -// 32-bit integer. Format: .. -// galleryImageVersion - parameters supplied to the update gallery Image Version operation. -func (client GalleryImageVersionsClient) Update(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersionUpdate) (result GalleryImageVersionsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, galleryName, galleryImageName, galleryImageVersionName, galleryImageVersion) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client GalleryImageVersionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, galleryName string, galleryImageName string, galleryImageVersionName string, galleryImageVersion GalleryImageVersionUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "galleryImageName": autorest.Encode("path", galleryImageName), - "galleryImageVersionName": autorest.Encode("path", galleryImageVersionName), - "galleryName": autorest.Encode("path", galleryName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/galleries/{galleryName}/images/{galleryImageName}/versions/{galleryImageVersionName}", pathParameters), - autorest.WithJSON(galleryImageVersion), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client GalleryImageVersionsClient) UpdateSender(req *http.Request) (future GalleryImageVersionsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client GalleryImageVersionsClient) UpdateResponder(resp *http.Response) (result GalleryImageVersion, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/images.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/images.go deleted file mode 100644 index 78493c73df0b..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/images.go +++ /dev/null @@ -1,583 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ImagesClient is the compute Client -type ImagesClient struct { - BaseClient -} - -// NewImagesClient creates an instance of the ImagesClient client. -func NewImagesClient(subscriptionID string) ImagesClient { - return NewImagesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewImagesClientWithBaseURI creates an instance of the ImagesClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewImagesClientWithBaseURI(baseURI string, subscriptionID string) ImagesClient { - return ImagesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update an image. -// Parameters: -// resourceGroupName - the name of the resource group. -// imageName - the name of the image. -// parameters - parameters supplied to the Create Image operation. -func (client ImagesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, imageName string, parameters Image) (result ImagesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, imageName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ImagesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, imageName string, parameters Image) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "imageName": autorest.Encode("path", imageName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ImagesClient) CreateOrUpdateSender(req *http.Request) (future ImagesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ImagesClient) CreateOrUpdateResponder(resp *http.Response) (result Image, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes an Image. -// Parameters: -// resourceGroupName - the name of the resource group. -// imageName - the name of the image. -func (client ImagesClient) Delete(ctx context.Context, resourceGroupName string, imageName string) (result ImagesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, imageName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ImagesClient) DeletePreparer(ctx context.Context, resourceGroupName string, imageName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "imageName": autorest.Encode("path", imageName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ImagesClient) DeleteSender(req *http.Request) (future ImagesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ImagesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets an image. -// Parameters: -// resourceGroupName - the name of the resource group. -// imageName - the name of the image. -// expand - the expand expression to apply on the operation. -func (client ImagesClient) Get(ctx context.Context, resourceGroupName string, imageName string, expand string) (result Image, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, imageName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ImagesClient) GetPreparer(ctx context.Context, resourceGroupName string, imageName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "imageName": autorest.Encode("path", imageName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ImagesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ImagesClient) GetResponder(resp *http.Response) (result Image, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets the list of Images in the subscription. Use nextLink property in the response to get the next page of -// Images. Do this till nextLink is null to fetch all the Images. -func (client ImagesClient) List(ctx context.Context) (result ImageListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.List") - defer func() { - sc := -1 - if result.ilr.Response.Response != nil { - sc = result.ilr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.ilr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "List", resp, "Failure sending request") - return - } - - result.ilr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "List", resp, "Failure responding to request") - return - } - if result.ilr.hasNextLink() && result.ilr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ImagesClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/images", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ImagesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ImagesClient) ListResponder(resp *http.Response) (result ImageListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ImagesClient) listNextResults(ctx context.Context, lastResults ImageListResult) (result ImageListResult, err error) { - req, err := lastResults.imageListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.ImagesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.ImagesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ImagesClient) ListComplete(ctx context.Context) (result ImageListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup gets the list of images under a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client ImagesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ImageListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.ilr.Response.Response != nil { - sc = result.ilr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.ilr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.ilr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.ilr.hasNextLink() && result.ilr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client ImagesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client ImagesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client ImagesClient) ListByResourceGroupResponder(resp *http.Response) (result ImageListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client ImagesClient) listByResourceGroupNextResults(ctx context.Context, lastResults ImageListResult) (result ImageListResult, err error) { - req, err := lastResults.imageListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.ImagesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.ImagesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client ImagesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ImageListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// Update update an image. -// Parameters: -// resourceGroupName - the name of the resource group. -// imageName - the name of the image. -// parameters - parameters supplied to the Update Image operation. -func (client ImagesClient) Update(ctx context.Context, resourceGroupName string, imageName string, parameters ImageUpdate) (result ImagesUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, imageName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client ImagesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, imageName string, parameters ImageUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "imageName": autorest.Encode("path", imageName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client ImagesClient) UpdateSender(req *http.Request) (future ImagesUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client ImagesClient) UpdateResponder(resp *http.Response) (result Image, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/loganalytics.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/loganalytics.go deleted file mode 100644 index b99535238f47..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/loganalytics.go +++ /dev/null @@ -1,206 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// LogAnalyticsClient is the compute Client -type LogAnalyticsClient struct { - BaseClient -} - -// NewLogAnalyticsClient creates an instance of the LogAnalyticsClient client. -func NewLogAnalyticsClient(subscriptionID string) LogAnalyticsClient { - return NewLogAnalyticsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewLogAnalyticsClientWithBaseURI creates an instance of the LogAnalyticsClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewLogAnalyticsClientWithBaseURI(baseURI string, subscriptionID string) LogAnalyticsClient { - return LogAnalyticsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// ExportRequestRateByInterval export logs that show Api requests made by this subscription in the given time window to -// show throttling activities. -// Parameters: -// parameters - parameters supplied to the LogAnalytics getRequestRateByInterval Api. -// location - the location upon which virtual-machine-sizes is queried. -func (client LogAnalyticsClient) ExportRequestRateByInterval(ctx context.Context, parameters RequestRateByIntervalInput, location string) (result LogAnalyticsExportRequestRateByIntervalFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LogAnalyticsClient.ExportRequestRateByInterval") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: location, - Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.LogAnalyticsClient", "ExportRequestRateByInterval", err.Error()) - } - - req, err := client.ExportRequestRateByIntervalPreparer(ctx, parameters, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsClient", "ExportRequestRateByInterval", nil, "Failure preparing request") - return - } - - result, err = client.ExportRequestRateByIntervalSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsClient", "ExportRequestRateByInterval", result.Response(), "Failure sending request") - return - } - - return -} - -// ExportRequestRateByIntervalPreparer prepares the ExportRequestRateByInterval request. -func (client LogAnalyticsClient) ExportRequestRateByIntervalPreparer(ctx context.Context, parameters RequestRateByIntervalInput, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getRequestRateByInterval", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ExportRequestRateByIntervalSender sends the ExportRequestRateByInterval request. The method will close the -// http.Response Body if it receives an error. -func (client LogAnalyticsClient) ExportRequestRateByIntervalSender(req *http.Request) (future LogAnalyticsExportRequestRateByIntervalFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ExportRequestRateByIntervalResponder handles the response to the ExportRequestRateByInterval request. The method always -// closes the http.Response Body. -func (client LogAnalyticsClient) ExportRequestRateByIntervalResponder(resp *http.Response) (result LogAnalyticsOperationResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ExportThrottledRequests export logs that show total throttled Api requests for this subscription in the given time -// window. -// Parameters: -// parameters - parameters supplied to the LogAnalytics getThrottledRequests Api. -// location - the location upon which virtual-machine-sizes is queried. -func (client LogAnalyticsClient) ExportThrottledRequests(ctx context.Context, parameters ThrottledRequestsInput, location string) (result LogAnalyticsExportThrottledRequestsFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LogAnalyticsClient.ExportThrottledRequests") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: location, - Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.LogAnalyticsClient", "ExportThrottledRequests", err.Error()) - } - - req, err := client.ExportThrottledRequestsPreparer(ctx, parameters, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsClient", "ExportThrottledRequests", nil, "Failure preparing request") - return - } - - result, err = client.ExportThrottledRequestsSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsClient", "ExportThrottledRequests", result.Response(), "Failure sending request") - return - } - - return -} - -// ExportThrottledRequestsPreparer prepares the ExportThrottledRequests request. -func (client LogAnalyticsClient) ExportThrottledRequestsPreparer(ctx context.Context, parameters ThrottledRequestsInput, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getThrottledRequests", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ExportThrottledRequestsSender sends the ExportThrottledRequests request. The method will close the -// http.Response Body if it receives an error. -func (client LogAnalyticsClient) ExportThrottledRequestsSender(req *http.Request) (future LogAnalyticsExportThrottledRequestsFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ExportThrottledRequestsResponder handles the response to the ExportThrottledRequests request. The method always -// closes the http.Response Body. -func (client LogAnalyticsClient) ExportThrottledRequestsResponder(resp *http.Response) (result LogAnalyticsOperationResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/models.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/models.go deleted file mode 100644 index 22e9a488220b..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/models.go +++ /dev/null @@ -1,14840 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "encoding/json" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/date" - "github.com/Azure/go-autorest/autorest/to" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute" - -// AccessURI a disk access SAS uri. -type AccessURI struct { - autorest.Response `json:"-"` - // AccessSAS - READ-ONLY; A SAS uri for accessing a disk. - AccessSAS *string `json:"accessSAS,omitempty"` -} - -// MarshalJSON is the custom marshaler for AccessURI. -func (au AccessURI) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// AdditionalCapabilities enables or disables a capability on the virtual machine or virtual machine scale -// set. -type AdditionalCapabilities struct { - // UltraSSDEnabled - The flag that enables or disables a capability to have one or more managed data disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed disks with storage account type UltraSSD_LRS can be added to a virtual machine or virtual machine scale set only if this property is enabled. - UltraSSDEnabled *bool `json:"ultraSSDEnabled,omitempty"` -} - -// AdditionalUnattendContent specifies additional XML formatted information that can be included in the -// Unattend.xml file, which is used by Windows Setup. Contents are defined by setting name, component name, -// and the pass in which the content is applied. -type AdditionalUnattendContent struct { - // PassName - The pass name. Currently, the only allowable value is OobeSystem. Possible values include: 'OobeSystem' - PassName PassNames `json:"passName,omitempty"` - // ComponentName - The component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup. Possible values include: 'MicrosoftWindowsShellSetup' - ComponentName ComponentNames `json:"componentName,omitempty"` - // SettingName - Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon. Possible values include: 'AutoLogon', 'FirstLogonCommands' - SettingName SettingNames `json:"settingName,omitempty"` - // Content - Specifies the XML formatted content that is added to the unattend.xml file for the specified path and component. The XML must be less than 4KB and must include the root element for the setting or feature that is being inserted. - Content *string `json:"content,omitempty"` -} - -// APIEntityReference the API entity reference. -type APIEntityReference struct { - // ID - The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... - ID *string `json:"id,omitempty"` -} - -// APIError api error. -type APIError struct { - // Details - The Api error details - Details *[]APIErrorBase `json:"details,omitempty"` - // Innererror - The Api inner error - Innererror *InnerError `json:"innererror,omitempty"` - // Code - The error code. - Code *string `json:"code,omitempty"` - // Target - The target of the particular error. - Target *string `json:"target,omitempty"` - // Message - The error message. - Message *string `json:"message,omitempty"` -} - -// APIErrorBase api error base. -type APIErrorBase struct { - // Code - The error code. - Code *string `json:"code,omitempty"` - // Target - The target of the particular error. - Target *string `json:"target,omitempty"` - // Message - The error message. - Message *string `json:"message,omitempty"` -} - -// AutomaticOSUpgradePolicy the configuration parameters used for performing automatic OS upgrade. -type AutomaticOSUpgradePolicy struct { - // EnableAutomaticOSUpgrade - Indicates whether OS upgrades should automatically be applied to scale set instances in a rolling fashion when a newer version of the OS image becomes available. Default value is false.

If this is set to true for Windows based scale sets, [enableAutomaticUpdates](https://docs.microsoft.com/dotnet/api/microsoft.azure.management.compute.models.windowsconfiguration.enableautomaticupdates?view=azure-dotnet) is automatically set to false and cannot be set to true. - EnableAutomaticOSUpgrade *bool `json:"enableAutomaticOSUpgrade,omitempty"` - // DisableAutomaticRollback - Whether OS image rollback feature should be disabled. Default value is false. - DisableAutomaticRollback *bool `json:"disableAutomaticRollback,omitempty"` -} - -// AutomaticOSUpgradeProperties describes automatic OS upgrade properties on the image. -type AutomaticOSUpgradeProperties struct { - // AutomaticOSUpgradeSupported - Specifies whether automatic OS upgrade is supported on the image. - AutomaticOSUpgradeSupported *bool `json:"automaticOSUpgradeSupported,omitempty"` -} - -// AutomaticRepairsPolicy specifies the configuration parameters for automatic repairs on the virtual -// machine scale set. -type AutomaticRepairsPolicy struct { - // Enabled - Specifies whether automatic repairs should be enabled on the virtual machine scale set. The default value is false. - Enabled *bool `json:"enabled,omitempty"` - // GracePeriod - The amount of time for which automatic repairs are suspended due to a state change on VM. The grace time starts after the state change has completed. This helps avoid premature or accidental repairs. The time duration should be specified in ISO 8601 format. The minimum allowed grace period is 30 minutes (PT30M), which is also the default value. The maximum allowed grace period is 90 minutes (PT90M). - GracePeriod *string `json:"gracePeriod,omitempty"` -} - -// AvailabilitySet specifies information about the availability set that the virtual machine should be -// assigned to. Virtual machines specified in the same availability set are allocated to different nodes to -// maximize availability. For more information about availability sets, see [Manage the availability of -// virtual -// machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). -//

For more information on Azure planned maintenance, see [Planned maintenance for virtual -// machines in -// Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) -//

Currently, a VM can only be added to availability set at creation time. An existing VM cannot -// be added to an availability set. -type AvailabilitySet struct { - autorest.Response `json:"-"` - *AvailabilitySetProperties `json:"properties,omitempty"` - // Sku - Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes for possible set of values. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'. - Sku *Sku `json:"sku,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for AvailabilitySet. -func (as AvailabilitySet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if as.AvailabilitySetProperties != nil { - objectMap["properties"] = as.AvailabilitySetProperties - } - if as.Sku != nil { - objectMap["sku"] = as.Sku - } - if as.Location != nil { - objectMap["location"] = as.Location - } - if as.Tags != nil { - objectMap["tags"] = as.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for AvailabilitySet struct. -func (as *AvailabilitySet) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var availabilitySetProperties AvailabilitySetProperties - err = json.Unmarshal(*v, &availabilitySetProperties) - if err != nil { - return err - } - as.AvailabilitySetProperties = &availabilitySetProperties - } - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - as.Sku = &sku - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - as.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - as.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - as.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - as.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - as.Tags = tags - } - } - } - - return nil -} - -// AvailabilitySetListResult the List Availability Set operation response. -type AvailabilitySetListResult struct { - autorest.Response `json:"-"` - // Value - The list of availability sets - Value *[]AvailabilitySet `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to fetch the next page of AvailabilitySets. - NextLink *string `json:"nextLink,omitempty"` -} - -// AvailabilitySetListResultIterator provides access to a complete listing of AvailabilitySet values. -type AvailabilitySetListResultIterator struct { - i int - page AvailabilitySetListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *AvailabilitySetListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *AvailabilitySetListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AvailabilitySetListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter AvailabilitySetListResultIterator) Response() AvailabilitySetListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter AvailabilitySetListResultIterator) Value() AvailabilitySet { - if !iter.page.NotDone() { - return AvailabilitySet{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the AvailabilitySetListResultIterator type. -func NewAvailabilitySetListResultIterator(page AvailabilitySetListResultPage) AvailabilitySetListResultIterator { - return AvailabilitySetListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (aslr AvailabilitySetListResult) IsEmpty() bool { - return aslr.Value == nil || len(*aslr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (aslr AvailabilitySetListResult) hasNextLink() bool { - return aslr.NextLink != nil && len(*aslr.NextLink) != 0 -} - -// availabilitySetListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (aslr AvailabilitySetListResult) availabilitySetListResultPreparer(ctx context.Context) (*http.Request, error) { - if !aslr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(aslr.NextLink))) -} - -// AvailabilitySetListResultPage contains a page of AvailabilitySet values. -type AvailabilitySetListResultPage struct { - fn func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error) - aslr AvailabilitySetListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *AvailabilitySetListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.aslr) - if err != nil { - return err - } - page.aslr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *AvailabilitySetListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AvailabilitySetListResultPage) NotDone() bool { - return !page.aslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AvailabilitySetListResultPage) Response() AvailabilitySetListResult { - return page.aslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AvailabilitySetListResultPage) Values() []AvailabilitySet { - if page.aslr.IsEmpty() { - return nil - } - return *page.aslr.Value -} - -// Creates a new instance of the AvailabilitySetListResultPage type. -func NewAvailabilitySetListResultPage(cur AvailabilitySetListResult, getNextPage func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error)) AvailabilitySetListResultPage { - return AvailabilitySetListResultPage{ - fn: getNextPage, - aslr: cur, - } -} - -// AvailabilitySetProperties the instance view of a resource. -type AvailabilitySetProperties struct { - // PlatformUpdateDomainCount - Update Domain count. - PlatformUpdateDomainCount *int32 `json:"platformUpdateDomainCount,omitempty"` - // PlatformFaultDomainCount - Fault Domain count. - PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` - // VirtualMachines - A list of references to all virtual machines in the availability set. - VirtualMachines *[]SubResource `json:"virtualMachines,omitempty"` - // ProximityPlacementGroup - Specifies information about the proximity placement group that the availability set should be assigned to.

Minimum api-version: 2018-04-01. - ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` - // Statuses - READ-ONLY; The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` -} - -// MarshalJSON is the custom marshaler for AvailabilitySetProperties. -func (asp AvailabilitySetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if asp.PlatformUpdateDomainCount != nil { - objectMap["platformUpdateDomainCount"] = asp.PlatformUpdateDomainCount - } - if asp.PlatformFaultDomainCount != nil { - objectMap["platformFaultDomainCount"] = asp.PlatformFaultDomainCount - } - if asp.VirtualMachines != nil { - objectMap["virtualMachines"] = asp.VirtualMachines - } - if asp.ProximityPlacementGroup != nil { - objectMap["proximityPlacementGroup"] = asp.ProximityPlacementGroup - } - return json.Marshal(objectMap) -} - -// AvailabilitySetUpdate specifies information about the availability set that the virtual machine should -// be assigned to. Only tags may be updated. -type AvailabilitySetUpdate struct { - *AvailabilitySetProperties `json:"properties,omitempty"` - // Sku - Sku of the availability set - Sku *Sku `json:"sku,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for AvailabilitySetUpdate. -func (asu AvailabilitySetUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if asu.AvailabilitySetProperties != nil { - objectMap["properties"] = asu.AvailabilitySetProperties - } - if asu.Sku != nil { - objectMap["sku"] = asu.Sku - } - if asu.Tags != nil { - objectMap["tags"] = asu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for AvailabilitySetUpdate struct. -func (asu *AvailabilitySetUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var availabilitySetProperties AvailabilitySetProperties - err = json.Unmarshal(*v, &availabilitySetProperties) - if err != nil { - return err - } - asu.AvailabilitySetProperties = &availabilitySetProperties - } - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - asu.Sku = &sku - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - asu.Tags = tags - } - } - } - - return nil -} - -// BillingProfile specifies the billing related details of a Azure Spot VM or VMSS.

Minimum -// api-version: 2019-03-01. -type BillingProfile struct { - // MaxPrice - Specifies the maximum price you are willing to pay for a Azure Spot VM/VMSS. This price is in US Dollars.

This price will be compared with the current Azure Spot price for the VM size. Also, the prices are compared at the time of create/update of Azure Spot VM/VMSS and the operation will only succeed if the maxPrice is greater than the current Azure Spot price.

The maxPrice will also be used for evicting a Azure Spot VM/VMSS if the current Azure Spot price goes beyond the maxPrice after creation of VM/VMSS.

Possible values are:

- Any decimal value greater than zero. Example: 0.01538

-1 – indicates default price to be up-to on-demand.

You can set the maxPrice to -1 to indicate that the Azure Spot VM/VMSS should not be evicted for price reasons. Also, the default max price is -1 if it is not provided by you.

Minimum api-version: 2019-03-01. - MaxPrice *float64 `json:"maxPrice,omitempty"` -} - -// BootDiagnostics boot Diagnostics is a debugging feature which allows you to view Console Output and -// Screenshot to diagnose VM status.

You can easily view the output of your console log.

-// Azure also enables you to see a screenshot of the VM from the hypervisor. -type BootDiagnostics struct { - // Enabled - Whether boot diagnostics should be enabled on the Virtual Machine. - Enabled *bool `json:"enabled,omitempty"` - // StorageURI - Uri of the storage account to use for placing the console output and screenshot. - StorageURI *string `json:"storageUri,omitempty"` -} - -// BootDiagnosticsInstanceView the instance view of a virtual machine boot diagnostics. -type BootDiagnosticsInstanceView struct { - // ConsoleScreenshotBlobURI - READ-ONLY; The console screenshot blob URI. - ConsoleScreenshotBlobURI *string `json:"consoleScreenshotBlobUri,omitempty"` - // SerialConsoleLogBlobURI - READ-ONLY; The Linux serial console log blob Uri. - SerialConsoleLogBlobURI *string `json:"serialConsoleLogBlobUri,omitempty"` - // Status - READ-ONLY; The boot diagnostics status information for the VM.

NOTE: It will be set only if there are errors encountered in enabling boot diagnostics. - Status *InstanceViewStatus `json:"status,omitempty"` -} - -// MarshalJSON is the custom marshaler for BootDiagnosticsInstanceView. -func (bdiv BootDiagnosticsInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// CloudError an error response from the Compute service. -type CloudError struct { - Error *APIError `json:"error,omitempty"` -} - -// ContainerService container service. -type ContainerService struct { - autorest.Response `json:"-"` - *ContainerServiceProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ContainerService. -func (cs ContainerService) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cs.ContainerServiceProperties != nil { - objectMap["properties"] = cs.ContainerServiceProperties - } - if cs.Location != nil { - objectMap["location"] = cs.Location - } - if cs.Tags != nil { - objectMap["tags"] = cs.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ContainerService struct. -func (cs *ContainerService) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var containerServiceProperties ContainerServiceProperties - err = json.Unmarshal(*v, &containerServiceProperties) - if err != nil { - return err - } - cs.ContainerServiceProperties = &containerServiceProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - cs.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - cs.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - cs.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - cs.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - cs.Tags = tags - } - } - } - - return nil -} - -// ContainerServiceAgentPoolProfile profile for the container service agent pool. -type ContainerServiceAgentPoolProfile struct { - // Name - Unique name of the agent pool profile in the context of the subscription and resource group. - Name *string `json:"name,omitempty"` - // Count - Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. - Count *int32 `json:"count,omitempty"` - // VMSize - Size of agent VMs. Possible values include: 'StandardA0', 'StandardA1', 'StandardA2', 'StandardA3', 'StandardA4', 'StandardA5', 'StandardA6', 'StandardA7', 'StandardA8', 'StandardA9', 'StandardA10', 'StandardA11', 'StandardD1', 'StandardD2', 'StandardD3', 'StandardD4', 'StandardD11', 'StandardD12', 'StandardD13', 'StandardD14', 'StandardD1V2', 'StandardD2V2', 'StandardD3V2', 'StandardD4V2', 'StandardD5V2', 'StandardD11V2', 'StandardD12V2', 'StandardD13V2', 'StandardD14V2', 'StandardG1', 'StandardG2', 'StandardG3', 'StandardG4', 'StandardG5', 'StandardDS1', 'StandardDS2', 'StandardDS3', 'StandardDS4', 'StandardDS11', 'StandardDS12', 'StandardDS13', 'StandardDS14', 'StandardGS1', 'StandardGS2', 'StandardGS3', 'StandardGS4', 'StandardGS5' - VMSize ContainerServiceVMSizeTypes `json:"vmSize,omitempty"` - // DNSPrefix - DNS prefix to be used to create the FQDN for the agent pool. - DNSPrefix *string `json:"dnsPrefix,omitempty"` - // Fqdn - READ-ONLY; FQDN for the agent pool. - Fqdn *string `json:"fqdn,omitempty"` -} - -// MarshalJSON is the custom marshaler for ContainerServiceAgentPoolProfile. -func (csapp ContainerServiceAgentPoolProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if csapp.Name != nil { - objectMap["name"] = csapp.Name - } - if csapp.Count != nil { - objectMap["count"] = csapp.Count - } - if csapp.VMSize != "" { - objectMap["vmSize"] = csapp.VMSize - } - if csapp.DNSPrefix != nil { - objectMap["dnsPrefix"] = csapp.DNSPrefix - } - return json.Marshal(objectMap) -} - -// ContainerServiceCustomProfile properties to configure a custom container service cluster. -type ContainerServiceCustomProfile struct { - // Orchestrator - The name of the custom orchestrator to use. - Orchestrator *string `json:"orchestrator,omitempty"` -} - -// ContainerServiceDiagnosticsProfile ... -type ContainerServiceDiagnosticsProfile struct { - // VMDiagnostics - Profile for the container service VM diagnostic agent. - VMDiagnostics *ContainerServiceVMDiagnostics `json:"vmDiagnostics,omitempty"` -} - -// ContainerServiceLinuxProfile profile for Linux VMs in the container service cluster. -type ContainerServiceLinuxProfile struct { - // AdminUsername - The administrator username to use for Linux VMs. - AdminUsername *string `json:"adminUsername,omitempty"` - // SSH - The ssh key configuration for Linux VMs. - SSH *ContainerServiceSSHConfiguration `json:"ssh,omitempty"` -} - -// ContainerServiceListResult the response from the List Container Services operation. -type ContainerServiceListResult struct { - autorest.Response `json:"-"` - // Value - the list of container services. - Value *[]ContainerService `json:"value,omitempty"` - // NextLink - The URL to get the next set of container service results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ContainerServiceListResultIterator provides access to a complete listing of ContainerService values. -type ContainerServiceListResultIterator struct { - i int - page ContainerServiceListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ContainerServiceListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServiceListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ContainerServiceListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ContainerServiceListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ContainerServiceListResultIterator) Response() ContainerServiceListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ContainerServiceListResultIterator) Value() ContainerService { - if !iter.page.NotDone() { - return ContainerService{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ContainerServiceListResultIterator type. -func NewContainerServiceListResultIterator(page ContainerServiceListResultPage) ContainerServiceListResultIterator { - return ContainerServiceListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (cslr ContainerServiceListResult) IsEmpty() bool { - return cslr.Value == nil || len(*cslr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (cslr ContainerServiceListResult) hasNextLink() bool { - return cslr.NextLink != nil && len(*cslr.NextLink) != 0 -} - -// containerServiceListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cslr ContainerServiceListResult) containerServiceListResultPreparer(ctx context.Context) (*http.Request, error) { - if !cslr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cslr.NextLink))) -} - -// ContainerServiceListResultPage contains a page of ContainerService values. -type ContainerServiceListResultPage struct { - fn func(context.Context, ContainerServiceListResult) (ContainerServiceListResult, error) - cslr ContainerServiceListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ContainerServiceListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServiceListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.cslr) - if err != nil { - return err - } - page.cslr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ContainerServiceListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ContainerServiceListResultPage) NotDone() bool { - return !page.cslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ContainerServiceListResultPage) Response() ContainerServiceListResult { - return page.cslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ContainerServiceListResultPage) Values() []ContainerService { - if page.cslr.IsEmpty() { - return nil - } - return *page.cslr.Value -} - -// Creates a new instance of the ContainerServiceListResultPage type. -func NewContainerServiceListResultPage(cur ContainerServiceListResult, getNextPage func(context.Context, ContainerServiceListResult) (ContainerServiceListResult, error)) ContainerServiceListResultPage { - return ContainerServiceListResultPage{ - fn: getNextPage, - cslr: cur, - } -} - -// ContainerServiceMasterProfile profile for the container service master. -type ContainerServiceMasterProfile struct { - // Count - Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. - Count *int32 `json:"count,omitempty"` - // DNSPrefix - DNS prefix to be used to create the FQDN for master. - DNSPrefix *string `json:"dnsPrefix,omitempty"` - // Fqdn - READ-ONLY; FQDN for the master. - Fqdn *string `json:"fqdn,omitempty"` -} - -// MarshalJSON is the custom marshaler for ContainerServiceMasterProfile. -func (csmp ContainerServiceMasterProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if csmp.Count != nil { - objectMap["count"] = csmp.Count - } - if csmp.DNSPrefix != nil { - objectMap["dnsPrefix"] = csmp.DNSPrefix - } - return json.Marshal(objectMap) -} - -// ContainerServiceOrchestratorProfile profile for the container service orchestrator. -type ContainerServiceOrchestratorProfile struct { - // OrchestratorType - The orchestrator to use to manage container service cluster resources. Valid values are Swarm, DCOS, and Custom. Possible values include: 'Swarm', 'DCOS', 'Custom', 'Kubernetes' - OrchestratorType ContainerServiceOrchestratorTypes `json:"orchestratorType,omitempty"` -} - -// ContainerServiceProperties properties of the container service. -type ContainerServiceProperties struct { - // ProvisioningState - READ-ONLY; the current deployment or provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // OrchestratorProfile - Properties of the orchestrator. - OrchestratorProfile *ContainerServiceOrchestratorProfile `json:"orchestratorProfile,omitempty"` - // CustomProfile - Properties for custom clusters. - CustomProfile *ContainerServiceCustomProfile `json:"customProfile,omitempty"` - // ServicePrincipalProfile - Properties for cluster service principals. - ServicePrincipalProfile *ContainerServiceServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"` - // MasterProfile - Properties of master agents. - MasterProfile *ContainerServiceMasterProfile `json:"masterProfile,omitempty"` - // AgentPoolProfiles - Properties of the agent pool. - AgentPoolProfiles *[]ContainerServiceAgentPoolProfile `json:"agentPoolProfiles,omitempty"` - // WindowsProfile - Properties of Windows VMs. - WindowsProfile *ContainerServiceWindowsProfile `json:"windowsProfile,omitempty"` - // LinuxProfile - Properties of Linux VMs. - LinuxProfile *ContainerServiceLinuxProfile `json:"linuxProfile,omitempty"` - // DiagnosticsProfile - Properties of the diagnostic agent. - DiagnosticsProfile *ContainerServiceDiagnosticsProfile `json:"diagnosticsProfile,omitempty"` -} - -// MarshalJSON is the custom marshaler for ContainerServiceProperties. -func (csp ContainerServiceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if csp.OrchestratorProfile != nil { - objectMap["orchestratorProfile"] = csp.OrchestratorProfile - } - if csp.CustomProfile != nil { - objectMap["customProfile"] = csp.CustomProfile - } - if csp.ServicePrincipalProfile != nil { - objectMap["servicePrincipalProfile"] = csp.ServicePrincipalProfile - } - if csp.MasterProfile != nil { - objectMap["masterProfile"] = csp.MasterProfile - } - if csp.AgentPoolProfiles != nil { - objectMap["agentPoolProfiles"] = csp.AgentPoolProfiles - } - if csp.WindowsProfile != nil { - objectMap["windowsProfile"] = csp.WindowsProfile - } - if csp.LinuxProfile != nil { - objectMap["linuxProfile"] = csp.LinuxProfile - } - if csp.DiagnosticsProfile != nil { - objectMap["diagnosticsProfile"] = csp.DiagnosticsProfile - } - return json.Marshal(objectMap) -} - -// ContainerServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type ContainerServicesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ContainerServicesClient) (ContainerService, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ContainerServicesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ContainerServicesCreateOrUpdateFuture.Result. -func (future *ContainerServicesCreateOrUpdateFuture) result(client ContainerServicesClient) (cs ContainerService, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ContainerServicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - cs.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.ContainerServicesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if cs.Response.Response, err = future.GetResult(sender); err == nil && cs.Response.Response.StatusCode != http.StatusNoContent { - cs, err = client.CreateOrUpdateResponder(cs.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ContainerServicesCreateOrUpdateFuture", "Result", cs.Response.Response, "Failure responding to request") - } - } - return -} - -// ContainerServicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ContainerServicesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ContainerServicesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ContainerServicesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ContainerServicesDeleteFuture.Result. -func (future *ContainerServicesDeleteFuture) result(client ContainerServicesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ContainerServicesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.ContainerServicesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ContainerServiceServicePrincipalProfile information about a service principal identity for the cluster -// to use for manipulating Azure APIs. -type ContainerServiceServicePrincipalProfile struct { - // ClientID - The ID for the service principal. - ClientID *string `json:"clientId,omitempty"` - // Secret - The secret password associated with the service principal. - Secret *string `json:"secret,omitempty"` -} - -// ContainerServiceSSHConfiguration SSH configuration for Linux-based VMs running on Azure. -type ContainerServiceSSHConfiguration struct { - // PublicKeys - the list of SSH public keys used to authenticate with Linux-based VMs. - PublicKeys *[]ContainerServiceSSHPublicKey `json:"publicKeys,omitempty"` -} - -// ContainerServiceSSHPublicKey contains information about SSH certificate public key data. -type ContainerServiceSSHPublicKey struct { - // KeyData - Certificate public key used to authenticate with VMs through SSH. The certificate must be in PEM format with or without headers. - KeyData *string `json:"keyData,omitempty"` -} - -// ContainerServiceVMDiagnostics profile for diagnostics on the container service VMs. -type ContainerServiceVMDiagnostics struct { - // Enabled - Whether the VM diagnostic agent is provisioned on the VM. - Enabled *bool `json:"enabled,omitempty"` - // StorageURI - READ-ONLY; The URI of the storage account where diagnostics are stored. - StorageURI *string `json:"storageUri,omitempty"` -} - -// MarshalJSON is the custom marshaler for ContainerServiceVMDiagnostics. -func (csvd ContainerServiceVMDiagnostics) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if csvd.Enabled != nil { - objectMap["enabled"] = csvd.Enabled - } - return json.Marshal(objectMap) -} - -// ContainerServiceWindowsProfile profile for Windows VMs in the container service cluster. -type ContainerServiceWindowsProfile struct { - // AdminUsername - The administrator username to use for Windows VMs. - AdminUsername *string `json:"adminUsername,omitempty"` - // AdminPassword - The administrator password to use for Windows VMs. - AdminPassword *string `json:"adminPassword,omitempty"` -} - -// CreationData data used when creating a disk. -type CreationData struct { - // CreateOption - This enumerates the possible sources of a disk's creation. Possible values include: 'Empty', 'Attach', 'FromImage', 'Import', 'Copy', 'Restore', 'Upload' - CreateOption DiskCreateOption `json:"createOption,omitempty"` - // StorageAccountID - Required if createOption is Import. The Azure Resource Manager identifier of the storage account containing the blob to import as a disk. - StorageAccountID *string `json:"storageAccountId,omitempty"` - // ImageReference - Disk source information. - ImageReference *ImageDiskReference `json:"imageReference,omitempty"` - // SourceURI - If createOption is Import, this is the URI of a blob to be imported into a managed disk. - SourceURI *string `json:"sourceUri,omitempty"` - // SourceResourceID - If createOption is Copy, this is the ARM id of the source snapshot or disk. - SourceResourceID *string `json:"sourceResourceId,omitempty"` - // SourceUniqueID - READ-ONLY; If this field is set, this is the unique id identifying the source of this resource. - SourceUniqueID *string `json:"sourceUniqueId,omitempty"` - // UploadSizeBytes - If createOption is Upload, this is the size of the contents of the upload including the VHD footer. This value should be between 20972032 (20 MiB + 512 bytes for the VHD footer) and 35183298347520 bytes (32 TiB + 512 bytes for the VHD footer). - UploadSizeBytes *int64 `json:"uploadSizeBytes,omitempty"` -} - -// MarshalJSON is the custom marshaler for CreationData. -func (cd CreationData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cd.CreateOption != "" { - objectMap["createOption"] = cd.CreateOption - } - if cd.StorageAccountID != nil { - objectMap["storageAccountId"] = cd.StorageAccountID - } - if cd.ImageReference != nil { - objectMap["imageReference"] = cd.ImageReference - } - if cd.SourceURI != nil { - objectMap["sourceUri"] = cd.SourceURI - } - if cd.SourceResourceID != nil { - objectMap["sourceResourceId"] = cd.SourceResourceID - } - if cd.UploadSizeBytes != nil { - objectMap["uploadSizeBytes"] = cd.UploadSizeBytes - } - return json.Marshal(objectMap) -} - -// DataDisk describes a data disk. -type DataDisk struct { - // Lun - Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. - Lun *int32 `json:"lun,omitempty"` - // Name - The disk name. - Name *string `json:"name,omitempty"` - // Vhd - The virtual hard disk. - Vhd *VirtualHardDisk `json:"vhd,omitempty"` - // Image - The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist. - Image *VirtualHardDisk `json:"image,omitempty"` - // Caching - Specifies the caching requirements.

Possible values are:

**None**

**ReadOnly**

**ReadWrite**

Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` - // CreateOption - Specifies how the virtual machine should be created.

Possible values are:

**Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.

**FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' - CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` - // DiskSizeGB - Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.

This value cannot be larger than 1023 GB - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // ManagedDisk - The managed disk parameters. - ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` - // ToBeDetached - Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset - ToBeDetached *bool `json:"toBeDetached,omitempty"` - // DiskIOPSReadWrite - READ-ONLY; Specifies the Read-Write IOPS for the managed disk when StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. Can be updated only via updates to the VirtualMachine Scale Set. - DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` - // DiskMBpsReadWrite - READ-ONLY; Specifies the bandwidth in MB per second for the managed disk when StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. Can be updated only via updates to the VirtualMachine Scale Set. - DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` -} - -// MarshalJSON is the custom marshaler for DataDisk. -func (dd DataDisk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dd.Lun != nil { - objectMap["lun"] = dd.Lun - } - if dd.Name != nil { - objectMap["name"] = dd.Name - } - if dd.Vhd != nil { - objectMap["vhd"] = dd.Vhd - } - if dd.Image != nil { - objectMap["image"] = dd.Image - } - if dd.Caching != "" { - objectMap["caching"] = dd.Caching - } - if dd.WriteAcceleratorEnabled != nil { - objectMap["writeAcceleratorEnabled"] = dd.WriteAcceleratorEnabled - } - if dd.CreateOption != "" { - objectMap["createOption"] = dd.CreateOption - } - if dd.DiskSizeGB != nil { - objectMap["diskSizeGB"] = dd.DiskSizeGB - } - if dd.ManagedDisk != nil { - objectMap["managedDisk"] = dd.ManagedDisk - } - if dd.ToBeDetached != nil { - objectMap["toBeDetached"] = dd.ToBeDetached - } - return json.Marshal(objectMap) -} - -// DataDiskImage contains the data disk images information. -type DataDiskImage struct { - // Lun - READ-ONLY; Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. - Lun *int32 `json:"lun,omitempty"` -} - -// MarshalJSON is the custom marshaler for DataDiskImage. -func (ddi DataDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// DedicatedHost specifies information about the Dedicated host. -type DedicatedHost struct { - autorest.Response `json:"-"` - *DedicatedHostProperties `json:"properties,omitempty"` - // Sku - SKU of the dedicated host for Hardware Generation and VM family. Only name is required to be set. List Microsoft.Compute SKUs for a list of possible values. - Sku *Sku `json:"sku,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for DedicatedHost. -func (dh DedicatedHost) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dh.DedicatedHostProperties != nil { - objectMap["properties"] = dh.DedicatedHostProperties - } - if dh.Sku != nil { - objectMap["sku"] = dh.Sku - } - if dh.Location != nil { - objectMap["location"] = dh.Location - } - if dh.Tags != nil { - objectMap["tags"] = dh.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DedicatedHost struct. -func (dh *DedicatedHost) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var dedicatedHostProperties DedicatedHostProperties - err = json.Unmarshal(*v, &dedicatedHostProperties) - if err != nil { - return err - } - dh.DedicatedHostProperties = &dedicatedHostProperties - } - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - dh.Sku = &sku - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - dh.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dh.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - dh.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - dh.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - dh.Tags = tags - } - } - } - - return nil -} - -// DedicatedHostAllocatableVM represents the dedicated host unutilized capacity in terms of a specific VM -// size. -type DedicatedHostAllocatableVM struct { - // VMSize - VM size in terms of which the unutilized capacity is represented. - VMSize *string `json:"vmSize,omitempty"` - // Count - Maximum number of VMs of size vmSize that can fit in the dedicated host's remaining capacity. - Count *float64 `json:"count,omitempty"` -} - -// DedicatedHostAvailableCapacity dedicated host unutilized capacity. -type DedicatedHostAvailableCapacity struct { - // AllocatableVMs - The unutilized capacity of the dedicated host represented in terms of each VM size that is allowed to be deployed to the dedicated host. - AllocatableVMs *[]DedicatedHostAllocatableVM `json:"allocatableVMs,omitempty"` -} - -// DedicatedHostGroup specifies information about the dedicated host group that the dedicated hosts should -// be assigned to.

Currently, a dedicated host can only be added to a dedicated host group at -// creation time. An existing dedicated host cannot be added to another dedicated host group. -type DedicatedHostGroup struct { - autorest.Response `json:"-"` - *DedicatedHostGroupProperties `json:"properties,omitempty"` - // Zones - Availability Zone to use for this host group. Only single zone is supported. The zone can be assigned only during creation. If not provided, the group supports all zones in the region. If provided, enforces each host in the group to be in the same zone. - Zones *[]string `json:"zones,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for DedicatedHostGroup. -func (dhg DedicatedHostGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dhg.DedicatedHostGroupProperties != nil { - objectMap["properties"] = dhg.DedicatedHostGroupProperties - } - if dhg.Zones != nil { - objectMap["zones"] = dhg.Zones - } - if dhg.Location != nil { - objectMap["location"] = dhg.Location - } - if dhg.Tags != nil { - objectMap["tags"] = dhg.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DedicatedHostGroup struct. -func (dhg *DedicatedHostGroup) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var dedicatedHostGroupProperties DedicatedHostGroupProperties - err = json.Unmarshal(*v, &dedicatedHostGroupProperties) - if err != nil { - return err - } - dhg.DedicatedHostGroupProperties = &dedicatedHostGroupProperties - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - dhg.Zones = &zones - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - dhg.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dhg.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - dhg.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - dhg.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - dhg.Tags = tags - } - } - } - - return nil -} - -// DedicatedHostGroupListResult the List Dedicated Host Group with resource group response. -type DedicatedHostGroupListResult struct { - autorest.Response `json:"-"` - // Value - The list of dedicated host groups - Value *[]DedicatedHostGroup `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of Dedicated Host Groups. Call ListNext() with this URI to fetch the next page of Dedicated Host Groups. - NextLink *string `json:"nextLink,omitempty"` -} - -// DedicatedHostGroupListResultIterator provides access to a complete listing of DedicatedHostGroup values. -type DedicatedHostGroupListResultIterator struct { - i int - page DedicatedHostGroupListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *DedicatedHostGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *DedicatedHostGroupListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DedicatedHostGroupListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter DedicatedHostGroupListResultIterator) Response() DedicatedHostGroupListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter DedicatedHostGroupListResultIterator) Value() DedicatedHostGroup { - if !iter.page.NotDone() { - return DedicatedHostGroup{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DedicatedHostGroupListResultIterator type. -func NewDedicatedHostGroupListResultIterator(page DedicatedHostGroupListResultPage) DedicatedHostGroupListResultIterator { - return DedicatedHostGroupListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (dhglr DedicatedHostGroupListResult) IsEmpty() bool { - return dhglr.Value == nil || len(*dhglr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (dhglr DedicatedHostGroupListResult) hasNextLink() bool { - return dhglr.NextLink != nil && len(*dhglr.NextLink) != 0 -} - -// dedicatedHostGroupListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (dhglr DedicatedHostGroupListResult) dedicatedHostGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if !dhglr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(dhglr.NextLink))) -} - -// DedicatedHostGroupListResultPage contains a page of DedicatedHostGroup values. -type DedicatedHostGroupListResultPage struct { - fn func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error) - dhglr DedicatedHostGroupListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *DedicatedHostGroupListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostGroupListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.dhglr) - if err != nil { - return err - } - page.dhglr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *DedicatedHostGroupListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DedicatedHostGroupListResultPage) NotDone() bool { - return !page.dhglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DedicatedHostGroupListResultPage) Response() DedicatedHostGroupListResult { - return page.dhglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DedicatedHostGroupListResultPage) Values() []DedicatedHostGroup { - if page.dhglr.IsEmpty() { - return nil - } - return *page.dhglr.Value -} - -// Creates a new instance of the DedicatedHostGroupListResultPage type. -func NewDedicatedHostGroupListResultPage(cur DedicatedHostGroupListResult, getNextPage func(context.Context, DedicatedHostGroupListResult) (DedicatedHostGroupListResult, error)) DedicatedHostGroupListResultPage { - return DedicatedHostGroupListResultPage{ - fn: getNextPage, - dhglr: cur, - } -} - -// DedicatedHostGroupProperties dedicated Host Group Properties. -type DedicatedHostGroupProperties struct { - // PlatformFaultDomainCount - Number of fault domains that the host group can span. - PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` - // Hosts - READ-ONLY; A list of references to all dedicated hosts in the dedicated host group. - Hosts *[]SubResourceReadOnly `json:"hosts,omitempty"` -} - -// MarshalJSON is the custom marshaler for DedicatedHostGroupProperties. -func (dhgp DedicatedHostGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dhgp.PlatformFaultDomainCount != nil { - objectMap["platformFaultDomainCount"] = dhgp.PlatformFaultDomainCount - } - return json.Marshal(objectMap) -} - -// DedicatedHostGroupUpdate specifies information about the dedicated host group that the dedicated host -// should be assigned to. Only tags may be updated. -type DedicatedHostGroupUpdate struct { - *DedicatedHostGroupProperties `json:"properties,omitempty"` - // Zones - Availability Zone to use for this host group. Only single zone is supported. The zone can be assigned only during creation. If not provided, the group supports all zones in the region. If provided, enforces each host in the group to be in the same zone. - Zones *[]string `json:"zones,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for DedicatedHostGroupUpdate. -func (dhgu DedicatedHostGroupUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dhgu.DedicatedHostGroupProperties != nil { - objectMap["properties"] = dhgu.DedicatedHostGroupProperties - } - if dhgu.Zones != nil { - objectMap["zones"] = dhgu.Zones - } - if dhgu.Tags != nil { - objectMap["tags"] = dhgu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DedicatedHostGroupUpdate struct. -func (dhgu *DedicatedHostGroupUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var dedicatedHostGroupProperties DedicatedHostGroupProperties - err = json.Unmarshal(*v, &dedicatedHostGroupProperties) - if err != nil { - return err - } - dhgu.DedicatedHostGroupProperties = &dedicatedHostGroupProperties - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - dhgu.Zones = &zones - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - dhgu.Tags = tags - } - } - } - - return nil -} - -// DedicatedHostInstanceView the instance view of a dedicated host. -type DedicatedHostInstanceView struct { - // AssetID - READ-ONLY; Specifies the unique id of the dedicated physical machine on which the dedicated host resides. - AssetID *string `json:"assetId,omitempty"` - // AvailableCapacity - Unutilized capacity of the dedicated host. - AvailableCapacity *DedicatedHostAvailableCapacity `json:"availableCapacity,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` -} - -// MarshalJSON is the custom marshaler for DedicatedHostInstanceView. -func (dhiv DedicatedHostInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dhiv.AvailableCapacity != nil { - objectMap["availableCapacity"] = dhiv.AvailableCapacity - } - if dhiv.Statuses != nil { - objectMap["statuses"] = dhiv.Statuses - } - return json.Marshal(objectMap) -} - -// DedicatedHostListResult the list dedicated host operation response. -type DedicatedHostListResult struct { - autorest.Response `json:"-"` - // Value - The list of dedicated hosts - Value *[]DedicatedHost `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of dedicated hosts. Call ListNext() with this URI to fetch the next page of dedicated hosts. - NextLink *string `json:"nextLink,omitempty"` -} - -// DedicatedHostListResultIterator provides access to a complete listing of DedicatedHost values. -type DedicatedHostListResultIterator struct { - i int - page DedicatedHostListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *DedicatedHostListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *DedicatedHostListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DedicatedHostListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter DedicatedHostListResultIterator) Response() DedicatedHostListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter DedicatedHostListResultIterator) Value() DedicatedHost { - if !iter.page.NotDone() { - return DedicatedHost{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DedicatedHostListResultIterator type. -func NewDedicatedHostListResultIterator(page DedicatedHostListResultPage) DedicatedHostListResultIterator { - return DedicatedHostListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (dhlr DedicatedHostListResult) IsEmpty() bool { - return dhlr.Value == nil || len(*dhlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (dhlr DedicatedHostListResult) hasNextLink() bool { - return dhlr.NextLink != nil && len(*dhlr.NextLink) != 0 -} - -// dedicatedHostListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (dhlr DedicatedHostListResult) dedicatedHostListResultPreparer(ctx context.Context) (*http.Request, error) { - if !dhlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(dhlr.NextLink))) -} - -// DedicatedHostListResultPage contains a page of DedicatedHost values. -type DedicatedHostListResultPage struct { - fn func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error) - dhlr DedicatedHostListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *DedicatedHostListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DedicatedHostListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.dhlr) - if err != nil { - return err - } - page.dhlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *DedicatedHostListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DedicatedHostListResultPage) NotDone() bool { - return !page.dhlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DedicatedHostListResultPage) Response() DedicatedHostListResult { - return page.dhlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DedicatedHostListResultPage) Values() []DedicatedHost { - if page.dhlr.IsEmpty() { - return nil - } - return *page.dhlr.Value -} - -// Creates a new instance of the DedicatedHostListResultPage type. -func NewDedicatedHostListResultPage(cur DedicatedHostListResult, getNextPage func(context.Context, DedicatedHostListResult) (DedicatedHostListResult, error)) DedicatedHostListResultPage { - return DedicatedHostListResultPage{ - fn: getNextPage, - dhlr: cur, - } -} - -// DedicatedHostProperties properties of the dedicated host. -type DedicatedHostProperties struct { - // PlatformFaultDomain - Fault domain of the dedicated host within a dedicated host group. - PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` - // AutoReplaceOnFailure - Specifies whether the dedicated host should be replaced automatically in case of a failure. The value is defaulted to 'true' when not provided. - AutoReplaceOnFailure *bool `json:"autoReplaceOnFailure,omitempty"` - // HostID - READ-ONLY; A unique id generated and assigned to the dedicated host by the platform.

Does not change throughout the lifetime of the host. - HostID *string `json:"hostId,omitempty"` - // VirtualMachines - READ-ONLY; A list of references to all virtual machines in the Dedicated Host. - VirtualMachines *[]SubResourceReadOnly `json:"virtualMachines,omitempty"` - // LicenseType - Specifies the software license type that will be applied to the VMs deployed on the dedicated host.

Possible values are:

**None**

**Windows_Server_Hybrid**

**Windows_Server_Perpetual**

Default: **None**. Possible values include: 'DedicatedHostLicenseTypesNone', 'DedicatedHostLicenseTypesWindowsServerHybrid', 'DedicatedHostLicenseTypesWindowsServerPerpetual' - LicenseType DedicatedHostLicenseTypes `json:"licenseType,omitempty"` - // ProvisioningTime - READ-ONLY; The date when the host was first provisioned. - ProvisioningTime *date.Time `json:"provisioningTime,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // InstanceView - READ-ONLY; The dedicated host instance view. - InstanceView *DedicatedHostInstanceView `json:"instanceView,omitempty"` -} - -// MarshalJSON is the custom marshaler for DedicatedHostProperties. -func (dhp DedicatedHostProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dhp.PlatformFaultDomain != nil { - objectMap["platformFaultDomain"] = dhp.PlatformFaultDomain - } - if dhp.AutoReplaceOnFailure != nil { - objectMap["autoReplaceOnFailure"] = dhp.AutoReplaceOnFailure - } - if dhp.LicenseType != "" { - objectMap["licenseType"] = dhp.LicenseType - } - return json.Marshal(objectMap) -} - -// DedicatedHostsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DedicatedHostsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DedicatedHostsClient) (DedicatedHost, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DedicatedHostsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DedicatedHostsCreateOrUpdateFuture.Result. -func (future *DedicatedHostsCreateOrUpdateFuture) result(client DedicatedHostsClient) (dh DedicatedHost, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - dh.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if dh.Response.Response, err = future.GetResult(sender); err == nil && dh.Response.Response.StatusCode != http.StatusNoContent { - dh, err = client.CreateOrUpdateResponder(dh.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsCreateOrUpdateFuture", "Result", dh.Response.Response, "Failure responding to request") - } - } - return -} - -// DedicatedHostsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DedicatedHostsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DedicatedHostsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DedicatedHostsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DedicatedHostsDeleteFuture.Result. -func (future *DedicatedHostsDeleteFuture) result(client DedicatedHostsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// DedicatedHostsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DedicatedHostsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DedicatedHostsClient) (DedicatedHost, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DedicatedHostsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DedicatedHostsUpdateFuture.Result. -func (future *DedicatedHostsUpdateFuture) result(client DedicatedHostsClient) (dh DedicatedHost, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - dh.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DedicatedHostsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if dh.Response.Response, err = future.GetResult(sender); err == nil && dh.Response.Response.StatusCode != http.StatusNoContent { - dh, err = client.UpdateResponder(dh.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DedicatedHostsUpdateFuture", "Result", dh.Response.Response, "Failure responding to request") - } - } - return -} - -// DedicatedHostUpdate specifies information about the dedicated host. Only tags, autoReplaceOnFailure and -// licenseType may be updated. -type DedicatedHostUpdate struct { - *DedicatedHostProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for DedicatedHostUpdate. -func (dhu DedicatedHostUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dhu.DedicatedHostProperties != nil { - objectMap["properties"] = dhu.DedicatedHostProperties - } - if dhu.Tags != nil { - objectMap["tags"] = dhu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DedicatedHostUpdate struct. -func (dhu *DedicatedHostUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var dedicatedHostProperties DedicatedHostProperties - err = json.Unmarshal(*v, &dedicatedHostProperties) - if err != nil { - return err - } - dhu.DedicatedHostProperties = &dedicatedHostProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - dhu.Tags = tags - } - } - } - - return nil -} - -// DiagnosticsProfile specifies the boot diagnostic settings state.

Minimum api-version: -// 2015-06-15. -type DiagnosticsProfile struct { - // BootDiagnostics - Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status.

You can easily view the output of your console log.

Azure also enables you to see a screenshot of the VM from the hypervisor. - BootDiagnostics *BootDiagnostics `json:"bootDiagnostics,omitempty"` -} - -// DiffDiskSettings describes the parameters of ephemeral disk settings that can be specified for operating -// system disk.

NOTE: The ephemeral disk settings can only be specified for managed disk. -type DiffDiskSettings struct { - // Option - Specifies the ephemeral disk settings for operating system disk. Possible values include: 'Local' - Option DiffDiskOptions `json:"option,omitempty"` -} - -// Disallowed describes the disallowed disk types. -type Disallowed struct { - // DiskTypes - A list of disk types. - DiskTypes *[]string `json:"diskTypes,omitempty"` -} - -// Disk disk resource. -type Disk struct { - autorest.Response `json:"-"` - // ManagedBy - READ-ONLY; A relative URI containing the ID of the VM that has the disk attached. - ManagedBy *string `json:"managedBy,omitempty"` - Sku *DiskSku `json:"sku,omitempty"` - // Zones - The Logical zone list for Disk. - Zones *[]string `json:"zones,omitempty"` - *DiskProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for Disk. -func (d Disk) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if d.Sku != nil { - objectMap["sku"] = d.Sku - } - if d.Zones != nil { - objectMap["zones"] = d.Zones - } - if d.DiskProperties != nil { - objectMap["properties"] = d.DiskProperties - } - if d.Location != nil { - objectMap["location"] = d.Location - } - if d.Tags != nil { - objectMap["tags"] = d.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Disk struct. -func (d *Disk) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "managedBy": - if v != nil { - var managedBy string - err = json.Unmarshal(*v, &managedBy) - if err != nil { - return err - } - d.ManagedBy = &managedBy - } - case "sku": - if v != nil { - var sku DiskSku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - d.Sku = &sku - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - d.Zones = &zones - } - case "properties": - if v != nil { - var diskProperties DiskProperties - err = json.Unmarshal(*v, &diskProperties) - if err != nil { - return err - } - d.DiskProperties = &diskProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - d.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - d.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - d.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - d.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - d.Tags = tags - } - } - } - - return nil -} - -// DiskEncryptionSet disk encryption set resource. -type DiskEncryptionSet struct { - autorest.Response `json:"-"` - Identity *EncryptionSetIdentity `json:"identity,omitempty"` - *EncryptionSetProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for DiskEncryptionSet. -func (desVar DiskEncryptionSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if desVar.Identity != nil { - objectMap["identity"] = desVar.Identity - } - if desVar.EncryptionSetProperties != nil { - objectMap["properties"] = desVar.EncryptionSetProperties - } - if desVar.Location != nil { - objectMap["location"] = desVar.Location - } - if desVar.Tags != nil { - objectMap["tags"] = desVar.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DiskEncryptionSet struct. -func (desVar *DiskEncryptionSet) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "identity": - if v != nil { - var identity EncryptionSetIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - desVar.Identity = &identity - } - case "properties": - if v != nil { - var encryptionSetProperties EncryptionSetProperties - err = json.Unmarshal(*v, &encryptionSetProperties) - if err != nil { - return err - } - desVar.EncryptionSetProperties = &encryptionSetProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - desVar.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - desVar.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - desVar.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - desVar.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - desVar.Tags = tags - } - } - } - - return nil -} - -// DiskEncryptionSetList the List disk encryption set operation response. -type DiskEncryptionSetList struct { - autorest.Response `json:"-"` - // Value - A list of disk encryption sets. - Value *[]DiskEncryptionSet `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of disk encryption sets. Call ListNext() with this to fetch the next page of disk encryption sets. - NextLink *string `json:"nextLink,omitempty"` -} - -// DiskEncryptionSetListIterator provides access to a complete listing of DiskEncryptionSet values. -type DiskEncryptionSetListIterator struct { - i int - page DiskEncryptionSetListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *DiskEncryptionSetListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *DiskEncryptionSetListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DiskEncryptionSetListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter DiskEncryptionSetListIterator) Response() DiskEncryptionSetList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter DiskEncryptionSetListIterator) Value() DiskEncryptionSet { - if !iter.page.NotDone() { - return DiskEncryptionSet{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DiskEncryptionSetListIterator type. -func NewDiskEncryptionSetListIterator(page DiskEncryptionSetListPage) DiskEncryptionSetListIterator { - return DiskEncryptionSetListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (desl DiskEncryptionSetList) IsEmpty() bool { - return desl.Value == nil || len(*desl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (desl DiskEncryptionSetList) hasNextLink() bool { - return desl.NextLink != nil && len(*desl.NextLink) != 0 -} - -// diskEncryptionSetListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (desl DiskEncryptionSetList) diskEncryptionSetListPreparer(ctx context.Context) (*http.Request, error) { - if !desl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(desl.NextLink))) -} - -// DiskEncryptionSetListPage contains a page of DiskEncryptionSet values. -type DiskEncryptionSetListPage struct { - fn func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error) - desl DiskEncryptionSetList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *DiskEncryptionSetListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskEncryptionSetListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.desl) - if err != nil { - return err - } - page.desl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *DiskEncryptionSetListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DiskEncryptionSetListPage) NotDone() bool { - return !page.desl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DiskEncryptionSetListPage) Response() DiskEncryptionSetList { - return page.desl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DiskEncryptionSetListPage) Values() []DiskEncryptionSet { - if page.desl.IsEmpty() { - return nil - } - return *page.desl.Value -} - -// Creates a new instance of the DiskEncryptionSetListPage type. -func NewDiskEncryptionSetListPage(cur DiskEncryptionSetList, getNextPage func(context.Context, DiskEncryptionSetList) (DiskEncryptionSetList, error)) DiskEncryptionSetListPage { - return DiskEncryptionSetListPage{ - fn: getNextPage, - desl: cur, - } -} - -// DiskEncryptionSetParameters describes the parameter of customer managed disk encryption set resource id -// that can be specified for disk.

NOTE: The disk encryption set resource id can only be specified -// for managed disk. Please refer https://aka.ms/mdssewithcmkoverview for more details. -type DiskEncryptionSetParameters struct { - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// DiskEncryptionSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DiskEncryptionSetsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DiskEncryptionSetsClient) (DiskEncryptionSet, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DiskEncryptionSetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DiskEncryptionSetsCreateOrUpdateFuture.Result. -func (future *DiskEncryptionSetsCreateOrUpdateFuture) result(client DiskEncryptionSetsClient) (desVar DiskEncryptionSet, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - desVar.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if desVar.Response.Response, err = future.GetResult(sender); err == nil && desVar.Response.Response.StatusCode != http.StatusNoContent { - desVar, err = client.CreateOrUpdateResponder(desVar.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsCreateOrUpdateFuture", "Result", desVar.Response.Response, "Failure responding to request") - } - } - return -} - -// DiskEncryptionSetsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DiskEncryptionSetsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DiskEncryptionSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DiskEncryptionSetsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DiskEncryptionSetsDeleteFuture.Result. -func (future *DiskEncryptionSetsDeleteFuture) result(client DiskEncryptionSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// DiskEncryptionSetsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type DiskEncryptionSetsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DiskEncryptionSetsClient) (DiskEncryptionSet, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DiskEncryptionSetsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DiskEncryptionSetsUpdateFuture.Result. -func (future *DiskEncryptionSetsUpdateFuture) result(client DiskEncryptionSetsClient) (desVar DiskEncryptionSet, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - desVar.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DiskEncryptionSetsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if desVar.Response.Response, err = future.GetResult(sender); err == nil && desVar.Response.Response.StatusCode != http.StatusNoContent { - desVar, err = client.UpdateResponder(desVar.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DiskEncryptionSetsUpdateFuture", "Result", desVar.Response.Response, "Failure responding to request") - } - } - return -} - -// DiskEncryptionSettings describes a Encryption Settings for a Disk -type DiskEncryptionSettings struct { - // DiskEncryptionKey - Specifies the location of the disk encryption key, which is a Key Vault Secret. - DiskEncryptionKey *KeyVaultSecretReference `json:"diskEncryptionKey,omitempty"` - // KeyEncryptionKey - Specifies the location of the key encryption key in Key Vault. - KeyEncryptionKey *KeyVaultKeyReference `json:"keyEncryptionKey,omitempty"` - // Enabled - Specifies whether disk encryption should be enabled on the virtual machine. - Enabled *bool `json:"enabled,omitempty"` -} - -// DiskEncryptionSetUpdate disk encryption set update resource. -type DiskEncryptionSetUpdate struct { - *DiskEncryptionSetUpdateProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for DiskEncryptionSetUpdate. -func (desu DiskEncryptionSetUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if desu.DiskEncryptionSetUpdateProperties != nil { - objectMap["properties"] = desu.DiskEncryptionSetUpdateProperties - } - if desu.Tags != nil { - objectMap["tags"] = desu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DiskEncryptionSetUpdate struct. -func (desu *DiskEncryptionSetUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var diskEncryptionSetUpdateProperties DiskEncryptionSetUpdateProperties - err = json.Unmarshal(*v, &diskEncryptionSetUpdateProperties) - if err != nil { - return err - } - desu.DiskEncryptionSetUpdateProperties = &diskEncryptionSetUpdateProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - desu.Tags = tags - } - } - } - - return nil -} - -// DiskEncryptionSetUpdateProperties disk encryption set resource update properties. -type DiskEncryptionSetUpdateProperties struct { - ActiveKey *KeyVaultAndKeyReference `json:"activeKey,omitempty"` -} - -// DiskInstanceView the instance view of the disk. -type DiskInstanceView struct { - // Name - The disk name. - Name *string `json:"name,omitempty"` - // EncryptionSettings - Specifies the encryption settings for the OS Disk.

Minimum api-version: 2015-06-15 - EncryptionSettings *[]DiskEncryptionSettings `json:"encryptionSettings,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` -} - -// DiskList the List Disks operation response. -type DiskList struct { - autorest.Response `json:"-"` - // Value - A list of disks. - Value *[]Disk `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of disks. Call ListNext() with this to fetch the next page of disks. - NextLink *string `json:"nextLink,omitempty"` -} - -// DiskListIterator provides access to a complete listing of Disk values. -type DiskListIterator struct { - i int - page DiskListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *DiskListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *DiskListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DiskListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter DiskListIterator) Response() DiskList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter DiskListIterator) Value() Disk { - if !iter.page.NotDone() { - return Disk{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the DiskListIterator type. -func NewDiskListIterator(page DiskListPage) DiskListIterator { - return DiskListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (dl DiskList) IsEmpty() bool { - return dl.Value == nil || len(*dl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (dl DiskList) hasNextLink() bool { - return dl.NextLink != nil && len(*dl.NextLink) != 0 -} - -// diskListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (dl DiskList) diskListPreparer(ctx context.Context) (*http.Request, error) { - if !dl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(dl.NextLink))) -} - -// DiskListPage contains a page of Disk values. -type DiskListPage struct { - fn func(context.Context, DiskList) (DiskList, error) - dl DiskList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *DiskListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiskListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.dl) - if err != nil { - return err - } - page.dl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *DiskListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DiskListPage) NotDone() bool { - return !page.dl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page DiskListPage) Response() DiskList { - return page.dl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page DiskListPage) Values() []Disk { - if page.dl.IsEmpty() { - return nil - } - return *page.dl.Value -} - -// Creates a new instance of the DiskListPage type. -func NewDiskListPage(cur DiskList, getNextPage func(context.Context, DiskList) (DiskList, error)) DiskListPage { - return DiskListPage{ - fn: getNextPage, - dl: cur, - } -} - -// DiskProperties disk resource properties. -type DiskProperties struct { - // TimeCreated - READ-ONLY; The time when the disk was created. - TimeCreated *date.Time `json:"timeCreated,omitempty"` - // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' - HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` - // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. - CreationData *CreationData `json:"creationData,omitempty"` - // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // DiskSizeBytes - READ-ONLY; The size of the disk in bytes. This field is read only. - DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty"` - // UniqueID - READ-ONLY; Unique Guid identifying the resource. - UniqueID *string `json:"uniqueId,omitempty"` - // EncryptionSettingsCollection - Encryption settings collection used for Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. - EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` - // ProvisioningState - READ-ONLY; The disk provisioning state. - ProvisioningState *string `json:"provisioningState,omitempty"` - // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. - DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` - // DiskMBpsReadWrite - The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. - DiskMBpsReadWrite *int32 `json:"diskMBpsReadWrite,omitempty"` - // DiskState - READ-ONLY; The state of the disk. Possible values include: 'Unattached', 'Attached', 'Reserved', 'ActiveSAS', 'ReadyToUpload', 'ActiveUpload' - DiskState DiskState `json:"diskState,omitempty"` - // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption *Encryption `json:"encryption,omitempty"` -} - -// MarshalJSON is the custom marshaler for DiskProperties. -func (dp DiskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if dp.OsType != "" { - objectMap["osType"] = dp.OsType - } - if dp.HyperVGeneration != "" { - objectMap["hyperVGeneration"] = dp.HyperVGeneration - } - if dp.CreationData != nil { - objectMap["creationData"] = dp.CreationData - } - if dp.DiskSizeGB != nil { - objectMap["diskSizeGB"] = dp.DiskSizeGB - } - if dp.EncryptionSettingsCollection != nil { - objectMap["encryptionSettingsCollection"] = dp.EncryptionSettingsCollection - } - if dp.DiskIOPSReadWrite != nil { - objectMap["diskIOPSReadWrite"] = dp.DiskIOPSReadWrite - } - if dp.DiskMBpsReadWrite != nil { - objectMap["diskMBpsReadWrite"] = dp.DiskMBpsReadWrite - } - if dp.Encryption != nil { - objectMap["encryption"] = dp.Encryption - } - return json.Marshal(objectMap) -} - -// DisksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DisksCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DisksClient) (Disk, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DisksCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DisksCreateOrUpdateFuture.Result. -func (future *DisksCreateOrUpdateFuture) result(client DisksClient) (d Disk, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - d.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DisksCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { - d, err = client.CreateOrUpdateResponder(d.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request") - } - } - return -} - -// DisksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type DisksDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DisksClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DisksDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DisksDeleteFuture.Result. -func (future *DisksDeleteFuture) result(client DisksClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DisksDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// DisksGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DisksGrantAccessFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DisksClient) (AccessURI, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DisksGrantAccessFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DisksGrantAccessFuture.Result. -func (future *DisksGrantAccessFuture) result(client DisksClient) (au AccessURI, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - au.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DisksGrantAccessFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent { - au, err = client.GrantAccessResponder(au.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request") - } - } - return -} - -// DiskSku the disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, or UltraSSD_LRS. -type DiskSku struct { - // Name - The sku name. Possible values include: 'StandardLRS', 'PremiumLRS', 'StandardSSDLRS', 'UltraSSDLRS' - Name DiskStorageAccountTypes `json:"name,omitempty"` - // Tier - READ-ONLY; The sku tier. - Tier *string `json:"tier,omitempty"` -} - -// MarshalJSON is the custom marshaler for DiskSku. -func (ds DiskSku) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ds.Name != "" { - objectMap["name"] = ds.Name - } - return json.Marshal(objectMap) -} - -// DisksRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type DisksRevokeAccessFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DisksClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DisksRevokeAccessFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DisksRevokeAccessFuture.Result. -func (future *DisksRevokeAccessFuture) result(client DisksClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksRevokeAccessFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DisksRevokeAccessFuture") - return - } - ar.Response = future.Response() - return -} - -// DisksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type DisksUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(DisksClient) (Disk, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *DisksUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for DisksUpdateFuture.Result. -func (future *DisksUpdateFuture) result(client DisksClient) (d Disk, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - d.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.DisksUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { - d, err = client.UpdateResponder(d.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", d.Response.Response, "Failure responding to request") - } - } - return -} - -// DiskUpdate disk update resource. -type DiskUpdate struct { - *DiskUpdateProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` - Sku *DiskSku `json:"sku,omitempty"` -} - -// MarshalJSON is the custom marshaler for DiskUpdate. -func (du DiskUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if du.DiskUpdateProperties != nil { - objectMap["properties"] = du.DiskUpdateProperties - } - if du.Tags != nil { - objectMap["tags"] = du.Tags - } - if du.Sku != nil { - objectMap["sku"] = du.Sku - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for DiskUpdate struct. -func (du *DiskUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var diskUpdateProperties DiskUpdateProperties - err = json.Unmarshal(*v, &diskUpdateProperties) - if err != nil { - return err - } - du.DiskUpdateProperties = &diskUpdateProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - du.Tags = tags - } - case "sku": - if v != nil { - var sku DiskSku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - du.Sku = &sku - } - } - } - - return nil -} - -// DiskUpdateProperties disk resource update properties. -type DiskUpdateProperties struct { - // OsType - the Operating System type. Possible values include: 'Windows', 'Linux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. - EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` - // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. - DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` - // DiskMBpsReadWrite - The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. - DiskMBpsReadWrite *int32 `json:"diskMBpsReadWrite,omitempty"` - // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption *Encryption `json:"encryption,omitempty"` -} - -// Encryption encryption at rest settings for disk or snapshot -type Encryption struct { - // DiskEncryptionSetID - ResourceId of the disk encryption set to use for enabling encryption at rest. - DiskEncryptionSetID *string `json:"diskEncryptionSetId,omitempty"` - // Type - The type of key used to encrypt the data of the disk. Possible values include: 'EncryptionAtRestWithPlatformKey', 'EncryptionAtRestWithCustomerKey' - Type EncryptionType `json:"type,omitempty"` -} - -// EncryptionSetIdentity the managed identity for the disk encryption set. It should be given permission on -// the key vault before it can be used to encrypt disks. -type EncryptionSetIdentity struct { - // Type - The type of Managed Identity used by the DiskEncryptionSet. Only SystemAssigned is supported. Possible values include: 'SystemAssigned' - Type DiskEncryptionSetIdentityType `json:"type,omitempty"` - // PrincipalID - READ-ONLY; The object id of the Managed Identity Resource. This will be sent to the RP from ARM via the x-ms-identity-principal-id header in the PUT request if the resource has a systemAssigned(implicit) identity - PrincipalID *string `json:"principalId,omitempty"` - // TenantID - READ-ONLY; The tenant id of the Managed Identity Resource. This will be sent to the RP from ARM via the x-ms-client-tenant-id header in the PUT request if the resource has a systemAssigned(implicit) identity - TenantID *string `json:"tenantId,omitempty"` -} - -// MarshalJSON is the custom marshaler for EncryptionSetIdentity. -func (esi EncryptionSetIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if esi.Type != "" { - objectMap["type"] = esi.Type - } - return json.Marshal(objectMap) -} - -// EncryptionSetProperties ... -type EncryptionSetProperties struct { - // ActiveKey - The key vault key which is currently used by this disk encryption set. - ActiveKey *KeyVaultAndKeyReference `json:"activeKey,omitempty"` - // PreviousKeys - READ-ONLY; A readonly collection of key vault keys previously used by this disk encryption set while a key rotation is in progress. It will be empty if there is no ongoing key rotation. - PreviousKeys *[]KeyVaultAndKeyReference `json:"previousKeys,omitempty"` - // ProvisioningState - READ-ONLY; The disk encryption set provisioning state. - ProvisioningState *string `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for EncryptionSetProperties. -func (esp EncryptionSetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if esp.ActiveKey != nil { - objectMap["activeKey"] = esp.ActiveKey - } - return json.Marshal(objectMap) -} - -// EncryptionSettingsCollection encryption settings for disk or snapshot -type EncryptionSettingsCollection struct { - // Enabled - Set this flag to true and provide DiskEncryptionKey and optional KeyEncryptionKey to enable encryption. Set this flag to false and remove DiskEncryptionKey and KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the request object, the existing settings remain unchanged. - Enabled *bool `json:"enabled,omitempty"` - // EncryptionSettings - A collection of encryption settings, one for each disk volume. - EncryptionSettings *[]EncryptionSettingsElement `json:"encryptionSettings,omitempty"` - // EncryptionSettingsVersion - Describes what type of encryption is used for the disks. Once this field is set, it cannot be overwritten. '1.0' corresponds to Azure Disk Encryption with AAD app.'1.1' corresponds to Azure Disk Encryption. - EncryptionSettingsVersion *string `json:"encryptionSettingsVersion,omitempty"` -} - -// EncryptionSettingsElement encryption settings for one disk volume. -type EncryptionSettingsElement struct { - // DiskEncryptionKey - Key Vault Secret Url and vault id of the disk encryption key - DiskEncryptionKey *KeyVaultAndSecretReference `json:"diskEncryptionKey,omitempty"` - // KeyEncryptionKey - Key Vault Key Url and vault id of the key encryption key. KeyEncryptionKey is optional and when provided is used to unwrap the disk encryption key. - KeyEncryptionKey *KeyVaultAndKeyReference `json:"keyEncryptionKey,omitempty"` -} - -// GalleriesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type GalleriesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleriesClient) (Gallery, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleriesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleriesCreateOrUpdateFuture.Result. -func (future *GalleriesCreateOrUpdateFuture) result(client GalleriesClient) (g Gallery, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - g.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleriesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if g.Response.Response, err = future.GetResult(sender); err == nil && g.Response.Response.StatusCode != http.StatusNoContent { - g, err = client.CreateOrUpdateResponder(g.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesCreateOrUpdateFuture", "Result", g.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleriesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type GalleriesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleriesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleriesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleriesDeleteFuture.Result. -func (future *GalleriesDeleteFuture) result(client GalleriesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleriesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// GalleriesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type GalleriesUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleriesClient) (Gallery, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleriesUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleriesUpdateFuture.Result. -func (future *GalleriesUpdateFuture) result(client GalleriesClient) (g Gallery, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - g.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleriesUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if g.Response.Response, err = future.GetResult(sender); err == nil && g.Response.Response.StatusCode != http.StatusNoContent { - g, err = client.UpdateResponder(g.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleriesUpdateFuture", "Result", g.Response.Response, "Failure responding to request") - } - } - return -} - -// Gallery specifies information about the Shared Image Gallery that you want to create or update. -type Gallery struct { - autorest.Response `json:"-"` - *GalleryProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for Gallery. -func (g Gallery) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if g.GalleryProperties != nil { - objectMap["properties"] = g.GalleryProperties - } - if g.Location != nil { - objectMap["location"] = g.Location - } - if g.Tags != nil { - objectMap["tags"] = g.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Gallery struct. -func (g *Gallery) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var galleryProperties GalleryProperties - err = json.Unmarshal(*v, &galleryProperties) - if err != nil { - return err - } - g.GalleryProperties = &galleryProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - g.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - g.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - g.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - g.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - g.Tags = tags - } - } - } - - return nil -} - -// GalleryApplication specifies information about the gallery Application Definition that you want to -// create or update. -type GalleryApplication struct { - autorest.Response `json:"-"` - *GalleryApplicationProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for GalleryApplication. -func (ga GalleryApplication) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ga.GalleryApplicationProperties != nil { - objectMap["properties"] = ga.GalleryApplicationProperties - } - if ga.Location != nil { - objectMap["location"] = ga.Location - } - if ga.Tags != nil { - objectMap["tags"] = ga.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryApplication struct. -func (ga *GalleryApplication) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var galleryApplicationProperties GalleryApplicationProperties - err = json.Unmarshal(*v, &galleryApplicationProperties) - if err != nil { - return err - } - ga.GalleryApplicationProperties = &galleryApplicationProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ga.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ga.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ga.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ga.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ga.Tags = tags - } - } - } - - return nil -} - -// GalleryApplicationList the List Gallery Applications operation response. -type GalleryApplicationList struct { - autorest.Response `json:"-"` - // Value - A list of Gallery Applications. - Value *[]GalleryApplication `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of Application Definitions in the Application Gallery. Call ListNext() with this to fetch the next page of gallery Application Definitions. - NextLink *string `json:"nextLink,omitempty"` -} - -// GalleryApplicationListIterator provides access to a complete listing of GalleryApplication values. -type GalleryApplicationListIterator struct { - i int - page GalleryApplicationListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *GalleryApplicationListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *GalleryApplicationListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter GalleryApplicationListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter GalleryApplicationListIterator) Response() GalleryApplicationList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter GalleryApplicationListIterator) Value() GalleryApplication { - if !iter.page.NotDone() { - return GalleryApplication{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the GalleryApplicationListIterator type. -func NewGalleryApplicationListIterator(page GalleryApplicationListPage) GalleryApplicationListIterator { - return GalleryApplicationListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (gal GalleryApplicationList) IsEmpty() bool { - return gal.Value == nil || len(*gal.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (gal GalleryApplicationList) hasNextLink() bool { - return gal.NextLink != nil && len(*gal.NextLink) != 0 -} - -// galleryApplicationListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (gal GalleryApplicationList) galleryApplicationListPreparer(ctx context.Context) (*http.Request, error) { - if !gal.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(gal.NextLink))) -} - -// GalleryApplicationListPage contains a page of GalleryApplication values. -type GalleryApplicationListPage struct { - fn func(context.Context, GalleryApplicationList) (GalleryApplicationList, error) - gal GalleryApplicationList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *GalleryApplicationListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.gal) - if err != nil { - return err - } - page.gal = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *GalleryApplicationListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page GalleryApplicationListPage) NotDone() bool { - return !page.gal.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page GalleryApplicationListPage) Response() GalleryApplicationList { - return page.gal -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page GalleryApplicationListPage) Values() []GalleryApplication { - if page.gal.IsEmpty() { - return nil - } - return *page.gal.Value -} - -// Creates a new instance of the GalleryApplicationListPage type. -func NewGalleryApplicationListPage(cur GalleryApplicationList, getNextPage func(context.Context, GalleryApplicationList) (GalleryApplicationList, error)) GalleryApplicationListPage { - return GalleryApplicationListPage{ - fn: getNextPage, - gal: cur, - } -} - -// GalleryApplicationProperties describes the properties of a gallery Application Definition. -type GalleryApplicationProperties struct { - // Description - The description of this gallery Application Definition resource. This property is updatable. - Description *string `json:"description,omitempty"` - // Eula - The Eula agreement for the gallery Application Definition. - Eula *string `json:"eula,omitempty"` - // PrivacyStatementURI - The privacy statement uri. - PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` - // ReleaseNoteURI - The release note uri. - ReleaseNoteURI *string `json:"releaseNoteUri,omitempty"` - // EndOfLifeDate - The end of life date of the gallery Application Definition. This property can be used for decommissioning purposes. This property is updatable. - EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` - // SupportedOSType - This property allows you to specify the supported type of the OS that application is built for.

Possible values are:

**Windows**

**Linux**. Possible values include: 'Windows', 'Linux' - SupportedOSType OperatingSystemTypes `json:"supportedOSType,omitempty"` -} - -// GalleryApplicationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryApplicationsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryApplicationsClient) (GalleryApplication, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryApplicationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryApplicationsCreateOrUpdateFuture.Result. -func (future *GalleryApplicationsCreateOrUpdateFuture) result(client GalleryApplicationsClient) (ga GalleryApplication, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ga.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ga.Response.Response, err = future.GetResult(sender); err == nil && ga.Response.Response.StatusCode != http.StatusNoContent { - ga, err = client.CreateOrUpdateResponder(ga.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsCreateOrUpdateFuture", "Result", ga.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryApplicationsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryApplicationsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryApplicationsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryApplicationsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryApplicationsDeleteFuture.Result. -func (future *GalleryApplicationsDeleteFuture) result(client GalleryApplicationsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// GalleryApplicationsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryApplicationsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryApplicationsClient) (GalleryApplication, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryApplicationsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryApplicationsUpdateFuture.Result. -func (future *GalleryApplicationsUpdateFuture) result(client GalleryApplicationsClient) (ga GalleryApplication, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ga.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ga.Response.Response, err = future.GetResult(sender); err == nil && ga.Response.Response.StatusCode != http.StatusNoContent { - ga, err = client.UpdateResponder(ga.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationsUpdateFuture", "Result", ga.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryApplicationUpdate specifies information about the gallery Application Definition that you want to -// update. -type GalleryApplicationUpdate struct { - *GalleryApplicationProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for GalleryApplicationUpdate. -func (gau GalleryApplicationUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gau.GalleryApplicationProperties != nil { - objectMap["properties"] = gau.GalleryApplicationProperties - } - if gau.Tags != nil { - objectMap["tags"] = gau.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryApplicationUpdate struct. -func (gau *GalleryApplicationUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var galleryApplicationProperties GalleryApplicationProperties - err = json.Unmarshal(*v, &galleryApplicationProperties) - if err != nil { - return err - } - gau.GalleryApplicationProperties = &galleryApplicationProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - gau.Tags = tags - } - } - } - - return nil -} - -// GalleryApplicationVersion specifies information about the gallery Application Version that you want to -// create or update. -type GalleryApplicationVersion struct { - autorest.Response `json:"-"` - *GalleryApplicationVersionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for GalleryApplicationVersion. -func (gav GalleryApplicationVersion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gav.GalleryApplicationVersionProperties != nil { - objectMap["properties"] = gav.GalleryApplicationVersionProperties - } - if gav.Location != nil { - objectMap["location"] = gav.Location - } - if gav.Tags != nil { - objectMap["tags"] = gav.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryApplicationVersion struct. -func (gav *GalleryApplicationVersion) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var galleryApplicationVersionProperties GalleryApplicationVersionProperties - err = json.Unmarshal(*v, &galleryApplicationVersionProperties) - if err != nil { - return err - } - gav.GalleryApplicationVersionProperties = &galleryApplicationVersionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - gav.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - gav.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - gav.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - gav.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - gav.Tags = tags - } - } - } - - return nil -} - -// GalleryApplicationVersionList the List Gallery Application version operation response. -type GalleryApplicationVersionList struct { - autorest.Response `json:"-"` - // Value - A list of gallery Application Versions. - Value *[]GalleryApplicationVersion `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of gallery Application Versions. Call ListNext() with this to fetch the next page of gallery Application Versions. - NextLink *string `json:"nextLink,omitempty"` -} - -// GalleryApplicationVersionListIterator provides access to a complete listing of GalleryApplicationVersion -// values. -type GalleryApplicationVersionListIterator struct { - i int - page GalleryApplicationVersionListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *GalleryApplicationVersionListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *GalleryApplicationVersionListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter GalleryApplicationVersionListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter GalleryApplicationVersionListIterator) Response() GalleryApplicationVersionList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter GalleryApplicationVersionListIterator) Value() GalleryApplicationVersion { - if !iter.page.NotDone() { - return GalleryApplicationVersion{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the GalleryApplicationVersionListIterator type. -func NewGalleryApplicationVersionListIterator(page GalleryApplicationVersionListPage) GalleryApplicationVersionListIterator { - return GalleryApplicationVersionListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (gavl GalleryApplicationVersionList) IsEmpty() bool { - return gavl.Value == nil || len(*gavl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (gavl GalleryApplicationVersionList) hasNextLink() bool { - return gavl.NextLink != nil && len(*gavl.NextLink) != 0 -} - -// galleryApplicationVersionListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (gavl GalleryApplicationVersionList) galleryApplicationVersionListPreparer(ctx context.Context) (*http.Request, error) { - if !gavl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(gavl.NextLink))) -} - -// GalleryApplicationVersionListPage contains a page of GalleryApplicationVersion values. -type GalleryApplicationVersionListPage struct { - fn func(context.Context, GalleryApplicationVersionList) (GalleryApplicationVersionList, error) - gavl GalleryApplicationVersionList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *GalleryApplicationVersionListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryApplicationVersionListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.gavl) - if err != nil { - return err - } - page.gavl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *GalleryApplicationVersionListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page GalleryApplicationVersionListPage) NotDone() bool { - return !page.gavl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page GalleryApplicationVersionListPage) Response() GalleryApplicationVersionList { - return page.gavl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page GalleryApplicationVersionListPage) Values() []GalleryApplicationVersion { - if page.gavl.IsEmpty() { - return nil - } - return *page.gavl.Value -} - -// Creates a new instance of the GalleryApplicationVersionListPage type. -func NewGalleryApplicationVersionListPage(cur GalleryApplicationVersionList, getNextPage func(context.Context, GalleryApplicationVersionList) (GalleryApplicationVersionList, error)) GalleryApplicationVersionListPage { - return GalleryApplicationVersionListPage{ - fn: getNextPage, - gavl: cur, - } -} - -// GalleryApplicationVersionProperties describes the properties of a gallery Image Version. -type GalleryApplicationVersionProperties struct { - PublishingProfile *GalleryApplicationVersionPublishingProfile `json:"publishingProfile,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState1Creating', 'ProvisioningState1Updating', 'ProvisioningState1Failed', 'ProvisioningState1Succeeded', 'ProvisioningState1Deleting', 'ProvisioningState1Migrating' - ProvisioningState ProvisioningState1 `json:"provisioningState,omitempty"` - // ReplicationStatus - READ-ONLY - ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryApplicationVersionProperties. -func (gavp GalleryApplicationVersionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gavp.PublishingProfile != nil { - objectMap["publishingProfile"] = gavp.PublishingProfile - } - return json.Marshal(objectMap) -} - -// GalleryApplicationVersionPublishingProfile the publishing profile of a gallery Image Version. -type GalleryApplicationVersionPublishingProfile struct { - Source *UserArtifactSource `json:"source,omitempty"` - // ContentType - Optional. May be used to help process this file. The type of file contained in the source, e.g. zip, json, etc. - ContentType *string `json:"contentType,omitempty"` - // EnableHealthCheck - Optional. Whether or not this application reports health. - EnableHealthCheck *bool `json:"enableHealthCheck,omitempty"` - // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. - TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` - // ReplicaCount - The number of replicas of the Image Version to be created per region. This property would take effect for a region when regionalReplicaCount is not specified. This property is updatable. - ReplicaCount *int32 `json:"replicaCount,omitempty"` - // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. - ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` - // PublishedDate - READ-ONLY; The timestamp for when the gallery Image Version is published. - PublishedDate *date.Time `json:"publishedDate,omitempty"` - // EndOfLifeDate - The end of life date of the gallery Image Version. This property can be used for decommissioning purposes. This property is updatable. - EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` - // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS' - StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryApplicationVersionPublishingProfile. -func (gavpp GalleryApplicationVersionPublishingProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gavpp.Source != nil { - objectMap["source"] = gavpp.Source - } - if gavpp.ContentType != nil { - objectMap["contentType"] = gavpp.ContentType - } - if gavpp.EnableHealthCheck != nil { - objectMap["enableHealthCheck"] = gavpp.EnableHealthCheck - } - if gavpp.TargetRegions != nil { - objectMap["targetRegions"] = gavpp.TargetRegions - } - if gavpp.ReplicaCount != nil { - objectMap["replicaCount"] = gavpp.ReplicaCount - } - if gavpp.ExcludeFromLatest != nil { - objectMap["excludeFromLatest"] = gavpp.ExcludeFromLatest - } - if gavpp.EndOfLifeDate != nil { - objectMap["endOfLifeDate"] = gavpp.EndOfLifeDate - } - if gavpp.StorageAccountType != "" { - objectMap["storageAccountType"] = gavpp.StorageAccountType - } - return json.Marshal(objectMap) -} - -// GalleryApplicationVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type GalleryApplicationVersionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryApplicationVersionsClient) (GalleryApplicationVersion, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryApplicationVersionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryApplicationVersionsCreateOrUpdateFuture.Result. -func (future *GalleryApplicationVersionsCreateOrUpdateFuture) result(client GalleryApplicationVersionsClient) (gav GalleryApplicationVersion, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - gav.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if gav.Response.Response, err = future.GetResult(sender); err == nil && gav.Response.Response.StatusCode != http.StatusNoContent { - gav, err = client.CreateOrUpdateResponder(gav.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsCreateOrUpdateFuture", "Result", gav.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryApplicationVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryApplicationVersionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryApplicationVersionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryApplicationVersionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryApplicationVersionsDeleteFuture.Result. -func (future *GalleryApplicationVersionsDeleteFuture) result(client GalleryApplicationVersionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// GalleryApplicationVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryApplicationVersionsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryApplicationVersionsClient) (GalleryApplicationVersion, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryApplicationVersionsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryApplicationVersionsUpdateFuture.Result. -func (future *GalleryApplicationVersionsUpdateFuture) result(client GalleryApplicationVersionsClient) (gav GalleryApplicationVersion, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - gav.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryApplicationVersionsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if gav.Response.Response, err = future.GetResult(sender); err == nil && gav.Response.Response.StatusCode != http.StatusNoContent { - gav, err = client.UpdateResponder(gav.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryApplicationVersionsUpdateFuture", "Result", gav.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryApplicationVersionUpdate specifies information about the gallery Application Version that you -// want to update. -type GalleryApplicationVersionUpdate struct { - *GalleryApplicationVersionProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for GalleryApplicationVersionUpdate. -func (gavu GalleryApplicationVersionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gavu.GalleryApplicationVersionProperties != nil { - objectMap["properties"] = gavu.GalleryApplicationVersionProperties - } - if gavu.Tags != nil { - objectMap["tags"] = gavu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryApplicationVersionUpdate struct. -func (gavu *GalleryApplicationVersionUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var galleryApplicationVersionProperties GalleryApplicationVersionProperties - err = json.Unmarshal(*v, &galleryApplicationVersionProperties) - if err != nil { - return err - } - gavu.GalleryApplicationVersionProperties = &galleryApplicationVersionProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - gavu.Tags = tags - } - } - } - - return nil -} - -// GalleryArtifactPublishingProfileBase describes the basic gallery artifact publishing profile. -type GalleryArtifactPublishingProfileBase struct { - // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. - TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` - // ReplicaCount - The number of replicas of the Image Version to be created per region. This property would take effect for a region when regionalReplicaCount is not specified. This property is updatable. - ReplicaCount *int32 `json:"replicaCount,omitempty"` - // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. - ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` - // PublishedDate - READ-ONLY; The timestamp for when the gallery Image Version is published. - PublishedDate *date.Time `json:"publishedDate,omitempty"` - // EndOfLifeDate - The end of life date of the gallery Image Version. This property can be used for decommissioning purposes. This property is updatable. - EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` - // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS' - StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryArtifactPublishingProfileBase. -func (gappb GalleryArtifactPublishingProfileBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gappb.TargetRegions != nil { - objectMap["targetRegions"] = gappb.TargetRegions - } - if gappb.ReplicaCount != nil { - objectMap["replicaCount"] = gappb.ReplicaCount - } - if gappb.ExcludeFromLatest != nil { - objectMap["excludeFromLatest"] = gappb.ExcludeFromLatest - } - if gappb.EndOfLifeDate != nil { - objectMap["endOfLifeDate"] = gappb.EndOfLifeDate - } - if gappb.StorageAccountType != "" { - objectMap["storageAccountType"] = gappb.StorageAccountType - } - return json.Marshal(objectMap) -} - -// GalleryArtifactSource the source image from which the Image Version is going to be created. -type GalleryArtifactSource struct { - ManagedImage *ManagedArtifact `json:"managedImage,omitempty"` -} - -// GalleryArtifactVersionSource the gallery artifact version source. -type GalleryArtifactVersionSource struct { - // ID - The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, or user image. - ID *string `json:"id,omitempty"` -} - -// GalleryDataDiskImage this is the data disk image. -type GalleryDataDiskImage struct { - // Lun - This property specifies the logical unit number of the data disk. This value is used to identify data disks within the Virtual Machine and therefore must be unique for each data disk attached to the Virtual Machine. - Lun *int32 `json:"lun,omitempty"` - // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. - SizeInGB *int32 `json:"sizeInGB,omitempty"` - // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' - HostCaching HostCaching `json:"hostCaching,omitempty"` - Source *GalleryArtifactVersionSource `json:"source,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryDataDiskImage. -func (gddi GalleryDataDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gddi.Lun != nil { - objectMap["lun"] = gddi.Lun - } - if gddi.HostCaching != "" { - objectMap["hostCaching"] = gddi.HostCaching - } - if gddi.Source != nil { - objectMap["source"] = gddi.Source - } - return json.Marshal(objectMap) -} - -// GalleryDiskImage this is the disk image base class. -type GalleryDiskImage struct { - // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. - SizeInGB *int32 `json:"sizeInGB,omitempty"` - // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' - HostCaching HostCaching `json:"hostCaching,omitempty"` - Source *GalleryArtifactVersionSource `json:"source,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryDiskImage. -func (gdi GalleryDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gdi.HostCaching != "" { - objectMap["hostCaching"] = gdi.HostCaching - } - if gdi.Source != nil { - objectMap["source"] = gdi.Source - } - return json.Marshal(objectMap) -} - -// GalleryIdentifier describes the gallery unique name. -type GalleryIdentifier struct { - // UniqueName - READ-ONLY; The unique name of the Shared Image Gallery. This name is generated automatically by Azure. - UniqueName *string `json:"uniqueName,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryIdentifier. -func (gi GalleryIdentifier) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// GalleryImage specifies information about the gallery Image Definition that you want to create or update. -type GalleryImage struct { - autorest.Response `json:"-"` - *GalleryImageProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for GalleryImage. -func (gi GalleryImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gi.GalleryImageProperties != nil { - objectMap["properties"] = gi.GalleryImageProperties - } - if gi.Location != nil { - objectMap["location"] = gi.Location - } - if gi.Tags != nil { - objectMap["tags"] = gi.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryImage struct. -func (gi *GalleryImage) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var galleryImageProperties GalleryImageProperties - err = json.Unmarshal(*v, &galleryImageProperties) - if err != nil { - return err - } - gi.GalleryImageProperties = &galleryImageProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - gi.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - gi.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - gi.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - gi.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - gi.Tags = tags - } - } - } - - return nil -} - -// GalleryImageIdentifier this is the gallery Image Definition identifier. -type GalleryImageIdentifier struct { - // Publisher - The name of the gallery Image Definition publisher. - Publisher *string `json:"publisher,omitempty"` - // Offer - The name of the gallery Image Definition offer. - Offer *string `json:"offer,omitempty"` - // Sku - The name of the gallery Image Definition SKU. - Sku *string `json:"sku,omitempty"` -} - -// GalleryImageList the List Gallery Images operation response. -type GalleryImageList struct { - autorest.Response `json:"-"` - // Value - A list of Shared Image Gallery images. - Value *[]GalleryImage `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of Image Definitions in the Shared Image Gallery. Call ListNext() with this to fetch the next page of gallery Image Definitions. - NextLink *string `json:"nextLink,omitempty"` -} - -// GalleryImageListIterator provides access to a complete listing of GalleryImage values. -type GalleryImageListIterator struct { - i int - page GalleryImageListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *GalleryImageListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *GalleryImageListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter GalleryImageListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter GalleryImageListIterator) Response() GalleryImageList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter GalleryImageListIterator) Value() GalleryImage { - if !iter.page.NotDone() { - return GalleryImage{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the GalleryImageListIterator type. -func NewGalleryImageListIterator(page GalleryImageListPage) GalleryImageListIterator { - return GalleryImageListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (gil GalleryImageList) IsEmpty() bool { - return gil.Value == nil || len(*gil.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (gil GalleryImageList) hasNextLink() bool { - return gil.NextLink != nil && len(*gil.NextLink) != 0 -} - -// galleryImageListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (gil GalleryImageList) galleryImageListPreparer(ctx context.Context) (*http.Request, error) { - if !gil.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(gil.NextLink))) -} - -// GalleryImageListPage contains a page of GalleryImage values. -type GalleryImageListPage struct { - fn func(context.Context, GalleryImageList) (GalleryImageList, error) - gil GalleryImageList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *GalleryImageListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.gil) - if err != nil { - return err - } - page.gil = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *GalleryImageListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page GalleryImageListPage) NotDone() bool { - return !page.gil.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page GalleryImageListPage) Response() GalleryImageList { - return page.gil -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page GalleryImageListPage) Values() []GalleryImage { - if page.gil.IsEmpty() { - return nil - } - return *page.gil.Value -} - -// Creates a new instance of the GalleryImageListPage type. -func NewGalleryImageListPage(cur GalleryImageList, getNextPage func(context.Context, GalleryImageList) (GalleryImageList, error)) GalleryImageListPage { - return GalleryImageListPage{ - fn: getNextPage, - gil: cur, - } -} - -// GalleryImageProperties describes the properties of a gallery Image Definition. -type GalleryImageProperties struct { - // Description - The description of this gallery Image Definition resource. This property is updatable. - Description *string `json:"description,omitempty"` - // Eula - The Eula agreement for the gallery Image Definition. - Eula *string `json:"eula,omitempty"` - // PrivacyStatementURI - The privacy statement uri. - PrivacyStatementURI *string `json:"privacyStatementUri,omitempty"` - // ReleaseNoteURI - The release note uri. - ReleaseNoteURI *string `json:"releaseNoteUri,omitempty"` - // OsType - This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image.

Possible values are:

**Windows**

**Linux**. Possible values include: 'Windows', 'Linux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // OsState - This property allows the user to specify whether the virtual machines created under this image are 'Generalized' or 'Specialized'. Possible values include: 'Generalized', 'Specialized' - OsState OperatingSystemStateTypes `json:"osState,omitempty"` - // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' - HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` - // EndOfLifeDate - The end of life date of the gallery Image Definition. This property can be used for decommissioning purposes. This property is updatable. - EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` - Identifier *GalleryImageIdentifier `json:"identifier,omitempty"` - Recommended *RecommendedMachineConfiguration `json:"recommended,omitempty"` - Disallowed *Disallowed `json:"disallowed,omitempty"` - PurchasePlan *ImagePurchasePlan `json:"purchasePlan,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState2Creating', 'ProvisioningState2Updating', 'ProvisioningState2Failed', 'ProvisioningState2Succeeded', 'ProvisioningState2Deleting', 'ProvisioningState2Migrating' - ProvisioningState ProvisioningState2 `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryImageProperties. -func (gip GalleryImageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gip.Description != nil { - objectMap["description"] = gip.Description - } - if gip.Eula != nil { - objectMap["eula"] = gip.Eula - } - if gip.PrivacyStatementURI != nil { - objectMap["privacyStatementUri"] = gip.PrivacyStatementURI - } - if gip.ReleaseNoteURI != nil { - objectMap["releaseNoteUri"] = gip.ReleaseNoteURI - } - if gip.OsType != "" { - objectMap["osType"] = gip.OsType - } - if gip.OsState != "" { - objectMap["osState"] = gip.OsState - } - if gip.HyperVGeneration != "" { - objectMap["hyperVGeneration"] = gip.HyperVGeneration - } - if gip.EndOfLifeDate != nil { - objectMap["endOfLifeDate"] = gip.EndOfLifeDate - } - if gip.Identifier != nil { - objectMap["identifier"] = gip.Identifier - } - if gip.Recommended != nil { - objectMap["recommended"] = gip.Recommended - } - if gip.Disallowed != nil { - objectMap["disallowed"] = gip.Disallowed - } - if gip.PurchasePlan != nil { - objectMap["purchasePlan"] = gip.PurchasePlan - } - return json.Marshal(objectMap) -} - -// GalleryImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryImagesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryImagesClient) (GalleryImage, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryImagesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryImagesCreateOrUpdateFuture.Result. -func (future *GalleryImagesCreateOrUpdateFuture) result(client GalleryImagesClient) (gi GalleryImage, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - gi.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if gi.Response.Response, err = future.GetResult(sender); err == nil && gi.Response.Response.StatusCode != http.StatusNoContent { - gi, err = client.CreateOrUpdateResponder(gi.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesCreateOrUpdateFuture", "Result", gi.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type GalleryImagesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryImagesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryImagesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryImagesDeleteFuture.Result. -func (future *GalleryImagesDeleteFuture) result(client GalleryImagesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// GalleryImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type GalleryImagesUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryImagesClient) (GalleryImage, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryImagesUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryImagesUpdateFuture.Result. -func (future *GalleryImagesUpdateFuture) result(client GalleryImagesClient) (gi GalleryImage, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - gi.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryImagesUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if gi.Response.Response, err = future.GetResult(sender); err == nil && gi.Response.Response.StatusCode != http.StatusNoContent { - gi, err = client.UpdateResponder(gi.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImagesUpdateFuture", "Result", gi.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryImageUpdate specifies information about the gallery Image Definition that you want to update. -type GalleryImageUpdate struct { - *GalleryImageProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for GalleryImageUpdate. -func (giu GalleryImageUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if giu.GalleryImageProperties != nil { - objectMap["properties"] = giu.GalleryImageProperties - } - if giu.Tags != nil { - objectMap["tags"] = giu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryImageUpdate struct. -func (giu *GalleryImageUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var galleryImageProperties GalleryImageProperties - err = json.Unmarshal(*v, &galleryImageProperties) - if err != nil { - return err - } - giu.GalleryImageProperties = &galleryImageProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - giu.Tags = tags - } - } - } - - return nil -} - -// GalleryImageVersion specifies information about the gallery Image Version that you want to create or -// update. -type GalleryImageVersion struct { - autorest.Response `json:"-"` - *GalleryImageVersionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for GalleryImageVersion. -func (giv GalleryImageVersion) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if giv.GalleryImageVersionProperties != nil { - objectMap["properties"] = giv.GalleryImageVersionProperties - } - if giv.Location != nil { - objectMap["location"] = giv.Location - } - if giv.Tags != nil { - objectMap["tags"] = giv.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryImageVersion struct. -func (giv *GalleryImageVersion) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var galleryImageVersionProperties GalleryImageVersionProperties - err = json.Unmarshal(*v, &galleryImageVersionProperties) - if err != nil { - return err - } - giv.GalleryImageVersionProperties = &galleryImageVersionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - giv.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - giv.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - giv.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - giv.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - giv.Tags = tags - } - } - } - - return nil -} - -// GalleryImageVersionList the List Gallery Image version operation response. -type GalleryImageVersionList struct { - autorest.Response `json:"-"` - // Value - A list of gallery Image Versions. - Value *[]GalleryImageVersion `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of gallery Image Versions. Call ListNext() with this to fetch the next page of gallery Image Versions. - NextLink *string `json:"nextLink,omitempty"` -} - -// GalleryImageVersionListIterator provides access to a complete listing of GalleryImageVersion values. -type GalleryImageVersionListIterator struct { - i int - page GalleryImageVersionListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *GalleryImageVersionListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *GalleryImageVersionListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter GalleryImageVersionListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter GalleryImageVersionListIterator) Response() GalleryImageVersionList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter GalleryImageVersionListIterator) Value() GalleryImageVersion { - if !iter.page.NotDone() { - return GalleryImageVersion{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the GalleryImageVersionListIterator type. -func NewGalleryImageVersionListIterator(page GalleryImageVersionListPage) GalleryImageVersionListIterator { - return GalleryImageVersionListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (givl GalleryImageVersionList) IsEmpty() bool { - return givl.Value == nil || len(*givl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (givl GalleryImageVersionList) hasNextLink() bool { - return givl.NextLink != nil && len(*givl.NextLink) != 0 -} - -// galleryImageVersionListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (givl GalleryImageVersionList) galleryImageVersionListPreparer(ctx context.Context) (*http.Request, error) { - if !givl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(givl.NextLink))) -} - -// GalleryImageVersionListPage contains a page of GalleryImageVersion values. -type GalleryImageVersionListPage struct { - fn func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error) - givl GalleryImageVersionList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *GalleryImageVersionListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageVersionListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.givl) - if err != nil { - return err - } - page.givl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *GalleryImageVersionListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page GalleryImageVersionListPage) NotDone() bool { - return !page.givl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page GalleryImageVersionListPage) Response() GalleryImageVersionList { - return page.givl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page GalleryImageVersionListPage) Values() []GalleryImageVersion { - if page.givl.IsEmpty() { - return nil - } - return *page.givl.Value -} - -// Creates a new instance of the GalleryImageVersionListPage type. -func NewGalleryImageVersionListPage(cur GalleryImageVersionList, getNextPage func(context.Context, GalleryImageVersionList) (GalleryImageVersionList, error)) GalleryImageVersionListPage { - return GalleryImageVersionListPage{ - fn: getNextPage, - givl: cur, - } -} - -// GalleryImageVersionProperties describes the properties of a gallery Image Version. -type GalleryImageVersionProperties struct { - PublishingProfile *GalleryImageVersionPublishingProfile `json:"publishingProfile,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningState3Creating', 'ProvisioningState3Updating', 'ProvisioningState3Failed', 'ProvisioningState3Succeeded', 'ProvisioningState3Deleting', 'ProvisioningState3Migrating' - ProvisioningState ProvisioningState3 `json:"provisioningState,omitempty"` - StorageProfile *GalleryImageVersionStorageProfile `json:"storageProfile,omitempty"` - // ReplicationStatus - READ-ONLY - ReplicationStatus *ReplicationStatus `json:"replicationStatus,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryImageVersionProperties. -func (givp GalleryImageVersionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if givp.PublishingProfile != nil { - objectMap["publishingProfile"] = givp.PublishingProfile - } - if givp.StorageProfile != nil { - objectMap["storageProfile"] = givp.StorageProfile - } - return json.Marshal(objectMap) -} - -// GalleryImageVersionPublishingProfile the publishing profile of a gallery Image Version. -type GalleryImageVersionPublishingProfile struct { - // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. - TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` - // ReplicaCount - The number of replicas of the Image Version to be created per region. This property would take effect for a region when regionalReplicaCount is not specified. This property is updatable. - ReplicaCount *int32 `json:"replicaCount,omitempty"` - // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. - ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` - // PublishedDate - READ-ONLY; The timestamp for when the gallery Image Version is published. - PublishedDate *date.Time `json:"publishedDate,omitempty"` - // EndOfLifeDate - The end of life date of the gallery Image Version. This property can be used for decommissioning purposes. This property is updatable. - EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` - // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS' - StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryImageVersionPublishingProfile. -func (givpp GalleryImageVersionPublishingProfile) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if givpp.TargetRegions != nil { - objectMap["targetRegions"] = givpp.TargetRegions - } - if givpp.ReplicaCount != nil { - objectMap["replicaCount"] = givpp.ReplicaCount - } - if givpp.ExcludeFromLatest != nil { - objectMap["excludeFromLatest"] = givpp.ExcludeFromLatest - } - if givpp.EndOfLifeDate != nil { - objectMap["endOfLifeDate"] = givpp.EndOfLifeDate - } - if givpp.StorageAccountType != "" { - objectMap["storageAccountType"] = givpp.StorageAccountType - } - return json.Marshal(objectMap) -} - -// GalleryImageVersionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryImageVersionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryImageVersionsClient) (GalleryImageVersion, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryImageVersionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryImageVersionsCreateOrUpdateFuture.Result. -func (future *GalleryImageVersionsCreateOrUpdateFuture) result(client GalleryImageVersionsClient) (giv GalleryImageVersion, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - giv.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if giv.Response.Response, err = future.GetResult(sender); err == nil && giv.Response.Response.StatusCode != http.StatusNoContent { - giv, err = client.CreateOrUpdateResponder(giv.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsCreateOrUpdateFuture", "Result", giv.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryImageVersionsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryImageVersionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryImageVersionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryImageVersionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryImageVersionsDeleteFuture.Result. -func (future *GalleryImageVersionsDeleteFuture) result(client GalleryImageVersionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// GalleryImageVersionStorageProfile this is the storage profile of a Gallery Image Version. -type GalleryImageVersionStorageProfile struct { - Source *GalleryArtifactVersionSource `json:"source,omitempty"` - OsDiskImage *GalleryOSDiskImage `json:"osDiskImage,omitempty"` - // DataDiskImages - A list of data disk images. - DataDiskImages *[]GalleryDataDiskImage `json:"dataDiskImages,omitempty"` -} - -// GalleryImageVersionsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type GalleryImageVersionsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(GalleryImageVersionsClient) (GalleryImageVersion, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *GalleryImageVersionsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for GalleryImageVersionsUpdateFuture.Result. -func (future *GalleryImageVersionsUpdateFuture) result(client GalleryImageVersionsClient) (giv GalleryImageVersion, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - giv.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.GalleryImageVersionsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if giv.Response.Response, err = future.GetResult(sender); err == nil && giv.Response.Response.StatusCode != http.StatusNoContent { - giv, err = client.UpdateResponder(giv.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.GalleryImageVersionsUpdateFuture", "Result", giv.Response.Response, "Failure responding to request") - } - } - return -} - -// GalleryImageVersionUpdate specifies information about the gallery Image Version that you want to update. -type GalleryImageVersionUpdate struct { - *GalleryImageVersionProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for GalleryImageVersionUpdate. -func (givu GalleryImageVersionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if givu.GalleryImageVersionProperties != nil { - objectMap["properties"] = givu.GalleryImageVersionProperties - } - if givu.Tags != nil { - objectMap["tags"] = givu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryImageVersionUpdate struct. -func (givu *GalleryImageVersionUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var galleryImageVersionProperties GalleryImageVersionProperties - err = json.Unmarshal(*v, &galleryImageVersionProperties) - if err != nil { - return err - } - givu.GalleryImageVersionProperties = &galleryImageVersionProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - givu.Tags = tags - } - } - } - - return nil -} - -// GalleryList the List Galleries operation response. -type GalleryList struct { - autorest.Response `json:"-"` - // Value - A list of galleries. - Value *[]Gallery `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of galleries. Call ListNext() with this to fetch the next page of galleries. - NextLink *string `json:"nextLink,omitempty"` -} - -// GalleryListIterator provides access to a complete listing of Gallery values. -type GalleryListIterator struct { - i int - page GalleryListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *GalleryListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *GalleryListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter GalleryListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter GalleryListIterator) Response() GalleryList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter GalleryListIterator) Value() Gallery { - if !iter.page.NotDone() { - return Gallery{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the GalleryListIterator type. -func NewGalleryListIterator(page GalleryListPage) GalleryListIterator { - return GalleryListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (gl GalleryList) IsEmpty() bool { - return gl.Value == nil || len(*gl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (gl GalleryList) hasNextLink() bool { - return gl.NextLink != nil && len(*gl.NextLink) != 0 -} - -// galleryListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (gl GalleryList) galleryListPreparer(ctx context.Context) (*http.Request, error) { - if !gl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(gl.NextLink))) -} - -// GalleryListPage contains a page of Gallery values. -type GalleryListPage struct { - fn func(context.Context, GalleryList) (GalleryList, error) - gl GalleryList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *GalleryListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GalleryListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.gl) - if err != nil { - return err - } - page.gl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *GalleryListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page GalleryListPage) NotDone() bool { - return !page.gl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page GalleryListPage) Response() GalleryList { - return page.gl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page GalleryListPage) Values() []Gallery { - if page.gl.IsEmpty() { - return nil - } - return *page.gl.Value -} - -// Creates a new instance of the GalleryListPage type. -func NewGalleryListPage(cur GalleryList, getNextPage func(context.Context, GalleryList) (GalleryList, error)) GalleryListPage { - return GalleryListPage{ - fn: getNextPage, - gl: cur, - } -} - -// GalleryOSDiskImage this is the OS disk image. -type GalleryOSDiskImage struct { - // SizeInGB - READ-ONLY; This property indicates the size of the VHD to be created. - SizeInGB *int32 `json:"sizeInGB,omitempty"` - // HostCaching - The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'. Possible values include: 'HostCachingNone', 'HostCachingReadOnly', 'HostCachingReadWrite' - HostCaching HostCaching `json:"hostCaching,omitempty"` - Source *GalleryArtifactVersionSource `json:"source,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryOSDiskImage. -func (godi GalleryOSDiskImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if godi.HostCaching != "" { - objectMap["hostCaching"] = godi.HostCaching - } - if godi.Source != nil { - objectMap["source"] = godi.Source - } - return json.Marshal(objectMap) -} - -// GalleryProperties describes the properties of a Shared Image Gallery. -type GalleryProperties struct { - // Description - The description of this Shared Image Gallery resource. This property is updatable. - Description *string `json:"description,omitempty"` - Identifier *GalleryIdentifier `json:"identifier,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateFailed', 'ProvisioningStateSucceeded', 'ProvisioningStateDeleting', 'ProvisioningStateMigrating' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for GalleryProperties. -func (gp GalleryProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gp.Description != nil { - objectMap["description"] = gp.Description - } - if gp.Identifier != nil { - objectMap["identifier"] = gp.Identifier - } - return json.Marshal(objectMap) -} - -// GalleryUpdate specifies information about the Shared Image Gallery that you want to update. -type GalleryUpdate struct { - *GalleryProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for GalleryUpdate. -func (gu GalleryUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gu.GalleryProperties != nil { - objectMap["properties"] = gu.GalleryProperties - } - if gu.Tags != nil { - objectMap["tags"] = gu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GalleryUpdate struct. -func (gu *GalleryUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var galleryProperties GalleryProperties - err = json.Unmarshal(*v, &galleryProperties) - if err != nil { - return err - } - gu.GalleryProperties = &galleryProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - gu.Tags = tags - } - } - } - - return nil -} - -// GrantAccessData data used for requesting a SAS. -type GrantAccessData struct { - // Access - Possible values include: 'None', 'Read', 'Write' - Access AccessLevel `json:"access,omitempty"` - // DurationInSeconds - Time duration in seconds until the SAS access expires. - DurationInSeconds *int32 `json:"durationInSeconds,omitempty"` -} - -// HardwareProfile specifies the hardware settings for the virtual machine. -type HardwareProfile struct { - // VMSize - Specifies the size of the virtual machine. For more information about virtual machine sizes, see [Sizes for virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).

The available VM sizes depend on region and availability set. For a list of available sizes use these APIs:

[List all available virtual machine sizes in an availability set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes)

[List all available virtual machine sizes in a region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list)

[List all available virtual machine sizes for resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). Possible values include: 'VirtualMachineSizeTypesBasicA0', 'VirtualMachineSizeTypesBasicA1', 'VirtualMachineSizeTypesBasicA2', 'VirtualMachineSizeTypesBasicA3', 'VirtualMachineSizeTypesBasicA4', 'VirtualMachineSizeTypesStandardA0', 'VirtualMachineSizeTypesStandardA1', 'VirtualMachineSizeTypesStandardA2', 'VirtualMachineSizeTypesStandardA3', 'VirtualMachineSizeTypesStandardA4', 'VirtualMachineSizeTypesStandardA5', 'VirtualMachineSizeTypesStandardA6', 'VirtualMachineSizeTypesStandardA7', 'VirtualMachineSizeTypesStandardA8', 'VirtualMachineSizeTypesStandardA9', 'VirtualMachineSizeTypesStandardA10', 'VirtualMachineSizeTypesStandardA11', 'VirtualMachineSizeTypesStandardA1V2', 'VirtualMachineSizeTypesStandardA2V2', 'VirtualMachineSizeTypesStandardA4V2', 'VirtualMachineSizeTypesStandardA8V2', 'VirtualMachineSizeTypesStandardA2mV2', 'VirtualMachineSizeTypesStandardA4mV2', 'VirtualMachineSizeTypesStandardA8mV2', 'VirtualMachineSizeTypesStandardB1s', 'VirtualMachineSizeTypesStandardB1ms', 'VirtualMachineSizeTypesStandardB2s', 'VirtualMachineSizeTypesStandardB2ms', 'VirtualMachineSizeTypesStandardB4ms', 'VirtualMachineSizeTypesStandardB8ms', 'VirtualMachineSizeTypesStandardD1', 'VirtualMachineSizeTypesStandardD2', 'VirtualMachineSizeTypesStandardD3', 'VirtualMachineSizeTypesStandardD4', 'VirtualMachineSizeTypesStandardD11', 'VirtualMachineSizeTypesStandardD12', 'VirtualMachineSizeTypesStandardD13', 'VirtualMachineSizeTypesStandardD14', 'VirtualMachineSizeTypesStandardD1V2', 'VirtualMachineSizeTypesStandardD2V2', 'VirtualMachineSizeTypesStandardD3V2', 'VirtualMachineSizeTypesStandardD4V2', 'VirtualMachineSizeTypesStandardD5V2', 'VirtualMachineSizeTypesStandardD2V3', 'VirtualMachineSizeTypesStandardD4V3', 'VirtualMachineSizeTypesStandardD8V3', 'VirtualMachineSizeTypesStandardD16V3', 'VirtualMachineSizeTypesStandardD32V3', 'VirtualMachineSizeTypesStandardD64V3', 'VirtualMachineSizeTypesStandardD2sV3', 'VirtualMachineSizeTypesStandardD4sV3', 'VirtualMachineSizeTypesStandardD8sV3', 'VirtualMachineSizeTypesStandardD16sV3', 'VirtualMachineSizeTypesStandardD32sV3', 'VirtualMachineSizeTypesStandardD64sV3', 'VirtualMachineSizeTypesStandardD11V2', 'VirtualMachineSizeTypesStandardD12V2', 'VirtualMachineSizeTypesStandardD13V2', 'VirtualMachineSizeTypesStandardD14V2', 'VirtualMachineSizeTypesStandardD15V2', 'VirtualMachineSizeTypesStandardDS1', 'VirtualMachineSizeTypesStandardDS2', 'VirtualMachineSizeTypesStandardDS3', 'VirtualMachineSizeTypesStandardDS4', 'VirtualMachineSizeTypesStandardDS11', 'VirtualMachineSizeTypesStandardDS12', 'VirtualMachineSizeTypesStandardDS13', 'VirtualMachineSizeTypesStandardDS14', 'VirtualMachineSizeTypesStandardDS1V2', 'VirtualMachineSizeTypesStandardDS2V2', 'VirtualMachineSizeTypesStandardDS3V2', 'VirtualMachineSizeTypesStandardDS4V2', 'VirtualMachineSizeTypesStandardDS5V2', 'VirtualMachineSizeTypesStandardDS11V2', 'VirtualMachineSizeTypesStandardDS12V2', 'VirtualMachineSizeTypesStandardDS13V2', 'VirtualMachineSizeTypesStandardDS14V2', 'VirtualMachineSizeTypesStandardDS15V2', 'VirtualMachineSizeTypesStandardDS134V2', 'VirtualMachineSizeTypesStandardDS132V2', 'VirtualMachineSizeTypesStandardDS148V2', 'VirtualMachineSizeTypesStandardDS144V2', 'VirtualMachineSizeTypesStandardE2V3', 'VirtualMachineSizeTypesStandardE4V3', 'VirtualMachineSizeTypesStandardE8V3', 'VirtualMachineSizeTypesStandardE16V3', 'VirtualMachineSizeTypesStandardE32V3', 'VirtualMachineSizeTypesStandardE64V3', 'VirtualMachineSizeTypesStandardE2sV3', 'VirtualMachineSizeTypesStandardE4sV3', 'VirtualMachineSizeTypesStandardE8sV3', 'VirtualMachineSizeTypesStandardE16sV3', 'VirtualMachineSizeTypesStandardE32sV3', 'VirtualMachineSizeTypesStandardE64sV3', 'VirtualMachineSizeTypesStandardE3216V3', 'VirtualMachineSizeTypesStandardE328sV3', 'VirtualMachineSizeTypesStandardE6432sV3', 'VirtualMachineSizeTypesStandardE6416sV3', 'VirtualMachineSizeTypesStandardF1', 'VirtualMachineSizeTypesStandardF2', 'VirtualMachineSizeTypesStandardF4', 'VirtualMachineSizeTypesStandardF8', 'VirtualMachineSizeTypesStandardF16', 'VirtualMachineSizeTypesStandardF1s', 'VirtualMachineSizeTypesStandardF2s', 'VirtualMachineSizeTypesStandardF4s', 'VirtualMachineSizeTypesStandardF8s', 'VirtualMachineSizeTypesStandardF16s', 'VirtualMachineSizeTypesStandardF2sV2', 'VirtualMachineSizeTypesStandardF4sV2', 'VirtualMachineSizeTypesStandardF8sV2', 'VirtualMachineSizeTypesStandardF16sV2', 'VirtualMachineSizeTypesStandardF32sV2', 'VirtualMachineSizeTypesStandardF64sV2', 'VirtualMachineSizeTypesStandardF72sV2', 'VirtualMachineSizeTypesStandardG1', 'VirtualMachineSizeTypesStandardG2', 'VirtualMachineSizeTypesStandardG3', 'VirtualMachineSizeTypesStandardG4', 'VirtualMachineSizeTypesStandardG5', 'VirtualMachineSizeTypesStandardGS1', 'VirtualMachineSizeTypesStandardGS2', 'VirtualMachineSizeTypesStandardGS3', 'VirtualMachineSizeTypesStandardGS4', 'VirtualMachineSizeTypesStandardGS5', 'VirtualMachineSizeTypesStandardGS48', 'VirtualMachineSizeTypesStandardGS44', 'VirtualMachineSizeTypesStandardGS516', 'VirtualMachineSizeTypesStandardGS58', 'VirtualMachineSizeTypesStandardH8', 'VirtualMachineSizeTypesStandardH16', 'VirtualMachineSizeTypesStandardH8m', 'VirtualMachineSizeTypesStandardH16m', 'VirtualMachineSizeTypesStandardH16r', 'VirtualMachineSizeTypesStandardH16mr', 'VirtualMachineSizeTypesStandardL4s', 'VirtualMachineSizeTypesStandardL8s', 'VirtualMachineSizeTypesStandardL16s', 'VirtualMachineSizeTypesStandardL32s', 'VirtualMachineSizeTypesStandardM64s', 'VirtualMachineSizeTypesStandardM64ms', 'VirtualMachineSizeTypesStandardM128s', 'VirtualMachineSizeTypesStandardM128ms', 'VirtualMachineSizeTypesStandardM6432ms', 'VirtualMachineSizeTypesStandardM6416ms', 'VirtualMachineSizeTypesStandardM12864ms', 'VirtualMachineSizeTypesStandardM12832ms', 'VirtualMachineSizeTypesStandardNC6', 'VirtualMachineSizeTypesStandardNC12', 'VirtualMachineSizeTypesStandardNC24', 'VirtualMachineSizeTypesStandardNC24r', 'VirtualMachineSizeTypesStandardNC6sV2', 'VirtualMachineSizeTypesStandardNC12sV2', 'VirtualMachineSizeTypesStandardNC24sV2', 'VirtualMachineSizeTypesStandardNC24rsV2', 'VirtualMachineSizeTypesStandardNC6sV3', 'VirtualMachineSizeTypesStandardNC12sV3', 'VirtualMachineSizeTypesStandardNC24sV3', 'VirtualMachineSizeTypesStandardNC24rsV3', 'VirtualMachineSizeTypesStandardND6s', 'VirtualMachineSizeTypesStandardND12s', 'VirtualMachineSizeTypesStandardND24s', 'VirtualMachineSizeTypesStandardND24rs', 'VirtualMachineSizeTypesStandardNV6', 'VirtualMachineSizeTypesStandardNV12', 'VirtualMachineSizeTypesStandardNV24' - VMSize VirtualMachineSizeTypes `json:"vmSize,omitempty"` -} - -// Image the source user image virtual hard disk. The virtual hard disk will be copied before being -// attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not -// exist. -type Image struct { - autorest.Response `json:"-"` - *ImageProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for Image. -func (i Image) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if i.ImageProperties != nil { - objectMap["properties"] = i.ImageProperties - } - if i.Location != nil { - objectMap["location"] = i.Location - } - if i.Tags != nil { - objectMap["tags"] = i.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Image struct. -func (i *Image) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var imageProperties ImageProperties - err = json.Unmarshal(*v, &imageProperties) - if err != nil { - return err - } - i.ImageProperties = &imageProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - i.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - i.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - i.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - i.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - i.Tags = tags - } - } - } - - return nil -} - -// ImageDataDisk describes a data disk. -type ImageDataDisk struct { - // Lun - Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. - Lun *int32 `json:"lun,omitempty"` - // Snapshot - The snapshot. - Snapshot *SubResource `json:"snapshot,omitempty"` - // ManagedDisk - The managedDisk. - ManagedDisk *SubResource `json:"managedDisk,omitempty"` - // BlobURI - The Virtual Hard Disk. - BlobURI *string `json:"blobUri,omitempty"` - // Caching - Specifies the caching requirements.

Possible values are:

**None**

**ReadOnly**

**ReadWrite**

Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // DiskSizeGB - Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image.

This value cannot be larger than 1023 GB - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // StorageAccountType - Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS' - StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` - // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. - DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` -} - -// ImageDisk describes a image disk. -type ImageDisk struct { - // Snapshot - The snapshot. - Snapshot *SubResource `json:"snapshot,omitempty"` - // ManagedDisk - The managedDisk. - ManagedDisk *SubResource `json:"managedDisk,omitempty"` - // BlobURI - The Virtual Hard Disk. - BlobURI *string `json:"blobUri,omitempty"` - // Caching - Specifies the caching requirements.

Possible values are:

**None**

**ReadOnly**

**ReadWrite**

Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // DiskSizeGB - Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image.

This value cannot be larger than 1023 GB - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // StorageAccountType - Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS' - StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` - // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. - DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` -} - -// ImageDiskReference the source image used for creating the disk. -type ImageDiskReference struct { - // ID - A relative uri containing either a Platform Image Repository or user image reference. - ID *string `json:"id,omitempty"` - // Lun - If the disk is created from an image's data disk, this is an index that indicates which of the data disks in the image to use. For OS disks, this field is null. - Lun *int32 `json:"lun,omitempty"` -} - -// ImageListResult the List Image operation response. -type ImageListResult struct { - autorest.Response `json:"-"` - // Value - The list of Images. - Value *[]Image `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of Images. Call ListNext() with this to fetch the next page of Images. - NextLink *string `json:"nextLink,omitempty"` -} - -// ImageListResultIterator provides access to a complete listing of Image values. -type ImageListResultIterator struct { - i int - page ImageListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ImageListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ImageListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ImageListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ImageListResultIterator) Response() ImageListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ImageListResultIterator) Value() Image { - if !iter.page.NotDone() { - return Image{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ImageListResultIterator type. -func NewImageListResultIterator(page ImageListResultPage) ImageListResultIterator { - return ImageListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ilr ImageListResult) IsEmpty() bool { - return ilr.Value == nil || len(*ilr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ilr ImageListResult) hasNextLink() bool { - return ilr.NextLink != nil && len(*ilr.NextLink) != 0 -} - -// imageListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ilr ImageListResult) imageListResultPreparer(ctx context.Context) (*http.Request, error) { - if !ilr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ilr.NextLink))) -} - -// ImageListResultPage contains a page of Image values. -type ImageListResultPage struct { - fn func(context.Context, ImageListResult) (ImageListResult, error) - ilr ImageListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ImageListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.ilr) - if err != nil { - return err - } - page.ilr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ImageListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ImageListResultPage) NotDone() bool { - return !page.ilr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ImageListResultPage) Response() ImageListResult { - return page.ilr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ImageListResultPage) Values() []Image { - if page.ilr.IsEmpty() { - return nil - } - return *page.ilr.Value -} - -// Creates a new instance of the ImageListResultPage type. -func NewImageListResultPage(cur ImageListResult, getNextPage func(context.Context, ImageListResult) (ImageListResult, error)) ImageListResultPage { - return ImageListResultPage{ - fn: getNextPage, - ilr: cur, - } -} - -// ImageOSDisk describes an Operating System disk. -type ImageOSDisk struct { - // OsType - This property allows you to specify the type of the OS that is included in the disk if creating a VM from a custom image.

Possible values are:

**Windows**

**Linux**. Possible values include: 'Windows', 'Linux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // OsState - The OS State. Possible values include: 'Generalized', 'Specialized' - OsState OperatingSystemStateTypes `json:"osState,omitempty"` - // Snapshot - The snapshot. - Snapshot *SubResource `json:"snapshot,omitempty"` - // ManagedDisk - The managedDisk. - ManagedDisk *SubResource `json:"managedDisk,omitempty"` - // BlobURI - The Virtual Hard Disk. - BlobURI *string `json:"blobUri,omitempty"` - // Caching - Specifies the caching requirements.

Possible values are:

**None**

**ReadOnly**

**ReadWrite**

Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // DiskSizeGB - Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image.

This value cannot be larger than 1023 GB - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // StorageAccountType - Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS' - StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` - // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed image disk. - DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` -} - -// ImageProperties describes the properties of an Image. -type ImageProperties struct { - // SourceVirtualMachine - The source virtual machine from which Image is created. - SourceVirtualMachine *SubResource `json:"sourceVirtualMachine,omitempty"` - // StorageProfile - Specifies the storage settings for the virtual machine disks. - StorageProfile *ImageStorageProfile `json:"storageProfile,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state. - ProvisioningState *string `json:"provisioningState,omitempty"` - // HyperVGeneration - Gets the HyperVGenerationType of the VirtualMachine created from the image. Possible values include: 'HyperVGenerationTypesV1', 'HyperVGenerationTypesV2' - HyperVGeneration HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` -} - -// MarshalJSON is the custom marshaler for ImageProperties. -func (IP ImageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if IP.SourceVirtualMachine != nil { - objectMap["sourceVirtualMachine"] = IP.SourceVirtualMachine - } - if IP.StorageProfile != nil { - objectMap["storageProfile"] = IP.StorageProfile - } - if IP.HyperVGeneration != "" { - objectMap["hyperVGeneration"] = IP.HyperVGeneration - } - return json.Marshal(objectMap) -} - -// ImagePurchasePlan describes the gallery Image Definition purchase plan. This is used by marketplace -// images. -type ImagePurchasePlan struct { - // Name - The plan ID. - Name *string `json:"name,omitempty"` - // Publisher - The publisher ID. - Publisher *string `json:"publisher,omitempty"` - // Product - The product ID. - Product *string `json:"product,omitempty"` -} - -// ImageReference specifies information about the image to use. You can specify information about platform -// images, marketplace images, or virtual machine images. This element is required when you want to use a -// platform image, marketplace image, or virtual machine image, but is not used in other creation -// operations. NOTE: Image reference publisher and offer can only be set when you create the scale set -type ImageReference struct { - // Publisher - The image publisher. - Publisher *string `json:"publisher,omitempty"` - // Offer - Specifies the offer of the platform image or marketplace image used to create the virtual machine. - Offer *string `json:"offer,omitempty"` - // Sku - The image SKU. - Sku *string `json:"sku,omitempty"` - // Version - Specifies the version of the platform image or marketplace image used to create the virtual machine. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to use the latest version of an image available at deploy time. Even if you use 'latest', the VM image will not automatically update after deploy time even if a new version becomes available. - Version *string `json:"version,omitempty"` - // ExactVersion - READ-ONLY; Specifies in decimal numbers, the version of platform image or marketplace image used to create the virtual machine. This readonly field differs from 'version', only if the value specified in 'version' field is 'latest'. - ExactVersion *string `json:"exactVersion,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for ImageReference. -func (ir ImageReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ir.Publisher != nil { - objectMap["publisher"] = ir.Publisher - } - if ir.Offer != nil { - objectMap["offer"] = ir.Offer - } - if ir.Sku != nil { - objectMap["sku"] = ir.Sku - } - if ir.Version != nil { - objectMap["version"] = ir.Version - } - if ir.ID != nil { - objectMap["id"] = ir.ID - } - return json.Marshal(objectMap) -} - -// ImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ImagesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ImagesClient) (Image, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ImagesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ImagesCreateOrUpdateFuture.Result. -func (future *ImagesCreateOrUpdateFuture) result(client ImagesClient) (i Image, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - i.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.ImagesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent { - i, err = client.CreateOrUpdateResponder(i.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", i.Response.Response, "Failure responding to request") - } - } - return -} - -// ImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type ImagesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ImagesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ImagesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ImagesDeleteFuture.Result. -func (future *ImagesDeleteFuture) result(client ImagesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.ImagesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// ImageStorageProfile describes a storage profile. -type ImageStorageProfile struct { - // OsDisk - Specifies information about the operating system disk used by the virtual machine.

For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - OsDisk *ImageOSDisk `json:"osDisk,omitempty"` - // DataDisks - Specifies the parameters that are used to add a data disk to a virtual machine.

For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - DataDisks *[]ImageDataDisk `json:"dataDisks,omitempty"` - // ZoneResilient - Specifies whether an image is zone resilient or not. Default is false. Zone resilient images can be created only in regions that provide Zone Redundant Storage (ZRS). - ZoneResilient *bool `json:"zoneResilient,omitempty"` -} - -// ImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type ImagesUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(ImagesClient) (Image, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *ImagesUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for ImagesUpdateFuture.Result. -func (future *ImagesUpdateFuture) result(client ImagesClient) (i Image, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - i.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.ImagesUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent { - i, err = client.UpdateResponder(i.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", i.Response.Response, "Failure responding to request") - } - } - return -} - -// ImageUpdate the source user image virtual hard disk. Only tags may be updated. -type ImageUpdate struct { - *ImageProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ImageUpdate. -func (iu ImageUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if iu.ImageProperties != nil { - objectMap["properties"] = iu.ImageProperties - } - if iu.Tags != nil { - objectMap["tags"] = iu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ImageUpdate struct. -func (iu *ImageUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var imageProperties ImageProperties - err = json.Unmarshal(*v, &imageProperties) - if err != nil { - return err - } - iu.ImageProperties = &imageProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - iu.Tags = tags - } - } - } - - return nil -} - -// InnerError inner error details. -type InnerError struct { - // Exceptiontype - The exception type. - Exceptiontype *string `json:"exceptiontype,omitempty"` - // Errordetail - The internal error message or exception dump. - Errordetail *string `json:"errordetail,omitempty"` -} - -// InstanceViewStatus instance view status. -type InstanceViewStatus struct { - // Code - The status code. - Code *string `json:"code,omitempty"` - // Level - The level code. Possible values include: 'Info', 'Warning', 'Error' - Level StatusLevelTypes `json:"level,omitempty"` - // DisplayStatus - The short localizable label for the status. - DisplayStatus *string `json:"displayStatus,omitempty"` - // Message - The detailed status message, including for alerts and error messages. - Message *string `json:"message,omitempty"` - // Time - The time of the status. - Time *date.Time `json:"time,omitempty"` -} - -// KeyVaultAndKeyReference key Vault Key Url and vault id of KeK, KeK is optional and when provided is used -// to unwrap the encryptionKey -type KeyVaultAndKeyReference struct { - // SourceVault - Resource id of the KeyVault containing the key or secret - SourceVault *SourceVault `json:"sourceVault,omitempty"` - // KeyURL - Url pointing to a key or secret in KeyVault - KeyURL *string `json:"keyUrl,omitempty"` -} - -// KeyVaultAndSecretReference key Vault Secret Url and vault id of the encryption key -type KeyVaultAndSecretReference struct { - // SourceVault - Resource id of the KeyVault containing the key or secret - SourceVault *SourceVault `json:"sourceVault,omitempty"` - // SecretURL - Url pointing to a key or secret in KeyVault - SecretURL *string `json:"secretUrl,omitempty"` -} - -// KeyVaultKeyReference describes a reference to Key Vault Key -type KeyVaultKeyReference struct { - // KeyURL - The URL referencing a key encryption key in Key Vault. - KeyURL *string `json:"keyUrl,omitempty"` - // SourceVault - The relative URL of the Key Vault containing the key. - SourceVault *SubResource `json:"sourceVault,omitempty"` -} - -// KeyVaultSecretReference describes a reference to Key Vault Secret -type KeyVaultSecretReference struct { - // SecretURL - The URL referencing a secret in a Key Vault. - SecretURL *string `json:"secretUrl,omitempty"` - // SourceVault - The relative URL of the Key Vault containing the secret. - SourceVault *SubResource `json:"sourceVault,omitempty"` -} - -// LinuxConfiguration specifies the Linux operating system settings on the virtual machine.

For a -// list of supported Linux distributions, see [Linux on Azure-Endorsed -// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) -//

For running non-endorsed distributions, see [Information for Non-Endorsed -// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). -type LinuxConfiguration struct { - // DisablePasswordAuthentication - Specifies whether password authentication should be disabled. - DisablePasswordAuthentication *bool `json:"disablePasswordAuthentication,omitempty"` - // SSH - Specifies the ssh key configuration for a Linux OS. - SSH *SSHConfiguration `json:"ssh,omitempty"` - // ProvisionVMAgent - Indicates whether virtual machine agent should be provisioned on the virtual machine.

When this property is not specified in the request body, default behavior is to set it to true. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM later. - ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` -} - -// ListUsagesResult the List Usages operation response. -type ListUsagesResult struct { - autorest.Response `json:"-"` - // Value - The list of compute resource usages. - Value *[]Usage `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of compute resource usage information. Call ListNext() with this to fetch the next page of compute resource usage information. - NextLink *string `json:"nextLink,omitempty"` -} - -// ListUsagesResultIterator provides access to a complete listing of Usage values. -type ListUsagesResultIterator struct { - i int - page ListUsagesResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ListUsagesResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ListUsagesResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListUsagesResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ListUsagesResultIterator) Response() ListUsagesResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ListUsagesResultIterator) Value() Usage { - if !iter.page.NotDone() { - return Usage{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ListUsagesResultIterator type. -func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIterator { - return ListUsagesResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lur ListUsagesResult) IsEmpty() bool { - return lur.Value == nil || len(*lur.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lur ListUsagesResult) hasNextLink() bool { - return lur.NextLink != nil && len(*lur.NextLink) != 0 -} - -// listUsagesResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lur ListUsagesResult) listUsagesResultPreparer(ctx context.Context) (*http.Request, error) { - if !lur.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lur.NextLink))) -} - -// ListUsagesResultPage contains a page of Usage values. -type ListUsagesResultPage struct { - fn func(context.Context, ListUsagesResult) (ListUsagesResult, error) - lur ListUsagesResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ListUsagesResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lur) - if err != nil { - return err - } - page.lur = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ListUsagesResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListUsagesResultPage) NotDone() bool { - return !page.lur.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ListUsagesResultPage) Response() ListUsagesResult { - return page.lur -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ListUsagesResultPage) Values() []Usage { - if page.lur.IsEmpty() { - return nil - } - return *page.lur.Value -} - -// Creates a new instance of the ListUsagesResultPage type. -func NewListUsagesResultPage(cur ListUsagesResult, getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage { - return ListUsagesResultPage{ - fn: getNextPage, - lur: cur, - } -} - -// ListVirtualMachineExtensionImage ... -type ListVirtualMachineExtensionImage struct { - autorest.Response `json:"-"` - Value *[]VirtualMachineExtensionImage `json:"value,omitempty"` -} - -// ListVirtualMachineImageResource ... -type ListVirtualMachineImageResource struct { - autorest.Response `json:"-"` - Value *[]VirtualMachineImageResource `json:"value,omitempty"` -} - -// LogAnalyticsExportRequestRateByIntervalFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type LogAnalyticsExportRequestRateByIntervalFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *LogAnalyticsExportRequestRateByIntervalFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for LogAnalyticsExportRequestRateByIntervalFuture.Result. -func (future *LogAnalyticsExportRequestRateByIntervalFuture) result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - laor.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportRequestRateByIntervalFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if laor.Response.Response, err = future.GetResult(sender); err == nil && laor.Response.Response.StatusCode != http.StatusNoContent { - laor, err = client.ExportRequestRateByIntervalResponder(laor.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", laor.Response.Response, "Failure responding to request") - } - } - return -} - -// LogAnalyticsExportThrottledRequestsFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type LogAnalyticsExportThrottledRequestsFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(LogAnalyticsClient) (LogAnalyticsOperationResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *LogAnalyticsExportThrottledRequestsFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for LogAnalyticsExportThrottledRequestsFuture.Result. -func (future *LogAnalyticsExportThrottledRequestsFuture) result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - laor.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportThrottledRequestsFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if laor.Response.Response, err = future.GetResult(sender); err == nil && laor.Response.Response.StatusCode != http.StatusNoContent { - laor, err = client.ExportThrottledRequestsResponder(laor.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", laor.Response.Response, "Failure responding to request") - } - } - return -} - -// LogAnalyticsInputBase api input base class for LogAnalytics Api. -type LogAnalyticsInputBase struct { - // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. - BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` - // FromTime - From time of the query - FromTime *date.Time `json:"fromTime,omitempty"` - // ToTime - To time of the query - ToTime *date.Time `json:"toTime,omitempty"` - // GroupByThrottlePolicy - Group query result by Throttle Policy applied. - GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` - // GroupByOperationName - Group query result by Operation Name. - GroupByOperationName *bool `json:"groupByOperationName,omitempty"` - // GroupByResourceName - Group query result by Resource Name. - GroupByResourceName *bool `json:"groupByResourceName,omitempty"` -} - -// LogAnalyticsOperationResult logAnalytics operation status response -type LogAnalyticsOperationResult struct { - autorest.Response `json:"-"` - // Properties - READ-ONLY; LogAnalyticsOutput - Properties *LogAnalyticsOutput `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for LogAnalyticsOperationResult. -func (laor LogAnalyticsOperationResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// LogAnalyticsOutput logAnalytics output properties -type LogAnalyticsOutput struct { - // Output - READ-ONLY; Output file Uri path to blob container. - Output *string `json:"output,omitempty"` -} - -// MarshalJSON is the custom marshaler for LogAnalyticsOutput. -func (lao LogAnalyticsOutput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// MaintenanceRedeployStatus maintenance Operation Status. -type MaintenanceRedeployStatus struct { - // IsCustomerInitiatedMaintenanceAllowed - True, if customer is allowed to perform Maintenance. - IsCustomerInitiatedMaintenanceAllowed *bool `json:"isCustomerInitiatedMaintenanceAllowed,omitempty"` - // PreMaintenanceWindowStartTime - Start Time for the Pre Maintenance Window. - PreMaintenanceWindowStartTime *date.Time `json:"preMaintenanceWindowStartTime,omitempty"` - // PreMaintenanceWindowEndTime - End Time for the Pre Maintenance Window. - PreMaintenanceWindowEndTime *date.Time `json:"preMaintenanceWindowEndTime,omitempty"` - // MaintenanceWindowStartTime - Start Time for the Maintenance Window. - MaintenanceWindowStartTime *date.Time `json:"maintenanceWindowStartTime,omitempty"` - // MaintenanceWindowEndTime - End Time for the Maintenance Window. - MaintenanceWindowEndTime *date.Time `json:"maintenanceWindowEndTime,omitempty"` - // LastOperationResultCode - The Last Maintenance Operation Result Code. Possible values include: 'MaintenanceOperationResultCodeTypesNone', 'MaintenanceOperationResultCodeTypesRetryLater', 'MaintenanceOperationResultCodeTypesMaintenanceAborted', 'MaintenanceOperationResultCodeTypesMaintenanceCompleted' - LastOperationResultCode MaintenanceOperationResultCodeTypes `json:"lastOperationResultCode,omitempty"` - // LastOperationMessage - Message returned for the last Maintenance Operation. - LastOperationMessage *string `json:"lastOperationMessage,omitempty"` -} - -// ManagedArtifact the managed artifact. -type ManagedArtifact struct { - // ID - The managed artifact id. - ID *string `json:"id,omitempty"` -} - -// ManagedDiskParameters the parameters of a managed disk. -type ManagedDiskParameters struct { - // StorageAccountType - Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS' - StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` - // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed disk. - DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// NetworkInterfaceReference describes a network interface reference. -type NetworkInterfaceReference struct { - *NetworkInterfaceReferenceProperties `json:"properties,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for NetworkInterfaceReference. -func (nir NetworkInterfaceReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if nir.NetworkInterfaceReferenceProperties != nil { - objectMap["properties"] = nir.NetworkInterfaceReferenceProperties - } - if nir.ID != nil { - objectMap["id"] = nir.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for NetworkInterfaceReference struct. -func (nir *NetworkInterfaceReference) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var networkInterfaceReferenceProperties NetworkInterfaceReferenceProperties - err = json.Unmarshal(*v, &networkInterfaceReferenceProperties) - if err != nil { - return err - } - nir.NetworkInterfaceReferenceProperties = &networkInterfaceReferenceProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - nir.ID = &ID - } - } - } - - return nil -} - -// NetworkInterfaceReferenceProperties describes a network interface reference properties. -type NetworkInterfaceReferenceProperties struct { - // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. - Primary *bool `json:"primary,omitempty"` -} - -// NetworkProfile specifies the network interfaces of the virtual machine. -type NetworkProfile struct { - // NetworkInterfaces - Specifies the list of resource Ids for the network interfaces associated with the virtual machine. - NetworkInterfaces *[]NetworkInterfaceReference `json:"networkInterfaces,omitempty"` -} - -// OperationListResult the List Compute Operation operation response. -type OperationListResult struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; The list of compute operations - Value *[]OperationValue `json:"value,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationListResult. -func (olr OperationListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// OperationValue describes the properties of a Compute Operation value. -type OperationValue struct { - // Origin - READ-ONLY; The origin of the compute operation. - Origin *string `json:"origin,omitempty"` - // Name - READ-ONLY; The name of the compute operation. - Name *string `json:"name,omitempty"` - *OperationValueDisplay `json:"display,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationValue. -func (ov OperationValue) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ov.OperationValueDisplay != nil { - objectMap["display"] = ov.OperationValueDisplay - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for OperationValue struct. -func (ov *OperationValue) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "origin": - if v != nil { - var origin string - err = json.Unmarshal(*v, &origin) - if err != nil { - return err - } - ov.Origin = &origin - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ov.Name = &name - } - case "display": - if v != nil { - var operationValueDisplay OperationValueDisplay - err = json.Unmarshal(*v, &operationValueDisplay) - if err != nil { - return err - } - ov.OperationValueDisplay = &operationValueDisplay - } - } - } - - return nil -} - -// OperationValueDisplay describes the properties of a Compute Operation Value Display. -type OperationValueDisplay struct { - // Operation - READ-ONLY; The display name of the compute operation. - Operation *string `json:"operation,omitempty"` - // Resource - READ-ONLY; The display name of the resource the operation applies to. - Resource *string `json:"resource,omitempty"` - // Description - READ-ONLY; The description of the operation. - Description *string `json:"description,omitempty"` - // Provider - READ-ONLY; The resource provider for the operation. - Provider *string `json:"provider,omitempty"` -} - -// MarshalJSON is the custom marshaler for OperationValueDisplay. -func (ovd OperationValueDisplay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// OSDisk specifies information about the operating system disk used by the virtual machine.

For -// more information about disks, see [About disks and VHDs for Azure virtual -// machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). -type OSDisk struct { - // OsType - This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD.

Possible values are:

**Windows**

**Linux**. Possible values include: 'Windows', 'Linux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // EncryptionSettings - Specifies the encryption settings for the OS Disk.

Minimum api-version: 2015-06-15 - EncryptionSettings *DiskEncryptionSettings `json:"encryptionSettings,omitempty"` - // Name - The disk name. - Name *string `json:"name,omitempty"` - // Vhd - The virtual hard disk. - Vhd *VirtualHardDisk `json:"vhd,omitempty"` - // Image - The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist. - Image *VirtualHardDisk `json:"image,omitempty"` - // Caching - Specifies the caching requirements.

Possible values are:

**None**

**ReadOnly**

**ReadWrite**

Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` - // DiffDiskSettings - Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine. - DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` - // CreateOption - Specifies how the virtual machine should be created.

Possible values are:

**Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.

**FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' - CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` - // DiskSizeGB - Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.

This value cannot be larger than 1023 GB - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // ManagedDisk - The managed disk parameters. - ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"` -} - -// OSDiskImage contains the os disk image information. -type OSDiskImage struct { - // OperatingSystem - The operating system of the osDiskImage. Possible values include: 'Windows', 'Linux' - OperatingSystem OperatingSystemTypes `json:"operatingSystem,omitempty"` -} - -// OSProfile specifies the operating system settings for the virtual machine. Some of the settings cannot -// be changed once VM is provisioned. -type OSProfile struct { - // ComputerName - Specifies the host OS name of the virtual machine.

This name cannot be updated after the VM is created.

**Max-length (Windows):** 15 characters

**Max-length (Linux):** 64 characters.

For naming conventions and restrictions see [Azure infrastructure services implementation guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). - ComputerName *string `json:"computerName,omitempty"` - // AdminUsername - Specifies the name of the administrator account.

This property cannot be updated after the VM is created.

**Windows-only restriction:** Cannot end in "."

**Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5".

**Minimum-length (Linux):** 1 character

**Max-length (Linux):** 64 characters

**Max-length (Windows):** 20 characters

  • For root access to the Linux VM, see [Using root privileges on Linux virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • For a list of built-in system users on Linux that should not be used in this field, see [Selecting User Names for Linux on Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) - AdminUsername *string `json:"adminUsername,omitempty"` - // AdminPassword - Specifies the password of the administrator account.

    **Minimum-length (Windows):** 8 characters

    **Minimum-length (Linux):** 6 characters

    **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 characters

    **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled
    Has lower characters
    Has upper characters
    Has a digit
    Has a special character (Regex match [\W_])

    **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!"

    For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)

    For resetting root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) - AdminPassword *string `json:"adminPassword,omitempty"` - // CustomData - Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array is 65535 bytes.

    **Note: Do not pass any secrets or passwords in customData property**

    This property cannot be updated after the VM is created.

    customData is passed to the VM to be saved as a file, for more information see [Custom Data on Azure VMs](https://docs.microsoft.com/azure/virtual-machines/custom-data)

    For using cloud-init for your Linux VM, see [Using cloud-init to customize a Linux VM during creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) - CustomData *string `json:"customData,omitempty"` - // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. - WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` - // LinuxConfiguration - Specifies the Linux operating system settings on the virtual machine.

    For a list of supported Linux distributions, see [Linux on Azure-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)

    For running non-endorsed distributions, see [Information for Non-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` - // Secrets - Specifies set of certificates that should be installed onto the virtual machine. - Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` - // AllowExtensionOperations - Specifies whether extension operations should be allowed on the virtual machine.

    This may only be set to False when no extensions are present on the virtual machine. - AllowExtensionOperations *bool `json:"allowExtensionOperations,omitempty"` - // RequireGuestProvisionSignal - Specifies whether the guest provision signal is required to infer provision success of the virtual machine. - RequireGuestProvisionSignal *bool `json:"requireGuestProvisionSignal,omitempty"` -} - -// Plan specifies information about the marketplace image used to create the virtual machine. This element -// is only used for marketplace images. Before you can use a marketplace image from an API, you must enable -// the image for programmatic use. In the Azure portal, find the marketplace image that you want to use -// and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and -// then click **Save**. -type Plan struct { - // Name - The plan ID. - Name *string `json:"name,omitempty"` - // Publisher - The publisher ID. - Publisher *string `json:"publisher,omitempty"` - // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. - Product *string `json:"product,omitempty"` - // PromotionCode - The promotion code. - PromotionCode *string `json:"promotionCode,omitempty"` -} - -// ProximityPlacementGroup specifies information about the proximity placement group. -type ProximityPlacementGroup struct { - autorest.Response `json:"-"` - // ProximityPlacementGroupProperties - Describes the properties of a Proximity Placement Group. - *ProximityPlacementGroupProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ProximityPlacementGroup. -func (ppg ProximityPlacementGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ppg.ProximityPlacementGroupProperties != nil { - objectMap["properties"] = ppg.ProximityPlacementGroupProperties - } - if ppg.Location != nil { - objectMap["location"] = ppg.Location - } - if ppg.Tags != nil { - objectMap["tags"] = ppg.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ProximityPlacementGroup struct. -func (ppg *ProximityPlacementGroup) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var proximityPlacementGroupProperties ProximityPlacementGroupProperties - err = json.Unmarshal(*v, &proximityPlacementGroupProperties) - if err != nil { - return err - } - ppg.ProximityPlacementGroupProperties = &proximityPlacementGroupProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ppg.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ppg.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ppg.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ppg.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ppg.Tags = tags - } - } - } - - return nil -} - -// ProximityPlacementGroupListResult the List Proximity Placement Group operation response. -type ProximityPlacementGroupListResult struct { - autorest.Response `json:"-"` - // Value - The list of proximity placement groups - Value *[]ProximityPlacementGroup `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of proximity placement groups. - NextLink *string `json:"nextLink,omitempty"` -} - -// ProximityPlacementGroupListResultIterator provides access to a complete listing of -// ProximityPlacementGroup values. -type ProximityPlacementGroupListResultIterator struct { - i int - page ProximityPlacementGroupListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ProximityPlacementGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ProximityPlacementGroupListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ProximityPlacementGroupListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ProximityPlacementGroupListResultIterator) Response() ProximityPlacementGroupListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ProximityPlacementGroupListResultIterator) Value() ProximityPlacementGroup { - if !iter.page.NotDone() { - return ProximityPlacementGroup{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ProximityPlacementGroupListResultIterator type. -func NewProximityPlacementGroupListResultIterator(page ProximityPlacementGroupListResultPage) ProximityPlacementGroupListResultIterator { - return ProximityPlacementGroupListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (ppglr ProximityPlacementGroupListResult) IsEmpty() bool { - return ppglr.Value == nil || len(*ppglr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ppglr ProximityPlacementGroupListResult) hasNextLink() bool { - return ppglr.NextLink != nil && len(*ppglr.NextLink) != 0 -} - -// proximityPlacementGroupListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ppglr ProximityPlacementGroupListResult) proximityPlacementGroupListResultPreparer(ctx context.Context) (*http.Request, error) { - if !ppglr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ppglr.NextLink))) -} - -// ProximityPlacementGroupListResultPage contains a page of ProximityPlacementGroup values. -type ProximityPlacementGroupListResultPage struct { - fn func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error) - ppglr ProximityPlacementGroupListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ProximityPlacementGroupListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.ppglr) - if err != nil { - return err - } - page.ppglr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ProximityPlacementGroupListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ProximityPlacementGroupListResultPage) NotDone() bool { - return !page.ppglr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ProximityPlacementGroupListResultPage) Response() ProximityPlacementGroupListResult { - return page.ppglr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ProximityPlacementGroupListResultPage) Values() []ProximityPlacementGroup { - if page.ppglr.IsEmpty() { - return nil - } - return *page.ppglr.Value -} - -// Creates a new instance of the ProximityPlacementGroupListResultPage type. -func NewProximityPlacementGroupListResultPage(cur ProximityPlacementGroupListResult, getNextPage func(context.Context, ProximityPlacementGroupListResult) (ProximityPlacementGroupListResult, error)) ProximityPlacementGroupListResultPage { - return ProximityPlacementGroupListResultPage{ - fn: getNextPage, - ppglr: cur, - } -} - -// ProximityPlacementGroupProperties describes the properties of a Proximity Placement Group. -type ProximityPlacementGroupProperties struct { - // ProximityPlacementGroupType - Specifies the type of the proximity placement group.

    Possible values are:

    **Standard** : Co-locate resources within an Azure region or Availability Zone.

    **Ultra** : For future use. Possible values include: 'Standard', 'Ultra' - ProximityPlacementGroupType ProximityPlacementGroupType `json:"proximityPlacementGroupType,omitempty"` - // VirtualMachines - READ-ONLY; A list of references to all virtual machines in the proximity placement group. - VirtualMachines *[]SubResourceWithColocationStatus `json:"virtualMachines,omitempty"` - // VirtualMachineScaleSets - READ-ONLY; A list of references to all virtual machine scale sets in the proximity placement group. - VirtualMachineScaleSets *[]SubResourceWithColocationStatus `json:"virtualMachineScaleSets,omitempty"` - // AvailabilitySets - READ-ONLY; A list of references to all availability sets in the proximity placement group. - AvailabilitySets *[]SubResourceWithColocationStatus `json:"availabilitySets,omitempty"` - // ColocationStatus - Describes colocation status of the Proximity Placement Group. - ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProximityPlacementGroupProperties. -func (ppgp ProximityPlacementGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ppgp.ProximityPlacementGroupType != "" { - objectMap["proximityPlacementGroupType"] = ppgp.ProximityPlacementGroupType - } - if ppgp.ColocationStatus != nil { - objectMap["colocationStatus"] = ppgp.ColocationStatus - } - return json.Marshal(objectMap) -} - -// ProximityPlacementGroupUpdate specifies information about the proximity placement group. -type ProximityPlacementGroupUpdate struct { - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for ProximityPlacementGroupUpdate. -func (ppgu ProximityPlacementGroupUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ppgu.Tags != nil { - objectMap["tags"] = ppgu.Tags - } - return json.Marshal(objectMap) -} - -// PurchasePlan used for establishing the purchase context of any 3rd Party artifact through MarketPlace. -type PurchasePlan struct { - // Publisher - The publisher ID. - Publisher *string `json:"publisher,omitempty"` - // Name - The plan ID. - Name *string `json:"name,omitempty"` - // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. - Product *string `json:"product,omitempty"` -} - -// RecommendedMachineConfiguration the properties describe the recommended machine configuration for this -// Image Definition. These properties are updatable. -type RecommendedMachineConfiguration struct { - VCPUs *ResourceRange `json:"vCPUs,omitempty"` - Memory *ResourceRange `json:"memory,omitempty"` -} - -// RecoveryWalkResponse response after calling a manual recovery walk -type RecoveryWalkResponse struct { - autorest.Response `json:"-"` - // WalkPerformed - READ-ONLY; Whether the recovery walk was performed - WalkPerformed *bool `json:"walkPerformed,omitempty"` - // NextPlatformUpdateDomain - READ-ONLY; The next update domain that needs to be walked. Null means walk spanning all update domains has been completed - NextPlatformUpdateDomain *int32 `json:"nextPlatformUpdateDomain,omitempty"` -} - -// MarshalJSON is the custom marshaler for RecoveryWalkResponse. -func (rwr RecoveryWalkResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// RegionalReplicationStatus this is the regional replication status. -type RegionalReplicationStatus struct { - // Region - READ-ONLY; The region to which the gallery Image Version is being replicated to. - Region *string `json:"region,omitempty"` - // State - READ-ONLY; This is the regional replication state. Possible values include: 'ReplicationStateUnknown', 'ReplicationStateReplicating', 'ReplicationStateCompleted', 'ReplicationStateFailed' - State ReplicationState `json:"state,omitempty"` - // Details - READ-ONLY; The details of the replication status. - Details *string `json:"details,omitempty"` - // Progress - READ-ONLY; It indicates progress of the replication job. - Progress *int32 `json:"progress,omitempty"` -} - -// MarshalJSON is the custom marshaler for RegionalReplicationStatus. -func (rrs RegionalReplicationStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ReplicationStatus this is the replication status of the gallery Image Version. -type ReplicationStatus struct { - // AggregatedState - READ-ONLY; This is the aggregated replication status based on all the regional replication status flags. Possible values include: 'Unknown', 'InProgress', 'Completed', 'Failed' - AggregatedState AggregatedReplicationState `json:"aggregatedState,omitempty"` - // Summary - READ-ONLY; This is a summary of replication status for each region. - Summary *[]RegionalReplicationStatus `json:"summary,omitempty"` -} - -// MarshalJSON is the custom marshaler for ReplicationStatus. -func (rs ReplicationStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// RequestRateByIntervalInput api request input for LogAnalytics getRequestRateByInterval Api. -type RequestRateByIntervalInput struct { - // IntervalLength - Interval value in minutes used to create LogAnalytics call rate logs. Possible values include: 'ThreeMins', 'FiveMins', 'ThirtyMins', 'SixtyMins' - IntervalLength IntervalInMins `json:"intervalLength,omitempty"` - // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. - BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` - // FromTime - From time of the query - FromTime *date.Time `json:"fromTime,omitempty"` - // ToTime - To time of the query - ToTime *date.Time `json:"toTime,omitempty"` - // GroupByThrottlePolicy - Group query result by Throttle Policy applied. - GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` - // GroupByOperationName - Group query result by Operation Name. - GroupByOperationName *bool `json:"groupByOperationName,omitempty"` - // GroupByResourceName - Group query result by Resource Name. - GroupByResourceName *bool `json:"groupByResourceName,omitempty"` -} - -// Resource the Resource model definition. -type Resource struct { - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if r.Location != nil { - objectMap["location"] = r.Location - } - if r.Tags != nil { - objectMap["tags"] = r.Tags - } - return json.Marshal(objectMap) -} - -// ResourceRange describes the resource range. -type ResourceRange struct { - // Min - The minimum number of the resource. - Min *int32 `json:"min,omitempty"` - // Max - The maximum number of the resource. - Max *int32 `json:"max,omitempty"` -} - -// ResourceSku describes an available Compute SKU. -type ResourceSku struct { - // ResourceType - READ-ONLY; The type of resource the SKU applies to. - ResourceType *string `json:"resourceType,omitempty"` - // Name - READ-ONLY; The name of SKU. - Name *string `json:"name,omitempty"` - // Tier - READ-ONLY; Specifies the tier of virtual machines in a scale set.

    Possible Values:

    **Standard**

    **Basic** - Tier *string `json:"tier,omitempty"` - // Size - READ-ONLY; The Size of the SKU. - Size *string `json:"size,omitempty"` - // Family - READ-ONLY; The Family of this particular SKU. - Family *string `json:"family,omitempty"` - // Kind - READ-ONLY; The Kind of resources that are supported in this SKU. - Kind *string `json:"kind,omitempty"` - // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. - Capacity *ResourceSkuCapacity `json:"capacity,omitempty"` - // Locations - READ-ONLY; The set of locations that the SKU is available. - Locations *[]string `json:"locations,omitempty"` - // LocationInfo - READ-ONLY; A list of locations and availability zones in those locations where the SKU is available. - LocationInfo *[]ResourceSkuLocationInfo `json:"locationInfo,omitempty"` - // APIVersions - READ-ONLY; The api versions that support this SKU. - APIVersions *[]string `json:"apiVersions,omitempty"` - // Costs - READ-ONLY; Metadata for retrieving price info. - Costs *[]ResourceSkuCosts `json:"costs,omitempty"` - // Capabilities - READ-ONLY; A name value pair to describe the capability. - Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` - // Restrictions - READ-ONLY; The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. - Restrictions *[]ResourceSkuRestrictions `json:"restrictions,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSku. -func (rs ResourceSku) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceSkuCapabilities describes The SKU capabilities object. -type ResourceSkuCapabilities struct { - // Name - READ-ONLY; An invariant to describe the feature. - Name *string `json:"name,omitempty"` - // Value - READ-ONLY; An invariant if the feature is measured by quantity. - Value *string `json:"value,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSkuCapabilities. -func (rsc ResourceSkuCapabilities) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceSkuCapacity describes scaling information of a SKU. -type ResourceSkuCapacity struct { - // Minimum - READ-ONLY; The minimum capacity. - Minimum *int64 `json:"minimum,omitempty"` - // Maximum - READ-ONLY; The maximum capacity that can be set. - Maximum *int64 `json:"maximum,omitempty"` - // Default - READ-ONLY; The default capacity. - Default *int64 `json:"default,omitempty"` - // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'ResourceSkuCapacityScaleTypeAutomatic', 'ResourceSkuCapacityScaleTypeManual', 'ResourceSkuCapacityScaleTypeNone' - ScaleType ResourceSkuCapacityScaleType `json:"scaleType,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSkuCapacity. -func (rsc ResourceSkuCapacity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceSkuCosts describes metadata for retrieving price info. -type ResourceSkuCosts struct { - // MeterID - READ-ONLY; Used for querying price from commerce. - MeterID *string `json:"meterID,omitempty"` - // Quantity - READ-ONLY; The multiplier is needed to extend the base metered cost. - Quantity *int64 `json:"quantity,omitempty"` - // ExtendedUnit - READ-ONLY; An invariant to show the extended unit. - ExtendedUnit *string `json:"extendedUnit,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSkuCosts. -func (rsc ResourceSkuCosts) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceSkuLocationInfo ... -type ResourceSkuLocationInfo struct { - // Location - READ-ONLY; Location of the SKU - Location *string `json:"location,omitempty"` - // Zones - READ-ONLY; List of availability zones where the SKU is supported. - Zones *[]string `json:"zones,omitempty"` - // ZoneDetails - READ-ONLY; Details of capabilities available to a SKU in specific zones. - ZoneDetails *[]ResourceSkuZoneDetails `json:"zoneDetails,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSkuLocationInfo. -func (rsli ResourceSkuLocationInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceSkuRestrictionInfo ... -type ResourceSkuRestrictionInfo struct { - // Locations - READ-ONLY; Locations where the SKU is restricted - Locations *[]string `json:"locations,omitempty"` - // Zones - READ-ONLY; List of availability zones where the SKU is restricted. - Zones *[]string `json:"zones,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSkuRestrictionInfo. -func (rsri ResourceSkuRestrictionInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceSkuRestrictions describes scaling information of a SKU. -type ResourceSkuRestrictions struct { - // Type - READ-ONLY; The type of restrictions. Possible values include: 'Location', 'Zone' - Type ResourceSkuRestrictionsType `json:"type,omitempty"` - // Values - READ-ONLY; The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted. - Values *[]string `json:"values,omitempty"` - // RestrictionInfo - READ-ONLY; The information about the restriction where the SKU cannot be used. - RestrictionInfo *ResourceSkuRestrictionInfo `json:"restrictionInfo,omitempty"` - // ReasonCode - READ-ONLY; The reason for restriction. Possible values include: 'QuotaID', 'NotAvailableForSubscription' - ReasonCode ResourceSkuRestrictionsReasonCode `json:"reasonCode,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSkuRestrictions. -func (rsr ResourceSkuRestrictions) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ResourceSkusResult the List Resource Skus operation response. -type ResourceSkusResult struct { - autorest.Response `json:"-"` - // Value - The list of skus available for the subscription. - Value *[]ResourceSku `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of Resource Skus. Call ListNext() with this URI to fetch the next page of Resource Skus - NextLink *string `json:"nextLink,omitempty"` -} - -// ResourceSkusResultIterator provides access to a complete listing of ResourceSku values. -type ResourceSkusResultIterator struct { - i int - page ResourceSkusResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ResourceSkusResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ResourceSkusResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ResourceSkusResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ResourceSkusResultIterator) Response() ResourceSkusResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ResourceSkusResultIterator) Value() ResourceSku { - if !iter.page.NotDone() { - return ResourceSku{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ResourceSkusResultIterator type. -func NewResourceSkusResultIterator(page ResourceSkusResultPage) ResourceSkusResultIterator { - return ResourceSkusResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rsr ResourceSkusResult) IsEmpty() bool { - return rsr.Value == nil || len(*rsr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rsr ResourceSkusResult) hasNextLink() bool { - return rsr.NextLink != nil && len(*rsr.NextLink) != 0 -} - -// resourceSkusResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rsr ResourceSkusResult) resourceSkusResultPreparer(ctx context.Context) (*http.Request, error) { - if !rsr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rsr.NextLink))) -} - -// ResourceSkusResultPage contains a page of ResourceSku values. -type ResourceSkusResultPage struct { - fn func(context.Context, ResourceSkusResult) (ResourceSkusResult, error) - rsr ResourceSkusResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ResourceSkusResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.rsr) - if err != nil { - return err - } - page.rsr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ResourceSkusResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ResourceSkusResultPage) NotDone() bool { - return !page.rsr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ResourceSkusResultPage) Response() ResourceSkusResult { - return page.rsr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ResourceSkusResultPage) Values() []ResourceSku { - if page.rsr.IsEmpty() { - return nil - } - return *page.rsr.Value -} - -// Creates a new instance of the ResourceSkusResultPage type. -func NewResourceSkusResultPage(cur ResourceSkusResult, getNextPage func(context.Context, ResourceSkusResult) (ResourceSkusResult, error)) ResourceSkusResultPage { - return ResourceSkusResultPage{ - fn: getNextPage, - rsr: cur, - } -} - -// ResourceSkuZoneDetails describes The zonal capabilities of a SKU. -type ResourceSkuZoneDetails struct { - // Name - READ-ONLY; The set of zones that the SKU is available in with the specified capabilities. - Name *[]string `json:"name,omitempty"` - // Capabilities - READ-ONLY; A list of capabilities that are available for the SKU in the specified list of zones. - Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` -} - -// MarshalJSON is the custom marshaler for ResourceSkuZoneDetails. -func (rszd ResourceSkuZoneDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// RollbackStatusInfo information about rollback on failed VM instances after a OS Upgrade operation. -type RollbackStatusInfo struct { - // SuccessfullyRolledbackInstanceCount - READ-ONLY; The number of instances which have been successfully rolled back. - SuccessfullyRolledbackInstanceCount *int32 `json:"successfullyRolledbackInstanceCount,omitempty"` - // FailedRolledbackInstanceCount - READ-ONLY; The number of instances which failed to rollback. - FailedRolledbackInstanceCount *int32 `json:"failedRolledbackInstanceCount,omitempty"` - // RollbackError - READ-ONLY; Error details if OS rollback failed. - RollbackError *APIError `json:"rollbackError,omitempty"` -} - -// MarshalJSON is the custom marshaler for RollbackStatusInfo. -func (rsi RollbackStatusInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// RollingUpgradePolicy the configuration parameters used while performing a rolling upgrade. -type RollingUpgradePolicy struct { - // MaxBatchInstancePercent - The maximum percent of total virtual machine instances that will be upgraded simultaneously by the rolling upgrade in one batch. As this is a maximum, unhealthy instances in previous or future batches can cause the percentage of instances in a batch to decrease to ensure higher reliability. The default value for this parameter is 20%. - MaxBatchInstancePercent *int32 `json:"maxBatchInstancePercent,omitempty"` - // MaxUnhealthyInstancePercent - The maximum percentage of the total virtual machine instances in the scale set that can be simultaneously unhealthy, either as a result of being upgraded, or by being found in an unhealthy state by the virtual machine health checks before the rolling upgrade aborts. This constraint will be checked prior to starting any batch. The default value for this parameter is 20%. - MaxUnhealthyInstancePercent *int32 `json:"maxUnhealthyInstancePercent,omitempty"` - // MaxUnhealthyUpgradedInstancePercent - The maximum percentage of upgraded virtual machine instances that can be found to be in an unhealthy state. This check will happen after each batch is upgraded. If this percentage is ever exceeded, the rolling update aborts. The default value for this parameter is 20%. - MaxUnhealthyUpgradedInstancePercent *int32 `json:"maxUnhealthyUpgradedInstancePercent,omitempty"` - // PauseTimeBetweenBatches - The wait time between completing the update for all virtual machines in one batch and starting the next batch. The time duration should be specified in ISO 8601 format. The default value is 0 seconds (PT0S). - PauseTimeBetweenBatches *string `json:"pauseTimeBetweenBatches,omitempty"` -} - -// RollingUpgradeProgressInfo information about the number of virtual machine instances in each upgrade -// state. -type RollingUpgradeProgressInfo struct { - // SuccessfulInstanceCount - READ-ONLY; The number of instances that have been successfully upgraded. - SuccessfulInstanceCount *int32 `json:"successfulInstanceCount,omitempty"` - // FailedInstanceCount - READ-ONLY; The number of instances that have failed to be upgraded successfully. - FailedInstanceCount *int32 `json:"failedInstanceCount,omitempty"` - // InProgressInstanceCount - READ-ONLY; The number of instances that are currently being upgraded. - InProgressInstanceCount *int32 `json:"inProgressInstanceCount,omitempty"` - // PendingInstanceCount - READ-ONLY; The number of instances that have not yet begun to be upgraded. - PendingInstanceCount *int32 `json:"pendingInstanceCount,omitempty"` -} - -// MarshalJSON is the custom marshaler for RollingUpgradeProgressInfo. -func (rupi RollingUpgradeProgressInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// RollingUpgradeRunningStatus information about the current running state of the overall upgrade. -type RollingUpgradeRunningStatus struct { - // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'RollingUpgradeStatusCodeRollingForward', 'RollingUpgradeStatusCodeCancelled', 'RollingUpgradeStatusCodeCompleted', 'RollingUpgradeStatusCodeFaulted' - Code RollingUpgradeStatusCode `json:"code,omitempty"` - // StartTime - READ-ONLY; Start time of the upgrade. - StartTime *date.Time `json:"startTime,omitempty"` - // LastAction - READ-ONLY; The last action performed on the rolling upgrade. Possible values include: 'Start', 'Cancel' - LastAction RollingUpgradeActionType `json:"lastAction,omitempty"` - // LastActionTime - READ-ONLY; Last action time of the upgrade. - LastActionTime *date.Time `json:"lastActionTime,omitempty"` -} - -// MarshalJSON is the custom marshaler for RollingUpgradeRunningStatus. -func (rurs RollingUpgradeRunningStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// RollingUpgradeStatusInfo the status of the latest virtual machine scale set rolling upgrade. -type RollingUpgradeStatusInfo struct { - autorest.Response `json:"-"` - *RollingUpgradeStatusInfoProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for RollingUpgradeStatusInfo. -func (rusi RollingUpgradeStatusInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if rusi.RollingUpgradeStatusInfoProperties != nil { - objectMap["properties"] = rusi.RollingUpgradeStatusInfoProperties - } - if rusi.Location != nil { - objectMap["location"] = rusi.Location - } - if rusi.Tags != nil { - objectMap["tags"] = rusi.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for RollingUpgradeStatusInfo struct. -func (rusi *RollingUpgradeStatusInfo) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var rollingUpgradeStatusInfoProperties RollingUpgradeStatusInfoProperties - err = json.Unmarshal(*v, &rollingUpgradeStatusInfoProperties) - if err != nil { - return err - } - rusi.RollingUpgradeStatusInfoProperties = &rollingUpgradeStatusInfoProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - rusi.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - rusi.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - rusi.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - rusi.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - rusi.Tags = tags - } - } - } - - return nil -} - -// RollingUpgradeStatusInfoProperties the status of the latest virtual machine scale set rolling upgrade. -type RollingUpgradeStatusInfoProperties struct { - // Policy - READ-ONLY; The rolling upgrade policies applied for this upgrade. - Policy *RollingUpgradePolicy `json:"policy,omitempty"` - // RunningStatus - READ-ONLY; Information about the current running state of the overall upgrade. - RunningStatus *RollingUpgradeRunningStatus `json:"runningStatus,omitempty"` - // Progress - READ-ONLY; Information about the number of virtual machine instances in each upgrade state. - Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` - // Error - READ-ONLY; Error details for this upgrade, if there are any. - Error *APIError `json:"error,omitempty"` -} - -// MarshalJSON is the custom marshaler for RollingUpgradeStatusInfoProperties. -func (rusip RollingUpgradeStatusInfoProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// RunCommandDocument describes the properties of a Run Command. -type RunCommandDocument struct { - autorest.Response `json:"-"` - // Script - The script to be executed. - Script *[]string `json:"script,omitempty"` - // Parameters - The parameters used by the script. - Parameters *[]RunCommandParameterDefinition `json:"parameters,omitempty"` - // Schema - The VM run command schema. - Schema *string `json:"$schema,omitempty"` - // ID - The VM run command id. - ID *string `json:"id,omitempty"` - // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // Label - The VM run command label. - Label *string `json:"label,omitempty"` - // Description - The VM run command description. - Description *string `json:"description,omitempty"` -} - -// RunCommandDocumentBase describes the properties of a Run Command metadata. -type RunCommandDocumentBase struct { - // Schema - The VM run command schema. - Schema *string `json:"$schema,omitempty"` - // ID - The VM run command id. - ID *string `json:"id,omitempty"` - // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // Label - The VM run command label. - Label *string `json:"label,omitempty"` - // Description - The VM run command description. - Description *string `json:"description,omitempty"` -} - -// RunCommandInput capture Virtual Machine parameters. -type RunCommandInput struct { - // CommandID - The run command id. - CommandID *string `json:"commandId,omitempty"` - // Script - Optional. The script to be executed. When this value is given, the given script will override the default script of the command. - Script *[]string `json:"script,omitempty"` - // Parameters - The run command parameters. - Parameters *[]RunCommandInputParameter `json:"parameters,omitempty"` -} - -// RunCommandInputParameter describes the properties of a run command parameter. -type RunCommandInputParameter struct { - // Name - The run command parameter name. - Name *string `json:"name,omitempty"` - // Value - The run command parameter value. - Value *string `json:"value,omitempty"` -} - -// RunCommandListResult the List Virtual Machine operation response. -type RunCommandListResult struct { - autorest.Response `json:"-"` - // Value - The list of virtual machine run commands. - Value *[]RunCommandDocumentBase `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands. - NextLink *string `json:"nextLink,omitempty"` -} - -// RunCommandListResultIterator provides access to a complete listing of RunCommandDocumentBase values. -type RunCommandListResultIterator struct { - i int - page RunCommandListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *RunCommandListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RunCommandListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *RunCommandListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter RunCommandListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter RunCommandListResultIterator) Response() RunCommandListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter RunCommandListResultIterator) Value() RunCommandDocumentBase { - if !iter.page.NotDone() { - return RunCommandDocumentBase{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the RunCommandListResultIterator type. -func NewRunCommandListResultIterator(page RunCommandListResultPage) RunCommandListResultIterator { - return RunCommandListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rclr RunCommandListResult) IsEmpty() bool { - return rclr.Value == nil || len(*rclr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rclr RunCommandListResult) hasNextLink() bool { - return rclr.NextLink != nil && len(*rclr.NextLink) != 0 -} - -// runCommandListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rclr RunCommandListResult) runCommandListResultPreparer(ctx context.Context) (*http.Request, error) { - if !rclr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rclr.NextLink))) -} - -// RunCommandListResultPage contains a page of RunCommandDocumentBase values. -type RunCommandListResultPage struct { - fn func(context.Context, RunCommandListResult) (RunCommandListResult, error) - rclr RunCommandListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *RunCommandListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RunCommandListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.rclr) - if err != nil { - return err - } - page.rclr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *RunCommandListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page RunCommandListResultPage) NotDone() bool { - return !page.rclr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page RunCommandListResultPage) Response() RunCommandListResult { - return page.rclr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page RunCommandListResultPage) Values() []RunCommandDocumentBase { - if page.rclr.IsEmpty() { - return nil - } - return *page.rclr.Value -} - -// Creates a new instance of the RunCommandListResultPage type. -func NewRunCommandListResultPage(cur RunCommandListResult, getNextPage func(context.Context, RunCommandListResult) (RunCommandListResult, error)) RunCommandListResultPage { - return RunCommandListResultPage{ - fn: getNextPage, - rclr: cur, - } -} - -// RunCommandParameterDefinition describes the properties of a run command parameter. -type RunCommandParameterDefinition struct { - // Name - The run command parameter name. - Name *string `json:"name,omitempty"` - // Type - The run command parameter type. - Type *string `json:"type,omitempty"` - // DefaultValue - The run command parameter default value. - DefaultValue *string `json:"defaultValue,omitempty"` - // Required - The run command parameter required. - Required *bool `json:"required,omitempty"` -} - -// RunCommandResult ... -type RunCommandResult struct { - autorest.Response `json:"-"` - // Value - Run command operation response. - Value *[]InstanceViewStatus `json:"value,omitempty"` -} - -// ScaleInPolicy describes a scale-in policy for a virtual machine scale set. -type ScaleInPolicy struct { - // Rules - The rules to be followed when scaling-in a virtual machine scale set.

    Possible values are:

    **Default** When a virtual machine scale set is scaled in, the scale set will first be balanced across zones if it is a zonal scale set. Then, it will be balanced across Fault Domains as far as possible. Within each Fault Domain, the virtual machines chosen for removal will be the newest ones that are not protected from scale-in.

    **OldestVM** When a virtual machine scale set is being scaled-in, the oldest virtual machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across zones. Within each zone, the oldest virtual machines that are not protected will be chosen for removal.

    **NewestVM** When a virtual machine scale set is being scaled-in, the newest virtual machines that are not protected from scale-in will be chosen for removal. For zonal virtual machine scale sets, the scale set will first be balanced across zones. Within each zone, the newest virtual machines that are not protected will be chosen for removal.

    - Rules *[]VirtualMachineScaleSetScaleInRules `json:"rules,omitempty"` -} - -// ScheduledEventsProfile ... -type ScheduledEventsProfile struct { - // TerminateNotificationProfile - Specifies Terminate Scheduled Event related configurations. - TerminateNotificationProfile *TerminateNotificationProfile `json:"terminateNotificationProfile,omitempty"` -} - -// Sku describes a virtual machine scale set sku. NOTE: If the new VM SKU is not supported on the hardware -// the scale set is currently on, you need to deallocate the VMs in the scale set before you modify the SKU -// name. -type Sku struct { - // Name - The sku name. - Name *string `json:"name,omitempty"` - // Tier - Specifies the tier of virtual machines in a scale set.

    Possible Values:

    **Standard**

    **Basic** - Tier *string `json:"tier,omitempty"` - // Capacity - Specifies the number of virtual machines in the scale set. - Capacity *int64 `json:"capacity,omitempty"` -} - -// Snapshot snapshot resource. -type Snapshot struct { - autorest.Response `json:"-"` - // ManagedBy - READ-ONLY; Unused. Always Null. - ManagedBy *string `json:"managedBy,omitempty"` - Sku *SnapshotSku `json:"sku,omitempty"` - *SnapshotProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for Snapshot. -func (s Snapshot) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if s.Sku != nil { - objectMap["sku"] = s.Sku - } - if s.SnapshotProperties != nil { - objectMap["properties"] = s.SnapshotProperties - } - if s.Location != nil { - objectMap["location"] = s.Location - } - if s.Tags != nil { - objectMap["tags"] = s.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for Snapshot struct. -func (s *Snapshot) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "managedBy": - if v != nil { - var managedBy string - err = json.Unmarshal(*v, &managedBy) - if err != nil { - return err - } - s.ManagedBy = &managedBy - } - case "sku": - if v != nil { - var sku SnapshotSku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - s.Sku = &sku - } - case "properties": - if v != nil { - var snapshotProperties SnapshotProperties - err = json.Unmarshal(*v, &snapshotProperties) - if err != nil { - return err - } - s.SnapshotProperties = &snapshotProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - s.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - s.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - s.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - s.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - s.Tags = tags - } - } - } - - return nil -} - -// SnapshotList the List Snapshots operation response. -type SnapshotList struct { - autorest.Response `json:"-"` - // Value - A list of snapshots. - Value *[]Snapshot `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of snapshots. Call ListNext() with this to fetch the next page of snapshots. - NextLink *string `json:"nextLink,omitempty"` -} - -// SnapshotListIterator provides access to a complete listing of Snapshot values. -type SnapshotListIterator struct { - i int - page SnapshotListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *SnapshotListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *SnapshotListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter SnapshotListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter SnapshotListIterator) Response() SnapshotList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter SnapshotListIterator) Value() Snapshot { - if !iter.page.NotDone() { - return Snapshot{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the SnapshotListIterator type. -func NewSnapshotListIterator(page SnapshotListPage) SnapshotListIterator { - return SnapshotListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (sl SnapshotList) IsEmpty() bool { - return sl.Value == nil || len(*sl.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (sl SnapshotList) hasNextLink() bool { - return sl.NextLink != nil && len(*sl.NextLink) != 0 -} - -// snapshotListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (sl SnapshotList) snapshotListPreparer(ctx context.Context) (*http.Request, error) { - if !sl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(sl.NextLink))) -} - -// SnapshotListPage contains a page of Snapshot values. -type SnapshotListPage struct { - fn func(context.Context, SnapshotList) (SnapshotList, error) - sl SnapshotList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *SnapshotListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.sl) - if err != nil { - return err - } - page.sl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *SnapshotListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page SnapshotListPage) NotDone() bool { - return !page.sl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page SnapshotListPage) Response() SnapshotList { - return page.sl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page SnapshotListPage) Values() []Snapshot { - if page.sl.IsEmpty() { - return nil - } - return *page.sl.Value -} - -// Creates a new instance of the SnapshotListPage type. -func NewSnapshotListPage(cur SnapshotList, getNextPage func(context.Context, SnapshotList) (SnapshotList, error)) SnapshotListPage { - return SnapshotListPage{ - fn: getNextPage, - sl: cur, - } -} - -// SnapshotProperties snapshot resource properties. -type SnapshotProperties struct { - // TimeCreated - READ-ONLY; The time when the disk was created. - TimeCreated *date.Time `json:"timeCreated,omitempty"` - // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' - HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` - // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. - CreationData *CreationData `json:"creationData,omitempty"` - // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // DiskSizeBytes - READ-ONLY; The size of the disk in bytes. This field is read only. - DiskSizeBytes *int64 `json:"diskSizeBytes,omitempty"` - // UniqueID - READ-ONLY; Unique Guid identifying the resource. - UniqueID *string `json:"uniqueId,omitempty"` - // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. - EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` - // ProvisioningState - READ-ONLY; The disk provisioning state. - ProvisioningState *string `json:"provisioningState,omitempty"` - // Incremental - Whether a snapshot is incremental. Incremental snapshots on the same disk occupy less space than full snapshots and can be diffed. - Incremental *bool `json:"incremental,omitempty"` - // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption *Encryption `json:"encryption,omitempty"` -} - -// MarshalJSON is the custom marshaler for SnapshotProperties. -func (sp SnapshotProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if sp.OsType != "" { - objectMap["osType"] = sp.OsType - } - if sp.HyperVGeneration != "" { - objectMap["hyperVGeneration"] = sp.HyperVGeneration - } - if sp.CreationData != nil { - objectMap["creationData"] = sp.CreationData - } - if sp.DiskSizeGB != nil { - objectMap["diskSizeGB"] = sp.DiskSizeGB - } - if sp.EncryptionSettingsCollection != nil { - objectMap["encryptionSettingsCollection"] = sp.EncryptionSettingsCollection - } - if sp.Incremental != nil { - objectMap["incremental"] = sp.Incremental - } - if sp.Encryption != nil { - objectMap["encryption"] = sp.Encryption - } - return json.Marshal(objectMap) -} - -// SnapshotsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SnapshotsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SnapshotsClient) (Snapshot, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SnapshotsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SnapshotsCreateOrUpdateFuture.Result. -func (future *SnapshotsCreateOrUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.SnapshotsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.CreateOrUpdateResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// SnapshotsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SnapshotsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SnapshotsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SnapshotsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SnapshotsDeleteFuture.Result. -func (future *SnapshotsDeleteFuture) result(client SnapshotsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.SnapshotsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// SnapshotsGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SnapshotsGrantAccessFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SnapshotsClient) (AccessURI, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SnapshotsGrantAccessFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SnapshotsGrantAccessFuture.Result. -func (future *SnapshotsGrantAccessFuture) result(client SnapshotsClient) (au AccessURI, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsGrantAccessFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - au.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.SnapshotsGrantAccessFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent { - au, err = client.GrantAccessResponder(au.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request") - } - } - return -} - -// SnapshotSku the snapshots sku name. Can be Standard_LRS, Premium_LRS, or Standard_ZRS. -type SnapshotSku struct { - // Name - The sku name. Possible values include: 'SnapshotStorageAccountTypesStandardLRS', 'SnapshotStorageAccountTypesPremiumLRS', 'SnapshotStorageAccountTypesStandardZRS' - Name SnapshotStorageAccountTypes `json:"name,omitempty"` - // Tier - READ-ONLY; The sku tier. - Tier *string `json:"tier,omitempty"` -} - -// MarshalJSON is the custom marshaler for SnapshotSku. -func (ss SnapshotSku) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ss.Name != "" { - objectMap["name"] = ss.Name - } - return json.Marshal(objectMap) -} - -// SnapshotsRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SnapshotsRevokeAccessFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SnapshotsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SnapshotsRevokeAccessFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SnapshotsRevokeAccessFuture.Result. -func (future *SnapshotsRevokeAccessFuture) result(client SnapshotsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsRevokeAccessFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.SnapshotsRevokeAccessFuture") - return - } - ar.Response = future.Response() - return -} - -// SnapshotsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SnapshotsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(SnapshotsClient) (Snapshot, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SnapshotsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for SnapshotsUpdateFuture.Result. -func (future *SnapshotsUpdateFuture) result(client SnapshotsClient) (s Snapshot, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - s.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.SnapshotsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { - s, err = client.UpdateResponder(s.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsUpdateFuture", "Result", s.Response.Response, "Failure responding to request") - } - } - return -} - -// SnapshotUpdate snapshot update resource. -type SnapshotUpdate struct { - *SnapshotUpdateProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` - Sku *SnapshotSku `json:"sku,omitempty"` -} - -// MarshalJSON is the custom marshaler for SnapshotUpdate. -func (su SnapshotUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if su.SnapshotUpdateProperties != nil { - objectMap["properties"] = su.SnapshotUpdateProperties - } - if su.Tags != nil { - objectMap["tags"] = su.Tags - } - if su.Sku != nil { - objectMap["sku"] = su.Sku - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for SnapshotUpdate struct. -func (su *SnapshotUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var snapshotUpdateProperties SnapshotUpdateProperties - err = json.Unmarshal(*v, &snapshotUpdateProperties) - if err != nil { - return err - } - su.SnapshotUpdateProperties = &snapshotUpdateProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - su.Tags = tags - } - case "sku": - if v != nil { - var sku SnapshotSku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - su.Sku = &sku - } - } - } - - return nil -} - -// SnapshotUpdateProperties snapshot resource update properties. -type SnapshotUpdateProperties struct { - // OsType - the Operating System type. Possible values include: 'Windows', 'Linux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the disk to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. - EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` - // Encryption - Encryption property can be used to encrypt data at rest with customer managed keys or platform managed keys. - Encryption *Encryption `json:"encryption,omitempty"` -} - -// SourceVault the vault id is an Azure Resource Manager Resource id in the form -// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName} -type SourceVault struct { - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// SSHConfiguration SSH configuration for Linux based VMs running on Azure -type SSHConfiguration struct { - // PublicKeys - The list of SSH public keys used to authenticate with linux based VMs. - PublicKeys *[]SSHPublicKey `json:"publicKeys,omitempty"` -} - -// SSHPublicKey contains information about SSH certificate public key and the path on the Linux VM where -// the public key is placed. -type SSHPublicKey struct { - // Path - Specifies the full path on the created VM where ssh public key is stored. If the file already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys - Path *string `json:"path,omitempty"` - // KeyData - SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa format.

    For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - KeyData *string `json:"keyData,omitempty"` -} - -// StorageProfile specifies the storage settings for the virtual machine disks. -type StorageProfile struct { - // ImageReference - Specifies information about the image to use. You can specify information about platform images, marketplace images, or virtual machine images. This element is required when you want to use a platform image, marketplace image, or virtual machine image, but is not used in other creation operations. - ImageReference *ImageReference `json:"imageReference,omitempty"` - // OsDisk - Specifies information about the operating system disk used by the virtual machine.

    For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - OsDisk *OSDisk `json:"osDisk,omitempty"` - // DataDisks - Specifies the parameters that are used to add a data disk to a virtual machine.

    For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - DataDisks *[]DataDisk `json:"dataDisks,omitempty"` -} - -// SubResource ... -type SubResource struct { - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// SubResourceReadOnly ... -type SubResourceReadOnly struct { - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for SubResourceReadOnly. -func (srro SubResourceReadOnly) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// SubResourceWithColocationStatus ... -type SubResourceWithColocationStatus struct { - // ColocationStatus - Describes colocation status of a resource in the Proximity Placement Group. - ColocationStatus *InstanceViewStatus `json:"colocationStatus,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// TargetRegion describes the target region information. -type TargetRegion struct { - // Name - The name of the region. - Name *string `json:"name,omitempty"` - // RegionalReplicaCount - The number of replicas of the Image Version to be created per region. This property is updatable. - RegionalReplicaCount *int32 `json:"regionalReplicaCount,omitempty"` - // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS' - StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` -} - -// TerminateNotificationProfile ... -type TerminateNotificationProfile struct { - // NotBeforeTimeout - Configurable length of time a Virtual Machine being deleted will have to potentially approve the Terminate Scheduled Event before the event is auto approved (timed out). The configuration must be specified in ISO 8601 format, the default value is 5 minutes (PT5M) - NotBeforeTimeout *string `json:"notBeforeTimeout,omitempty"` - // Enable - Specifies whether the Terminate Scheduled event is enabled or disabled. - Enable *bool `json:"enable,omitempty"` -} - -// ThrottledRequestsInput api request input for LogAnalytics getThrottledRequests Api. -type ThrottledRequestsInput struct { - // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. - BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"` - // FromTime - From time of the query - FromTime *date.Time `json:"fromTime,omitempty"` - // ToTime - To time of the query - ToTime *date.Time `json:"toTime,omitempty"` - // GroupByThrottlePolicy - Group query result by Throttle Policy applied. - GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` - // GroupByOperationName - Group query result by Operation Name. - GroupByOperationName *bool `json:"groupByOperationName,omitempty"` - // GroupByResourceName - Group query result by Resource Name. - GroupByResourceName *bool `json:"groupByResourceName,omitempty"` -} - -// UpdateResource the Update Resource model definition. -type UpdateResource struct { - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for UpdateResource. -func (ur UpdateResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ur.Tags != nil { - objectMap["tags"] = ur.Tags - } - return json.Marshal(objectMap) -} - -// UpgradeOperationHistoricalStatusInfo virtual Machine Scale Set OS Upgrade History operation response. -type UpgradeOperationHistoricalStatusInfo struct { - // Properties - READ-ONLY; Information about the properties of the upgrade operation. - Properties *UpgradeOperationHistoricalStatusInfoProperties `json:"properties,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - READ-ONLY; Resource location - Location *string `json:"location,omitempty"` -} - -// MarshalJSON is the custom marshaler for UpgradeOperationHistoricalStatusInfo. -func (uohsi UpgradeOperationHistoricalStatusInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// UpgradeOperationHistoricalStatusInfoProperties describes each OS upgrade on the Virtual Machine Scale -// Set. -type UpgradeOperationHistoricalStatusInfoProperties struct { - // RunningStatus - READ-ONLY; Information about the overall status of the upgrade operation. - RunningStatus *UpgradeOperationHistoryStatus `json:"runningStatus,omitempty"` - // Progress - READ-ONLY; Counts of the VMs in each state. - Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` - // Error - READ-ONLY; Error Details for this upgrade if there are any. - Error *APIError `json:"error,omitempty"` - // StartedBy - READ-ONLY; Invoker of the Upgrade Operation. Possible values include: 'UpgradeOperationInvokerUnknown', 'UpgradeOperationInvokerUser', 'UpgradeOperationInvokerPlatform' - StartedBy UpgradeOperationInvoker `json:"startedBy,omitempty"` - // TargetImageReference - READ-ONLY; Image Reference details - TargetImageReference *ImageReference `json:"targetImageReference,omitempty"` - // RollbackInfo - READ-ONLY; Information about OS rollback if performed - RollbackInfo *RollbackStatusInfo `json:"rollbackInfo,omitempty"` -} - -// MarshalJSON is the custom marshaler for UpgradeOperationHistoricalStatusInfoProperties. -func (uohsip UpgradeOperationHistoricalStatusInfoProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// UpgradeOperationHistoryStatus information about the current running state of the overall upgrade. -type UpgradeOperationHistoryStatus struct { - // Code - READ-ONLY; Code indicating the current status of the upgrade. Possible values include: 'UpgradeStateRollingForward', 'UpgradeStateCancelled', 'UpgradeStateCompleted', 'UpgradeStateFaulted' - Code UpgradeState `json:"code,omitempty"` - // StartTime - READ-ONLY; Start time of the upgrade. - StartTime *date.Time `json:"startTime,omitempty"` - // EndTime - READ-ONLY; End time of the upgrade. - EndTime *date.Time `json:"endTime,omitempty"` -} - -// MarshalJSON is the custom marshaler for UpgradeOperationHistoryStatus. -func (uohs UpgradeOperationHistoryStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// UpgradePolicy describes an upgrade policy - automatic, manual, or rolling. -type UpgradePolicy struct { - // Mode - Specifies the mode of an upgrade to virtual machines in the scale set.

    Possible values are:

    **Manual** - You control the application of updates to virtual machines in the scale set. You do this by using the manualUpgrade action.

    **Automatic** - All virtual machines in the scale set are automatically updated at the same time. Possible values include: 'Automatic', 'Manual', 'Rolling' - Mode UpgradeMode `json:"mode,omitempty"` - // RollingUpgradePolicy - The configuration parameters used while performing a rolling upgrade. - RollingUpgradePolicy *RollingUpgradePolicy `json:"rollingUpgradePolicy,omitempty"` - // AutomaticOSUpgradePolicy - Configuration parameters used for performing automatic OS Upgrade. - AutomaticOSUpgradePolicy *AutomaticOSUpgradePolicy `json:"automaticOSUpgradePolicy,omitempty"` -} - -// Usage describes Compute Resource Usage. -type Usage struct { - // Unit - An enum describing the unit of usage measurement. - Unit *string `json:"unit,omitempty"` - // CurrentValue - The current usage of the resource. - CurrentValue *int32 `json:"currentValue,omitempty"` - // Limit - The maximum permitted usage of the resource. - Limit *int64 `json:"limit,omitempty"` - // Name - The name of the type of usage. - Name *UsageName `json:"name,omitempty"` -} - -// UsageName the Usage Names. -type UsageName struct { - // Value - The name of the resource. - Value *string `json:"value,omitempty"` - // LocalizedValue - The localized name of the resource. - LocalizedValue *string `json:"localizedValue,omitempty"` -} - -// UserArtifactSource the source image from which the Image Version is going to be created. -type UserArtifactSource struct { - // FileName - Required. The fileName of the artifact. - FileName *string `json:"fileName,omitempty"` - // MediaLink - Required. The mediaLink of the artifact, must be a readable storage blob. - MediaLink *string `json:"mediaLink,omitempty"` -} - -// VaultCertificate describes a single certificate reference in a Key Vault, and where the certificate -// should reside on the VM. -type VaultCertificate struct { - // CertificateURL - This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, see [Add a key or secret to the key vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8:

    {
    "data":"",
    "dataType":"pfx",
    "password":""
    } - CertificateURL *string `json:"certificateUrl,omitempty"` - // CertificateStore - For Windows VMs, specifies the certificate store on the Virtual Machine to which the certificate should be added. The specified certificate store is implicitly in the LocalMachine account.

    For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the file name <UppercaseThumbprint>.crt for the X509 certificate file and <UppercaseThumbprint>.prv for private key. Both of these files are .pem formatted. - CertificateStore *string `json:"certificateStore,omitempty"` -} - -// VaultSecretGroup describes a set of certificates which are all in the same Key Vault. -type VaultSecretGroup struct { - // SourceVault - The relative URL of the Key Vault containing all of the certificates in VaultCertificates. - SourceVault *SubResource `json:"sourceVault,omitempty"` - // VaultCertificates - The list of key vault references in SourceVault which contain certificates. - VaultCertificates *[]VaultCertificate `json:"vaultCertificates,omitempty"` -} - -// VirtualHardDisk describes the uri of a disk. -type VirtualHardDisk struct { - // URI - Specifies the virtual hard disk's uri. - URI *string `json:"uri,omitempty"` -} - -// VirtualMachine describes a Virtual Machine. -type VirtualMachine struct { - autorest.Response `json:"-"` - // Plan - Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. - Plan *Plan `json:"plan,omitempty"` - *VirtualMachineProperties `json:"properties,omitempty"` - // Resources - READ-ONLY; The virtual machine child extension resources. - Resources *[]VirtualMachineExtension `json:"resources,omitempty"` - // Identity - The identity of the virtual machine, if configured. - Identity *VirtualMachineIdentity `json:"identity,omitempty"` - // Zones - The virtual machine zones. - Zones *[]string `json:"zones,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualMachine. -func (VM VirtualMachine) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if VM.Plan != nil { - objectMap["plan"] = VM.Plan - } - if VM.VirtualMachineProperties != nil { - objectMap["properties"] = VM.VirtualMachineProperties - } - if VM.Identity != nil { - objectMap["identity"] = VM.Identity - } - if VM.Zones != nil { - objectMap["zones"] = VM.Zones - } - if VM.Location != nil { - objectMap["location"] = VM.Location - } - if VM.Tags != nil { - objectMap["tags"] = VM.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachine struct. -func (VM *VirtualMachine) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "plan": - if v != nil { - var plan Plan - err = json.Unmarshal(*v, &plan) - if err != nil { - return err - } - VM.Plan = &plan - } - case "properties": - if v != nil { - var virtualMachineProperties VirtualMachineProperties - err = json.Unmarshal(*v, &virtualMachineProperties) - if err != nil { - return err - } - VM.VirtualMachineProperties = &virtualMachineProperties - } - case "resources": - if v != nil { - var resources []VirtualMachineExtension - err = json.Unmarshal(*v, &resources) - if err != nil { - return err - } - VM.Resources = &resources - } - case "identity": - if v != nil { - var identity VirtualMachineIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - VM.Identity = &identity - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - VM.Zones = &zones - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - VM.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - VM.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - VM.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - VM.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - VM.Tags = tags - } - } - } - - return nil -} - -// VirtualMachineAgentInstanceView the instance view of the VM Agent running on the virtual machine. -type VirtualMachineAgentInstanceView struct { - // VMAgentVersion - The VM Agent full version. - VMAgentVersion *string `json:"vmAgentVersion,omitempty"` - // ExtensionHandlers - The virtual machine extension handler instance view. - ExtensionHandlers *[]VirtualMachineExtensionHandlerInstanceView `json:"extensionHandlers,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` -} - -// VirtualMachineCaptureParameters capture Virtual Machine parameters. -type VirtualMachineCaptureParameters struct { - // VhdPrefix - The captured virtual hard disk's name prefix. - VhdPrefix *string `json:"vhdPrefix,omitempty"` - // DestinationContainerName - The destination container name. - DestinationContainerName *string `json:"destinationContainerName,omitempty"` - // OverwriteVhds - Specifies whether to overwrite the destination virtual hard disk, in case of conflict. - OverwriteVhds *bool `json:"overwriteVhds,omitempty"` -} - -// VirtualMachineCaptureResult output of virtual machine capture operation. -type VirtualMachineCaptureResult struct { - autorest.Response `json:"-"` - // Schema - READ-ONLY; the schema of the captured virtual machine - Schema *string `json:"$schema,omitempty"` - // ContentVersion - READ-ONLY; the version of the content - ContentVersion *string `json:"contentVersion,omitempty"` - // Parameters - READ-ONLY; parameters of the captured virtual machine - Parameters interface{} `json:"parameters,omitempty"` - // Resources - READ-ONLY; a list of resource items of the captured virtual machine - Resources *[]interface{} `json:"resources,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineCaptureResult. -func (vmcr VirtualMachineCaptureResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmcr.ID != nil { - objectMap["id"] = vmcr.ID - } - return json.Marshal(objectMap) -} - -// VirtualMachineExtension describes a Virtual Machine Extension. -type VirtualMachineExtension struct { - autorest.Response `json:"-"` - *VirtualMachineExtensionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineExtension. -func (vme VirtualMachineExtension) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vme.VirtualMachineExtensionProperties != nil { - objectMap["properties"] = vme.VirtualMachineExtensionProperties - } - if vme.Location != nil { - objectMap["location"] = vme.Location - } - if vme.Tags != nil { - objectMap["tags"] = vme.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtension struct. -func (vme *VirtualMachineExtension) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualMachineExtensionProperties VirtualMachineExtensionProperties - err = json.Unmarshal(*v, &virtualMachineExtensionProperties) - if err != nil { - return err - } - vme.VirtualMachineExtensionProperties = &virtualMachineExtensionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vme.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vme.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vme.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vme.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vme.Tags = tags - } - } - } - - return nil -} - -// VirtualMachineExtensionHandlerInstanceView the instance view of a virtual machine extension handler. -type VirtualMachineExtensionHandlerInstanceView struct { - // Type - Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string `json:"type,omitempty"` - // TypeHandlerVersion - Specifies the version of the script handler. - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` - // Status - The extension handler status. - Status *InstanceViewStatus `json:"status,omitempty"` -} - -// VirtualMachineExtensionImage describes a Virtual Machine Extension Image. -type VirtualMachineExtensionImage struct { - autorest.Response `json:"-"` - *VirtualMachineExtensionImageProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineExtensionImage. -func (vmei VirtualMachineExtensionImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmei.VirtualMachineExtensionImageProperties != nil { - objectMap["properties"] = vmei.VirtualMachineExtensionImageProperties - } - if vmei.Location != nil { - objectMap["location"] = vmei.Location - } - if vmei.Tags != nil { - objectMap["tags"] = vmei.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionImage struct. -func (vmei *VirtualMachineExtensionImage) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualMachineExtensionImageProperties VirtualMachineExtensionImageProperties - err = json.Unmarshal(*v, &virtualMachineExtensionImageProperties) - if err != nil { - return err - } - vmei.VirtualMachineExtensionImageProperties = &virtualMachineExtensionImageProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vmei.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vmei.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vmei.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vmei.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vmei.Tags = tags - } - } - } - - return nil -} - -// VirtualMachineExtensionImageProperties describes the properties of a Virtual Machine Extension Image. -type VirtualMachineExtensionImageProperties struct { - // OperatingSystem - The operating system this extension supports. - OperatingSystem *string `json:"operatingSystem,omitempty"` - // ComputeRole - The type of role (IaaS or PaaS) this extension supports. - ComputeRole *string `json:"computeRole,omitempty"` - // HandlerSchema - The schema defined by publisher, where extension consumers should provide settings in a matching schema. - HandlerSchema *string `json:"handlerSchema,omitempty"` - // VMScaleSetEnabled - Whether the extension can be used on xRP VMScaleSets. By default existing extensions are usable on scalesets, but there might be cases where a publisher wants to explicitly indicate the extension is only enabled for CRP VMs but not VMSS. - VMScaleSetEnabled *bool `json:"vmScaleSetEnabled,omitempty"` - // SupportsMultipleExtensions - Whether the handler can support multiple extensions. - SupportsMultipleExtensions *bool `json:"supportsMultipleExtensions,omitempty"` -} - -// VirtualMachineExtensionInstanceView the instance view of a virtual machine extension. -type VirtualMachineExtensionInstanceView struct { - // Name - The virtual machine extension name. - Name *string `json:"name,omitempty"` - // Type - Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string `json:"type,omitempty"` - // TypeHandlerVersion - Specifies the version of the script handler. - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` - // Substatuses - The resource status information. - Substatuses *[]InstanceViewStatus `json:"substatuses,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` -} - -// VirtualMachineExtensionProperties describes the properties of a Virtual Machine Extension. -type VirtualMachineExtensionProperties struct { - // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. - ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` - // Publisher - The name of the extension handler publisher. - Publisher *string `json:"publisher,omitempty"` - // Type - Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string `json:"type,omitempty"` - // TypeHandlerVersion - Specifies the version of the script handler. - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` - // AutoUpgradeMinorVersion - Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. - AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` - // Settings - Json formatted public settings for the extension. - Settings interface{} `json:"settings,omitempty"` - // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - ProtectedSettings interface{} `json:"protectedSettings,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // InstanceView - The virtual machine extension instance view. - InstanceView *VirtualMachineExtensionInstanceView `json:"instanceView,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineExtensionProperties. -func (vmep VirtualMachineExtensionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmep.ForceUpdateTag != nil { - objectMap["forceUpdateTag"] = vmep.ForceUpdateTag - } - if vmep.Publisher != nil { - objectMap["publisher"] = vmep.Publisher - } - if vmep.Type != nil { - objectMap["type"] = vmep.Type - } - if vmep.TypeHandlerVersion != nil { - objectMap["typeHandlerVersion"] = vmep.TypeHandlerVersion - } - if vmep.AutoUpgradeMinorVersion != nil { - objectMap["autoUpgradeMinorVersion"] = vmep.AutoUpgradeMinorVersion - } - if vmep.Settings != nil { - objectMap["settings"] = vmep.Settings - } - if vmep.ProtectedSettings != nil { - objectMap["protectedSettings"] = vmep.ProtectedSettings - } - if vmep.InstanceView != nil { - objectMap["instanceView"] = vmep.InstanceView - } - return json.Marshal(objectMap) -} - -// VirtualMachineExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualMachineExtensionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineExtensionsCreateOrUpdateFuture.Result. -func (future *VirtualMachineExtensionsCreateOrUpdateFuture) result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vme.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { - vme, err = client.CreateOrUpdateResponder(vme.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsCreateOrUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineExtensionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineExtensionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineExtensionsDeleteFuture.Result. -func (future *VirtualMachineExtensionsDeleteFuture) result(client VirtualMachineExtensionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineExtensionsListResult the List Extension operation response -type VirtualMachineExtensionsListResult struct { - autorest.Response `json:"-"` - // Value - The list of extensions - Value *[]VirtualMachineExtension `json:"value,omitempty"` -} - -// VirtualMachineExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineExtensionsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineExtensionsClient) (VirtualMachineExtension, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineExtensionsUpdateFuture.Result. -func (future *VirtualMachineExtensionsUpdateFuture) result(client VirtualMachineExtensionsClient) (vme VirtualMachineExtension, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vme.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineExtensionsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { - vme, err = client.UpdateResponder(vme.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineExtensionUpdate describes a Virtual Machine Extension. -type VirtualMachineExtensionUpdate struct { - *VirtualMachineExtensionUpdateProperties `json:"properties,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineExtensionUpdate. -func (vmeu VirtualMachineExtensionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmeu.VirtualMachineExtensionUpdateProperties != nil { - objectMap["properties"] = vmeu.VirtualMachineExtensionUpdateProperties - } - if vmeu.Tags != nil { - objectMap["tags"] = vmeu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineExtensionUpdate struct. -func (vmeu *VirtualMachineExtensionUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualMachineExtensionUpdateProperties VirtualMachineExtensionUpdateProperties - err = json.Unmarshal(*v, &virtualMachineExtensionUpdateProperties) - if err != nil { - return err - } - vmeu.VirtualMachineExtensionUpdateProperties = &virtualMachineExtensionUpdateProperties - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vmeu.Tags = tags - } - } - } - - return nil -} - -// VirtualMachineExtensionUpdateProperties describes the properties of a Virtual Machine Extension. -type VirtualMachineExtensionUpdateProperties struct { - // ForceUpdateTag - How the extension handler should be forced to update even if the extension configuration has not changed. - ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` - // Publisher - The name of the extension handler publisher. - Publisher *string `json:"publisher,omitempty"` - // Type - Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string `json:"type,omitempty"` - // TypeHandlerVersion - Specifies the version of the script handler. - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` - // AutoUpgradeMinorVersion - Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. - AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` - // Settings - Json formatted public settings for the extension. - Settings interface{} `json:"settings,omitempty"` - // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - ProtectedSettings interface{} `json:"protectedSettings,omitempty"` -} - -// VirtualMachineHealthStatus the health status of the VM. -type VirtualMachineHealthStatus struct { - // Status - READ-ONLY; The health status information for the VM. - Status *InstanceViewStatus `json:"status,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineHealthStatus. -func (vmhs VirtualMachineHealthStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachineIdentity identity for the virtual machine. -type VirtualMachineIdentity struct { - // PrincipalID - READ-ONLY; The principal id of virtual machine identity. This property will only be provided for a system assigned identity. - PrincipalID *string `json:"principalId,omitempty"` - // TenantID - READ-ONLY; The tenant id associated with the virtual machine. This property will only be provided for a system assigned identity. - TenantID *string `json:"tenantId,omitempty"` - // Type - The type of identity used for the virtual machine. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone' - Type ResourceIdentityType `json:"type,omitempty"` - // UserAssignedIdentities - The list of user identities associated with the Virtual Machine. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - UserAssignedIdentities map[string]*VirtualMachineIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineIdentity. -func (vmi VirtualMachineIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmi.Type != "" { - objectMap["type"] = vmi.Type - } - if vmi.UserAssignedIdentities != nil { - objectMap["userAssignedIdentities"] = vmi.UserAssignedIdentities - } - return json.Marshal(objectMap) -} - -// VirtualMachineIdentityUserAssignedIdentitiesValue ... -type VirtualMachineIdentityUserAssignedIdentitiesValue struct { - // PrincipalID - READ-ONLY; The principal id of user assigned identity. - PrincipalID *string `json:"principalId,omitempty"` - // ClientID - READ-ONLY; The client id of user assigned identity. - ClientID *string `json:"clientId,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineIdentityUserAssignedIdentitiesValue. -func (vmiAiv VirtualMachineIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachineImage describes a Virtual Machine Image. -type VirtualMachineImage struct { - autorest.Response `json:"-"` - *VirtualMachineImageProperties `json:"properties,omitempty"` - // Name - The name of the resource. - Name *string `json:"name,omitempty"` - // Location - The supported Azure location of the resource. - Location *string `json:"location,omitempty"` - // Tags - Specifies the tags that are assigned to the virtual machine. For more information about using tags, see [Using tags to organize your Azure resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). - Tags map[string]*string `json:"tags"` - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineImage. -func (vmi VirtualMachineImage) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmi.VirtualMachineImageProperties != nil { - objectMap["properties"] = vmi.VirtualMachineImageProperties - } - if vmi.Name != nil { - objectMap["name"] = vmi.Name - } - if vmi.Location != nil { - objectMap["location"] = vmi.Location - } - if vmi.Tags != nil { - objectMap["tags"] = vmi.Tags - } - if vmi.ID != nil { - objectMap["id"] = vmi.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineImage struct. -func (vmi *VirtualMachineImage) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var virtualMachineImageProperties VirtualMachineImageProperties - err = json.Unmarshal(*v, &virtualMachineImageProperties) - if err != nil { - return err - } - vmi.VirtualMachineImageProperties = &virtualMachineImageProperties - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vmi.Name = &name - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vmi.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vmi.Tags = tags - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vmi.ID = &ID - } - } - } - - return nil -} - -// VirtualMachineImageProperties describes the properties of a Virtual Machine Image. -type VirtualMachineImageProperties struct { - Plan *PurchasePlan `json:"plan,omitempty"` - OsDiskImage *OSDiskImage `json:"osDiskImage,omitempty"` - DataDiskImages *[]DataDiskImage `json:"dataDiskImages,omitempty"` - AutomaticOSUpgradeProperties *AutomaticOSUpgradeProperties `json:"automaticOSUpgradeProperties,omitempty"` - // HyperVGeneration - Possible values include: 'HyperVGenerationTypesV1', 'HyperVGenerationTypesV2' - HyperVGeneration HyperVGenerationTypes `json:"hyperVGeneration,omitempty"` -} - -// VirtualMachineImageResource virtual machine image resource information. -type VirtualMachineImageResource struct { - // Name - The name of the resource. - Name *string `json:"name,omitempty"` - // Location - The supported Azure location of the resource. - Location *string `json:"location,omitempty"` - // Tags - Specifies the tags that are assigned to the virtual machine. For more information about using tags, see [Using tags to organize your Azure resources](https://docs.microsoft.com/azure/azure-resource-manager/resource-group-using-tags.md). - Tags map[string]*string `json:"tags"` - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineImageResource. -func (vmir VirtualMachineImageResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmir.Name != nil { - objectMap["name"] = vmir.Name - } - if vmir.Location != nil { - objectMap["location"] = vmir.Location - } - if vmir.Tags != nil { - objectMap["tags"] = vmir.Tags - } - if vmir.ID != nil { - objectMap["id"] = vmir.ID - } - return json.Marshal(objectMap) -} - -// VirtualMachineInstanceView the instance view of a virtual machine. -type VirtualMachineInstanceView struct { - autorest.Response `json:"-"` - // PlatformUpdateDomain - Specifies the update domain of the virtual machine. - PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` - // PlatformFaultDomain - Specifies the fault domain of the virtual machine. - PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` - // ComputerName - The computer name assigned to the virtual machine. - ComputerName *string `json:"computerName,omitempty"` - // OsName - The Operating System running on the virtual machine. - OsName *string `json:"osName,omitempty"` - // OsVersion - The version of Operating System running on the virtual machine. - OsVersion *string `json:"osVersion,omitempty"` - // HyperVGeneration - Specifies the HyperVGeneration Type associated with a resource. Possible values include: 'HyperVGenerationTypeV1', 'HyperVGenerationTypeV2' - HyperVGeneration HyperVGenerationType `json:"hyperVGeneration,omitempty"` - // RdpThumbPrint - The Remote desktop certificate thumbprint. - RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` - // VMAgent - The VM Agent running on the virtual machine. - VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` - // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine. - MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` - // Disks - The virtual machine disk information. - Disks *[]DiskInstanceView `json:"disks,omitempty"` - // Extensions - The extensions information. - Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` - // BootDiagnostics - Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status.

    You can easily view the output of your console log.

    Azure also enables you to see a screenshot of the VM from the hypervisor. - BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` -} - -// VirtualMachineListResult the List Virtual Machine operation response. -type VirtualMachineListResult struct { - autorest.Response `json:"-"` - // Value - The list of virtual machines. - Value *[]VirtualMachine `json:"value,omitempty"` - // NextLink - The URI to fetch the next page of VMs. Call ListNext() with this URI to fetch the next page of Virtual Machines. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualMachineListResultIterator provides access to a complete listing of VirtualMachine values. -type VirtualMachineListResultIterator struct { - i int - page VirtualMachineListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualMachineListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualMachineListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualMachineListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualMachineListResultIterator) Response() VirtualMachineListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualMachineListResultIterator) Value() VirtualMachine { - if !iter.page.NotDone() { - return VirtualMachine{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualMachineListResultIterator type. -func NewVirtualMachineListResultIterator(page VirtualMachineListResultPage) VirtualMachineListResultIterator { - return VirtualMachineListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vmlr VirtualMachineListResult) IsEmpty() bool { - return vmlr.Value == nil || len(*vmlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vmlr VirtualMachineListResult) hasNextLink() bool { - return vmlr.NextLink != nil && len(*vmlr.NextLink) != 0 -} - -// virtualMachineListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vmlr VirtualMachineListResult) virtualMachineListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vmlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vmlr.NextLink))) -} - -// VirtualMachineListResultPage contains a page of VirtualMachine values. -type VirtualMachineListResultPage struct { - fn func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error) - vmlr VirtualMachineListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualMachineListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vmlr) - if err != nil { - return err - } - page.vmlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualMachineListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualMachineListResultPage) NotDone() bool { - return !page.vmlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualMachineListResultPage) Response() VirtualMachineListResult { - return page.vmlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualMachineListResultPage) Values() []VirtualMachine { - if page.vmlr.IsEmpty() { - return nil - } - return *page.vmlr.Value -} - -// Creates a new instance of the VirtualMachineListResultPage type. -func NewVirtualMachineListResultPage(cur VirtualMachineListResult, getNextPage func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error)) VirtualMachineListResultPage { - return VirtualMachineListResultPage{ - fn: getNextPage, - vmlr: cur, - } -} - -// VirtualMachineProperties describes the properties of a Virtual Machine. -type VirtualMachineProperties struct { - // HardwareProfile - Specifies the hardware settings for the virtual machine. - HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` - // StorageProfile - Specifies the storage settings for the virtual machine disks. - StorageProfile *StorageProfile `json:"storageProfile,omitempty"` - // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the virtual machine. - AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` - // OsProfile - Specifies the operating system settings used while creating the virtual machine. Some of the settings cannot be changed once VM is provisioned. - OsProfile *OSProfile `json:"osProfile,omitempty"` - // NetworkProfile - Specifies the network interfaces of the virtual machine. - NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` - // DiagnosticsProfile - Specifies the boot diagnostic settings state.

    Minimum api-version: 2015-06-15. - DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` - // AvailabilitySet - Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Manage the availability of virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).

    For more information on Azure planned maintenance, see [Planned maintenance for virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)

    Currently, a VM can only be added to availability set at creation time. The availability set to which the VM is being added should be under the same resource group as the availability set resource. An existing VM cannot be added to an availability set.

    This property cannot exist along with a non-null properties.virtualMachineScaleSet reference. - AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` - // VirtualMachineScaleSet - Specifies information about the virtual machine scale set that the virtual machine should be assigned to. Virtual machines specified in the same virtual machine scale set are allocated to different nodes to maximize availability. Currently, a VM can only be added to virtual machine scale set at creation time. An existing VM cannot be added to a virtual machine scale set.

    This property cannot exist along with a non-null properties.availabilitySet reference.

    Minimum api‐version: 2019‐03‐01 - VirtualMachineScaleSet *SubResource `json:"virtualMachineScaleSet,omitempty"` - // ProximityPlacementGroup - Specifies information about the proximity placement group that the virtual machine should be assigned to.

    Minimum api-version: 2018-04-01. - ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` - // Priority - Specifies the priority for the virtual machine.

    Minimum api-version: 2019-03-01. Possible values include: 'Regular', 'Low', 'Spot' - Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` - // EvictionPolicy - Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set.

    For Azure Spot virtual machines, the only supported value is 'Deallocate' and the minimum api-version is 2019-03-01.

    For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete' - EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` - // BillingProfile - Specifies the billing related details of a Azure Spot virtual machine.

    Minimum api-version: 2019-03-01. - BillingProfile *BillingProfile `json:"billingProfile,omitempty"` - // Host - Specifies information about the dedicated host that the virtual machine resides in.

    Minimum api-version: 2018-10-01. - Host *SubResource `json:"host,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // InstanceView - READ-ONLY; The virtual machine instance view. - InstanceView *VirtualMachineInstanceView `json:"instanceView,omitempty"` - // LicenseType - Specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system.

    Possible values are:

    Windows_Client

    Windows_Server

    If this element is included in a request for an update, the value must match the initial value. This value cannot be updated.

    For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)

    Minimum api-version: 2015-06-15 - LicenseType *string `json:"licenseType,omitempty"` - // VMID - READ-ONLY; Specifies the VM unique ID which is a 128-bits identifier that is encoded and stored in all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands. - VMID *string `json:"vmId,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineProperties. -func (vmp VirtualMachineProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmp.HardwareProfile != nil { - objectMap["hardwareProfile"] = vmp.HardwareProfile - } - if vmp.StorageProfile != nil { - objectMap["storageProfile"] = vmp.StorageProfile - } - if vmp.AdditionalCapabilities != nil { - objectMap["additionalCapabilities"] = vmp.AdditionalCapabilities - } - if vmp.OsProfile != nil { - objectMap["osProfile"] = vmp.OsProfile - } - if vmp.NetworkProfile != nil { - objectMap["networkProfile"] = vmp.NetworkProfile - } - if vmp.DiagnosticsProfile != nil { - objectMap["diagnosticsProfile"] = vmp.DiagnosticsProfile - } - if vmp.AvailabilitySet != nil { - objectMap["availabilitySet"] = vmp.AvailabilitySet - } - if vmp.VirtualMachineScaleSet != nil { - objectMap["virtualMachineScaleSet"] = vmp.VirtualMachineScaleSet - } - if vmp.ProximityPlacementGroup != nil { - objectMap["proximityPlacementGroup"] = vmp.ProximityPlacementGroup - } - if vmp.Priority != "" { - objectMap["priority"] = vmp.Priority - } - if vmp.EvictionPolicy != "" { - objectMap["evictionPolicy"] = vmp.EvictionPolicy - } - if vmp.BillingProfile != nil { - objectMap["billingProfile"] = vmp.BillingProfile - } - if vmp.Host != nil { - objectMap["host"] = vmp.Host - } - if vmp.LicenseType != nil { - objectMap["licenseType"] = vmp.LicenseType - } - return json.Marshal(objectMap) -} - -// VirtualMachineReimageParameters parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk -// will always be reimaged -type VirtualMachineReimageParameters struct { - // TempDisk - Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. - TempDisk *bool `json:"tempDisk,omitempty"` -} - -// VirtualMachineScaleSet describes a Virtual Machine Scale Set. -type VirtualMachineScaleSet struct { - autorest.Response `json:"-"` - // Sku - The virtual machine scale set sku. - Sku *Sku `json:"sku,omitempty"` - // Plan - Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. - Plan *Plan `json:"plan,omitempty"` - *VirtualMachineScaleSetProperties `json:"properties,omitempty"` - // Identity - The identity of the virtual machine scale set, if configured. - Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` - // Zones - The virtual machine scale set zones. NOTE: Availability zones can only be set when you create the scale set. - Zones *[]string `json:"zones,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSet. -func (vmss VirtualMachineScaleSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmss.Sku != nil { - objectMap["sku"] = vmss.Sku - } - if vmss.Plan != nil { - objectMap["plan"] = vmss.Plan - } - if vmss.VirtualMachineScaleSetProperties != nil { - objectMap["properties"] = vmss.VirtualMachineScaleSetProperties - } - if vmss.Identity != nil { - objectMap["identity"] = vmss.Identity - } - if vmss.Zones != nil { - objectMap["zones"] = vmss.Zones - } - if vmss.Location != nil { - objectMap["location"] = vmss.Location - } - if vmss.Tags != nil { - objectMap["tags"] = vmss.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSet struct. -func (vmss *VirtualMachineScaleSet) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - vmss.Sku = &sku - } - case "plan": - if v != nil { - var plan Plan - err = json.Unmarshal(*v, &plan) - if err != nil { - return err - } - vmss.Plan = &plan - } - case "properties": - if v != nil { - var virtualMachineScaleSetProperties VirtualMachineScaleSetProperties - err = json.Unmarshal(*v, &virtualMachineScaleSetProperties) - if err != nil { - return err - } - vmss.VirtualMachineScaleSetProperties = &virtualMachineScaleSetProperties - } - case "identity": - if v != nil { - var identity VirtualMachineScaleSetIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - vmss.Identity = &identity - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - vmss.Zones = &zones - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vmss.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vmss.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vmss.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vmss.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vmss.Tags = tags - } - } - } - - return nil -} - -// VirtualMachineScaleSetDataDisk describes a virtual machine scale set data disk. -type VirtualMachineScaleSetDataDisk struct { - // Name - The disk name. - Name *string `json:"name,omitempty"` - // Lun - Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM. - Lun *int32 `json:"lun,omitempty"` - // Caching - Specifies the caching requirements.

    Possible values are:

    **None**

    **ReadOnly**

    **ReadWrite**

    Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` - // CreateOption - The create option. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' - CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` - // DiskSizeGB - Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.

    This value cannot be larger than 1023 GB - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // ManagedDisk - The managed disk parameters. - ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` - // DiskIOPSReadWrite - Specifies the Read-Write IOPS for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB. - DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` - // DiskMBpsReadWrite - Specifies the bandwidth in MB per second for the managed disk. Should be used only when StorageAccountType is UltraSSD_LRS. If not specified, a default value would be assigned based on diskSizeGB. - DiskMBpsReadWrite *int64 `json:"diskMBpsReadWrite,omitempty"` -} - -// VirtualMachineScaleSetExtension describes a Virtual Machine Scale Set Extension. -type VirtualMachineScaleSetExtension struct { - autorest.Response `json:"-"` - // Name - The name of the extension. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtension. -func (vmsse VirtualMachineScaleSetExtension) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmsse.Name != nil { - objectMap["name"] = vmsse.Name - } - if vmsse.VirtualMachineScaleSetExtensionProperties != nil { - objectMap["properties"] = vmsse.VirtualMachineScaleSetExtensionProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtension struct. -func (vmsse *VirtualMachineScaleSetExtension) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vmsse.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vmsse.Type = &typeVar - } - case "properties": - if v != nil { - var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties - err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties) - if err != nil { - return err - } - vmsse.VirtualMachineScaleSetExtensionProperties = &virtualMachineScaleSetExtensionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vmsse.ID = &ID - } - } - } - - return nil -} - -// VirtualMachineScaleSetExtensionListResult the List VM scale set extension operation response. -type VirtualMachineScaleSetExtensionListResult struct { - autorest.Response `json:"-"` - // Value - The list of VM scale set extensions. - Value *[]VirtualMachineScaleSetExtension `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of VM scale set extensions. Call ListNext() with this to fetch the next page of VM scale set extensions. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualMachineScaleSetExtensionListResultIterator provides access to a complete listing of -// VirtualMachineScaleSetExtension values. -type VirtualMachineScaleSetExtensionListResultIterator struct { - i int - page VirtualMachineScaleSetExtensionListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualMachineScaleSetExtensionListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualMachineScaleSetExtensionListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualMachineScaleSetExtensionListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualMachineScaleSetExtensionListResultIterator) Response() VirtualMachineScaleSetExtensionListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualMachineScaleSetExtensionListResultIterator) Value() VirtualMachineScaleSetExtension { - if !iter.page.NotDone() { - return VirtualMachineScaleSetExtension{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualMachineScaleSetExtensionListResultIterator type. -func NewVirtualMachineScaleSetExtensionListResultIterator(page VirtualMachineScaleSetExtensionListResultPage) VirtualMachineScaleSetExtensionListResultIterator { - return VirtualMachineScaleSetExtensionListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vmsselr VirtualMachineScaleSetExtensionListResult) IsEmpty() bool { - return vmsselr.Value == nil || len(*vmsselr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vmsselr VirtualMachineScaleSetExtensionListResult) hasNextLink() bool { - return vmsselr.NextLink != nil && len(*vmsselr.NextLink) != 0 -} - -// virtualMachineScaleSetExtensionListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vmsselr VirtualMachineScaleSetExtensionListResult) virtualMachineScaleSetExtensionListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vmsselr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vmsselr.NextLink))) -} - -// VirtualMachineScaleSetExtensionListResultPage contains a page of VirtualMachineScaleSetExtension values. -type VirtualMachineScaleSetExtensionListResultPage struct { - fn func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error) - vmsselr VirtualMachineScaleSetExtensionListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualMachineScaleSetExtensionListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vmsselr) - if err != nil { - return err - } - page.vmsselr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualMachineScaleSetExtensionListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualMachineScaleSetExtensionListResultPage) NotDone() bool { - return !page.vmsselr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualMachineScaleSetExtensionListResultPage) Response() VirtualMachineScaleSetExtensionListResult { - return page.vmsselr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualMachineScaleSetExtensionListResultPage) Values() []VirtualMachineScaleSetExtension { - if page.vmsselr.IsEmpty() { - return nil - } - return *page.vmsselr.Value -} - -// Creates a new instance of the VirtualMachineScaleSetExtensionListResultPage type. -func NewVirtualMachineScaleSetExtensionListResultPage(cur VirtualMachineScaleSetExtensionListResult, getNextPage func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error)) VirtualMachineScaleSetExtensionListResultPage { - return VirtualMachineScaleSetExtensionListResultPage{ - fn: getNextPage, - vmsselr: cur, - } -} - -// VirtualMachineScaleSetExtensionProfile describes a virtual machine scale set extension profile. -type VirtualMachineScaleSetExtensionProfile struct { - // Extensions - The virtual machine scale set child extension resources. - Extensions *[]VirtualMachineScaleSetExtension `json:"extensions,omitempty"` -} - -// VirtualMachineScaleSetExtensionProperties describes the properties of a Virtual Machine Scale Set -// Extension. -type VirtualMachineScaleSetExtensionProperties struct { - // ForceUpdateTag - If a value is provided and is different from the previous value, the extension handler will be forced to update even if the extension configuration has not changed. - ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` - // Publisher - The name of the extension handler publisher. - Publisher *string `json:"publisher,omitempty"` - // Type - Specifies the type of the extension; an example is "CustomScriptExtension". - Type *string `json:"type,omitempty"` - // TypeHandlerVersion - Specifies the version of the script handler. - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` - // AutoUpgradeMinorVersion - Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. - AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` - // Settings - Json formatted public settings for the extension. - Settings interface{} `json:"settings,omitempty"` - // ProtectedSettings - The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - ProtectedSettings interface{} `json:"protectedSettings,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // ProvisionAfterExtensions - Collection of extension names after which this extension needs to be provisioned. - ProvisionAfterExtensions *[]string `json:"provisionAfterExtensions,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionProperties. -func (vmssep VirtualMachineScaleSetExtensionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssep.ForceUpdateTag != nil { - objectMap["forceUpdateTag"] = vmssep.ForceUpdateTag - } - if vmssep.Publisher != nil { - objectMap["publisher"] = vmssep.Publisher - } - if vmssep.Type != nil { - objectMap["type"] = vmssep.Type - } - if vmssep.TypeHandlerVersion != nil { - objectMap["typeHandlerVersion"] = vmssep.TypeHandlerVersion - } - if vmssep.AutoUpgradeMinorVersion != nil { - objectMap["autoUpgradeMinorVersion"] = vmssep.AutoUpgradeMinorVersion - } - if vmssep.Settings != nil { - objectMap["settings"] = vmssep.Settings - } - if vmssep.ProtectedSettings != nil { - objectMap["protectedSettings"] = vmssep.ProtectedSettings - } - if vmssep.ProvisionAfterExtensions != nil { - objectMap["provisionAfterExtensions"] = vmssep.ProvisionAfterExtensions - } - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualMachineScaleSetExtensionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetExtensionsCreateOrUpdateFuture.Result. -func (future *VirtualMachineScaleSetExtensionsCreateOrUpdateFuture) result(client VirtualMachineScaleSetExtensionsClient) (vmsse VirtualMachineScaleSetExtension, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmsse.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmsse.Response.Response, err = future.GetResult(sender); err == nil && vmsse.Response.Response.StatusCode != http.StatusNoContent { - vmsse, err = client.CreateOrUpdateResponder(vmsse.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture", "Result", vmsse.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSetExtensionsDeleteFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualMachineScaleSetExtensionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetExtensionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetExtensionsDeleteFuture.Result. -func (future *VirtualMachineScaleSetExtensionsDeleteFuture) result(client VirtualMachineScaleSetExtensionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetExtensionsUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualMachineScaleSetExtensionsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetExtensionsClient) (VirtualMachineScaleSetExtension, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetExtensionsUpdateFuture.Result. -func (future *VirtualMachineScaleSetExtensionsUpdateFuture) result(client VirtualMachineScaleSetExtensionsClient) (vmsse VirtualMachineScaleSetExtension, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmsse.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetExtensionsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmsse.Response.Response, err = future.GetResult(sender); err == nil && vmsse.Response.Response.StatusCode != http.StatusNoContent { - vmsse, err = client.UpdateResponder(vmsse.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsUpdateFuture", "Result", vmsse.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSetExtensionUpdate describes a Virtual Machine Scale Set Extension. -type VirtualMachineScaleSetExtensionUpdate struct { - // Name - READ-ONLY; The name of the extension. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetExtensionUpdate. -func (vmsseu VirtualMachineScaleSetExtensionUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmsseu.VirtualMachineScaleSetExtensionProperties != nil { - objectMap["properties"] = vmsseu.VirtualMachineScaleSetExtensionProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetExtensionUpdate struct. -func (vmsseu *VirtualMachineScaleSetExtensionUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vmsseu.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vmsseu.Type = &typeVar - } - case "properties": - if v != nil { - var virtualMachineScaleSetExtensionProperties VirtualMachineScaleSetExtensionProperties - err = json.Unmarshal(*v, &virtualMachineScaleSetExtensionProperties) - if err != nil { - return err - } - vmsseu.VirtualMachineScaleSetExtensionProperties = &virtualMachineScaleSetExtensionProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vmsseu.ID = &ID - } - } - } - - return nil -} - -// VirtualMachineScaleSetIdentity identity for the virtual machine scale set. -type VirtualMachineScaleSetIdentity struct { - // PrincipalID - READ-ONLY; The principal id of virtual machine scale set identity. This property will only be provided for a system assigned identity. - PrincipalID *string `json:"principalId,omitempty"` - // TenantID - READ-ONLY; The tenant id associated with the virtual machine scale set. This property will only be provided for a system assigned identity. - TenantID *string `json:"tenantId,omitempty"` - // Type - The type of identity used for the virtual machine scale set. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine scale set. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone' - Type ResourceIdentityType `json:"type,omitempty"` - // UserAssignedIdentities - The list of user identities associated with the virtual machine scale set. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - UserAssignedIdentities map[string]*VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIdentity. -func (vmssi VirtualMachineScaleSetIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssi.Type != "" { - objectMap["type"] = vmssi.Type - } - if vmssi.UserAssignedIdentities != nil { - objectMap["userAssignedIdentities"] = vmssi.UserAssignedIdentities - } - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue ... -type VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue struct { - // PrincipalID - READ-ONLY; The principal id of user assigned identity. - PrincipalID *string `json:"principalId,omitempty"` - // ClientID - READ-ONLY; The client id of user assigned identity. - ClientID *string `json:"clientId,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue. -func (vmssiAiv VirtualMachineScaleSetIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetInstanceView the instance view of a virtual machine scale set. -type VirtualMachineScaleSetInstanceView struct { - autorest.Response `json:"-"` - // VirtualMachine - READ-ONLY; The instance view status summary for the virtual machine scale set. - VirtualMachine *VirtualMachineScaleSetInstanceViewStatusesSummary `json:"virtualMachine,omitempty"` - // Extensions - READ-ONLY; The extensions information. - Extensions *[]VirtualMachineScaleSetVMExtensionsSummary `json:"extensions,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceView. -func (vmssiv VirtualMachineScaleSetInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssiv.Statuses != nil { - objectMap["statuses"] = vmssiv.Statuses - } - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetInstanceViewStatusesSummary instance view statuses summary for virtual machines of -// a virtual machine scale set. -type VirtualMachineScaleSetInstanceViewStatusesSummary struct { - // StatusesSummary - READ-ONLY; The extensions information. - StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetInstanceViewStatusesSummary. -func (vmssivss VirtualMachineScaleSetInstanceViewStatusesSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetIPConfiguration describes a virtual machine scale set network profile's IP -// configuration. -type VirtualMachineScaleSetIPConfiguration struct { - // Name - The IP configuration name. - Name *string `json:"name,omitempty"` - *VirtualMachineScaleSetIPConfigurationProperties `json:"properties,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetIPConfiguration. -func (vmssic VirtualMachineScaleSetIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssic.Name != nil { - objectMap["name"] = vmssic.Name - } - if vmssic.VirtualMachineScaleSetIPConfigurationProperties != nil { - objectMap["properties"] = vmssic.VirtualMachineScaleSetIPConfigurationProperties - } - if vmssic.ID != nil { - objectMap["id"] = vmssic.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetIPConfiguration struct. -func (vmssic *VirtualMachineScaleSetIPConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vmssic.Name = &name - } - case "properties": - if v != nil { - var virtualMachineScaleSetIPConfigurationProperties VirtualMachineScaleSetIPConfigurationProperties - err = json.Unmarshal(*v, &virtualMachineScaleSetIPConfigurationProperties) - if err != nil { - return err - } - vmssic.VirtualMachineScaleSetIPConfigurationProperties = &virtualMachineScaleSetIPConfigurationProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vmssic.ID = &ID - } - } - } - - return nil -} - -// VirtualMachineScaleSetIPConfigurationProperties describes a virtual machine scale set network profile's -// IP configuration properties. -type VirtualMachineScaleSetIPConfigurationProperties struct { - // Subnet - Specifies the identifier of the subnet. - Subnet *APIEntityReference `json:"subnet,omitempty"` - // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. - Primary *bool `json:"primary,omitempty"` - // PublicIPAddressConfiguration - The publicIPAddressConfiguration. - PublicIPAddressConfiguration *VirtualMachineScaleSetPublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` - // PrivateIPAddressVersion - Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' - PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` - // ApplicationGatewayBackendAddressPools - Specifies an array of references to backend address pools of application gateways. A scale set can reference backend address pools of multiple application gateways. Multiple scale sets cannot use the same application gateway. - ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` - // ApplicationSecurityGroups - Specifies an array of references to application security group. - ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` - // LoadBalancerBackendAddressPools - Specifies an array of references to backend address pools of load balancers. A scale set can reference backend address pools of one public and one internal load balancer. Multiple scale sets cannot use the same load balancer. - LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` - // LoadBalancerInboundNatPools - Specifies an array of references to inbound Nat pools of the load balancers. A scale set can reference inbound nat pools of one public and one internal load balancer. Multiple scale sets cannot use the same load balancer - LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` -} - -// VirtualMachineScaleSetIPTag contains the IP tag associated with the public IP address. -type VirtualMachineScaleSetIPTag struct { - // IPTagType - IP tag type. Example: FirstPartyUsage. - IPTagType *string `json:"ipTagType,omitempty"` - // Tag - IP tag associated with the public IP. Example: SQL, Storage etc. - Tag *string `json:"tag,omitempty"` -} - -// VirtualMachineScaleSetListOSUpgradeHistory list of Virtual Machine Scale Set OS Upgrade History -// operation response. -type VirtualMachineScaleSetListOSUpgradeHistory struct { - autorest.Response `json:"-"` - // Value - The list of OS upgrades performed on the virtual machine scale set. - Value *[]UpgradeOperationHistoricalStatusInfo `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of OS Upgrade History. Call ListNext() with this to fetch the next page of history of upgrades. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualMachineScaleSetListOSUpgradeHistoryIterator provides access to a complete listing of -// UpgradeOperationHistoricalStatusInfo values. -type VirtualMachineScaleSetListOSUpgradeHistoryIterator struct { - i int - page VirtualMachineScaleSetListOSUpgradeHistoryPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualMachineScaleSetListOSUpgradeHistoryIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) Response() VirtualMachineScaleSetListOSUpgradeHistory { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualMachineScaleSetListOSUpgradeHistoryIterator) Value() UpgradeOperationHistoricalStatusInfo { - if !iter.page.NotDone() { - return UpgradeOperationHistoricalStatusInfo{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryIterator type. -func NewVirtualMachineScaleSetListOSUpgradeHistoryIterator(page VirtualMachineScaleSetListOSUpgradeHistoryPage) VirtualMachineScaleSetListOSUpgradeHistoryIterator { - return VirtualMachineScaleSetListOSUpgradeHistoryIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) IsEmpty() bool { - return vmsslouh.Value == nil || len(*vmsslouh.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) hasNextLink() bool { - return vmsslouh.NextLink != nil && len(*vmsslouh.NextLink) != 0 -} - -// virtualMachineScaleSetListOSUpgradeHistoryPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vmsslouh VirtualMachineScaleSetListOSUpgradeHistory) virtualMachineScaleSetListOSUpgradeHistoryPreparer(ctx context.Context) (*http.Request, error) { - if !vmsslouh.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vmsslouh.NextLink))) -} - -// VirtualMachineScaleSetListOSUpgradeHistoryPage contains a page of UpgradeOperationHistoricalStatusInfo -// values. -type VirtualMachineScaleSetListOSUpgradeHistoryPage struct { - fn func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error) - vmsslouh VirtualMachineScaleSetListOSUpgradeHistory -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListOSUpgradeHistoryPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vmsslouh) - if err != nil { - return err - } - page.vmsslouh = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualMachineScaleSetListOSUpgradeHistoryPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) NotDone() bool { - return !page.vmsslouh.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Response() VirtualMachineScaleSetListOSUpgradeHistory { - return page.vmsslouh -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualMachineScaleSetListOSUpgradeHistoryPage) Values() []UpgradeOperationHistoricalStatusInfo { - if page.vmsslouh.IsEmpty() { - return nil - } - return *page.vmsslouh.Value -} - -// Creates a new instance of the VirtualMachineScaleSetListOSUpgradeHistoryPage type. -func NewVirtualMachineScaleSetListOSUpgradeHistoryPage(cur VirtualMachineScaleSetListOSUpgradeHistory, getNextPage func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error)) VirtualMachineScaleSetListOSUpgradeHistoryPage { - return VirtualMachineScaleSetListOSUpgradeHistoryPage{ - fn: getNextPage, - vmsslouh: cur, - } -} - -// VirtualMachineScaleSetListResult the List Virtual Machine operation response. -type VirtualMachineScaleSetListResult struct { - autorest.Response `json:"-"` - // Value - The list of virtual machine scale sets. - Value *[]VirtualMachineScaleSet `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of VMSS. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualMachineScaleSetListResultIterator provides access to a complete listing of VirtualMachineScaleSet -// values. -type VirtualMachineScaleSetListResultIterator struct { - i int - page VirtualMachineScaleSetListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualMachineScaleSetListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualMachineScaleSetListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualMachineScaleSetListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualMachineScaleSetListResultIterator) Response() VirtualMachineScaleSetListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualMachineScaleSetListResultIterator) Value() VirtualMachineScaleSet { - if !iter.page.NotDone() { - return VirtualMachineScaleSet{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualMachineScaleSetListResultIterator type. -func NewVirtualMachineScaleSetListResultIterator(page VirtualMachineScaleSetListResultPage) VirtualMachineScaleSetListResultIterator { - return VirtualMachineScaleSetListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vmsslr VirtualMachineScaleSetListResult) IsEmpty() bool { - return vmsslr.Value == nil || len(*vmsslr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vmsslr VirtualMachineScaleSetListResult) hasNextLink() bool { - return vmsslr.NextLink != nil && len(*vmsslr.NextLink) != 0 -} - -// virtualMachineScaleSetListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vmsslr VirtualMachineScaleSetListResult) virtualMachineScaleSetListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vmsslr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vmsslr.NextLink))) -} - -// VirtualMachineScaleSetListResultPage contains a page of VirtualMachineScaleSet values. -type VirtualMachineScaleSetListResultPage struct { - fn func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error) - vmsslr VirtualMachineScaleSetListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualMachineScaleSetListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vmsslr) - if err != nil { - return err - } - page.vmsslr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualMachineScaleSetListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualMachineScaleSetListResultPage) NotDone() bool { - return !page.vmsslr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualMachineScaleSetListResultPage) Response() VirtualMachineScaleSetListResult { - return page.vmsslr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualMachineScaleSetListResultPage) Values() []VirtualMachineScaleSet { - if page.vmsslr.IsEmpty() { - return nil - } - return *page.vmsslr.Value -} - -// Creates a new instance of the VirtualMachineScaleSetListResultPage type. -func NewVirtualMachineScaleSetListResultPage(cur VirtualMachineScaleSetListResult, getNextPage func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error)) VirtualMachineScaleSetListResultPage { - return VirtualMachineScaleSetListResultPage{ - fn: getNextPage, - vmsslr: cur, - } -} - -// VirtualMachineScaleSetListSkusResult the Virtual Machine Scale Set List Skus operation response. -type VirtualMachineScaleSetListSkusResult struct { - autorest.Response `json:"-"` - // Value - The list of skus available for the virtual machine scale set. - Value *[]VirtualMachineScaleSetSku `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of Virtual Machine Scale Set Skus. Call ListNext() with this to fetch the next page of VMSS Skus. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualMachineScaleSetListSkusResultIterator provides access to a complete listing of -// VirtualMachineScaleSetSku values. -type VirtualMachineScaleSetListSkusResultIterator struct { - i int - page VirtualMachineScaleSetListSkusResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualMachineScaleSetListSkusResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualMachineScaleSetListSkusResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualMachineScaleSetListSkusResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualMachineScaleSetListSkusResultIterator) Response() VirtualMachineScaleSetListSkusResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualMachineScaleSetListSkusResultIterator) Value() VirtualMachineScaleSetSku { - if !iter.page.NotDone() { - return VirtualMachineScaleSetSku{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualMachineScaleSetListSkusResultIterator type. -func NewVirtualMachineScaleSetListSkusResultIterator(page VirtualMachineScaleSetListSkusResultPage) VirtualMachineScaleSetListSkusResultIterator { - return VirtualMachineScaleSetListSkusResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vmsslsr VirtualMachineScaleSetListSkusResult) IsEmpty() bool { - return vmsslsr.Value == nil || len(*vmsslsr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vmsslsr VirtualMachineScaleSetListSkusResult) hasNextLink() bool { - return vmsslsr.NextLink != nil && len(*vmsslsr.NextLink) != 0 -} - -// virtualMachineScaleSetListSkusResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vmsslsr VirtualMachineScaleSetListSkusResult) virtualMachineScaleSetListSkusResultPreparer(ctx context.Context) (*http.Request, error) { - if !vmsslsr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vmsslsr.NextLink))) -} - -// VirtualMachineScaleSetListSkusResultPage contains a page of VirtualMachineScaleSetSku values. -type VirtualMachineScaleSetListSkusResultPage struct { - fn func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error) - vmsslsr VirtualMachineScaleSetListSkusResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualMachineScaleSetListSkusResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListSkusResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vmsslsr) - if err != nil { - return err - } - page.vmsslsr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualMachineScaleSetListSkusResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualMachineScaleSetListSkusResultPage) NotDone() bool { - return !page.vmsslsr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualMachineScaleSetListSkusResultPage) Response() VirtualMachineScaleSetListSkusResult { - return page.vmsslsr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualMachineScaleSetListSkusResultPage) Values() []VirtualMachineScaleSetSku { - if page.vmsslsr.IsEmpty() { - return nil - } - return *page.vmsslsr.Value -} - -// Creates a new instance of the VirtualMachineScaleSetListSkusResultPage type. -func NewVirtualMachineScaleSetListSkusResultPage(cur VirtualMachineScaleSetListSkusResult, getNextPage func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error)) VirtualMachineScaleSetListSkusResultPage { - return VirtualMachineScaleSetListSkusResultPage{ - fn: getNextPage, - vmsslsr: cur, - } -} - -// VirtualMachineScaleSetListWithLinkResult the List Virtual Machine operation response. -type VirtualMachineScaleSetListWithLinkResult struct { - autorest.Response `json:"-"` - // Value - The list of virtual machine scale sets. - Value *[]VirtualMachineScaleSet `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of Virtual Machine Scale Sets. Call ListNext() with this to fetch the next page of Virtual Machine Scale Sets. - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualMachineScaleSetListWithLinkResultIterator provides access to a complete listing of -// VirtualMachineScaleSet values. -type VirtualMachineScaleSetListWithLinkResultIterator struct { - i int - page VirtualMachineScaleSetListWithLinkResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualMachineScaleSetListWithLinkResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualMachineScaleSetListWithLinkResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualMachineScaleSetListWithLinkResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualMachineScaleSetListWithLinkResultIterator) Response() VirtualMachineScaleSetListWithLinkResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualMachineScaleSetListWithLinkResultIterator) Value() VirtualMachineScaleSet { - if !iter.page.NotDone() { - return VirtualMachineScaleSet{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultIterator type. -func NewVirtualMachineScaleSetListWithLinkResultIterator(page VirtualMachineScaleSetListWithLinkResultPage) VirtualMachineScaleSetListWithLinkResultIterator { - return VirtualMachineScaleSetListWithLinkResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) IsEmpty() bool { - return vmsslwlr.Value == nil || len(*vmsslwlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) hasNextLink() bool { - return vmsslwlr.NextLink != nil && len(*vmsslwlr.NextLink) != 0 -} - -// virtualMachineScaleSetListWithLinkResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vmsslwlr VirtualMachineScaleSetListWithLinkResult) virtualMachineScaleSetListWithLinkResultPreparer(ctx context.Context) (*http.Request, error) { - if !vmsslwlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vmsslwlr.NextLink))) -} - -// VirtualMachineScaleSetListWithLinkResultPage contains a page of VirtualMachineScaleSet values. -type VirtualMachineScaleSetListWithLinkResultPage struct { - fn func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error) - vmsslwlr VirtualMachineScaleSetListWithLinkResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualMachineScaleSetListWithLinkResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetListWithLinkResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vmsslwlr) - if err != nil { - return err - } - page.vmsslwlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualMachineScaleSetListWithLinkResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualMachineScaleSetListWithLinkResultPage) NotDone() bool { - return !page.vmsslwlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualMachineScaleSetListWithLinkResultPage) Response() VirtualMachineScaleSetListWithLinkResult { - return page.vmsslwlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualMachineScaleSetListWithLinkResultPage) Values() []VirtualMachineScaleSet { - if page.vmsslwlr.IsEmpty() { - return nil - } - return *page.vmsslwlr.Value -} - -// Creates a new instance of the VirtualMachineScaleSetListWithLinkResultPage type. -func NewVirtualMachineScaleSetListWithLinkResultPage(cur VirtualMachineScaleSetListWithLinkResult, getNextPage func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error)) VirtualMachineScaleSetListWithLinkResultPage { - return VirtualMachineScaleSetListWithLinkResultPage{ - fn: getNextPage, - vmsslwlr: cur, - } -} - -// VirtualMachineScaleSetManagedDiskParameters describes the parameters of a ScaleSet managed disk. -type VirtualMachineScaleSetManagedDiskParameters struct { - // StorageAccountType - Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk. Possible values include: 'StorageAccountTypesStandardLRS', 'StorageAccountTypesPremiumLRS', 'StorageAccountTypesStandardSSDLRS', 'StorageAccountTypesUltraSSDLRS' - StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` - // DiskEncryptionSet - Specifies the customer managed disk encryption set resource id for the managed disk. - DiskEncryptionSet *DiskEncryptionSetParameters `json:"diskEncryptionSet,omitempty"` -} - -// VirtualMachineScaleSetNetworkConfiguration describes a virtual machine scale set network profile's -// network configurations. -type VirtualMachineScaleSetNetworkConfiguration struct { - // Name - The network configuration name. - Name *string `json:"name,omitempty"` - *VirtualMachineScaleSetNetworkConfigurationProperties `json:"properties,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetNetworkConfiguration. -func (vmssnc VirtualMachineScaleSetNetworkConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssnc.Name != nil { - objectMap["name"] = vmssnc.Name - } - if vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties != nil { - objectMap["properties"] = vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties - } - if vmssnc.ID != nil { - objectMap["id"] = vmssnc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetNetworkConfiguration struct. -func (vmssnc *VirtualMachineScaleSetNetworkConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vmssnc.Name = &name - } - case "properties": - if v != nil { - var virtualMachineScaleSetNetworkConfigurationProperties VirtualMachineScaleSetNetworkConfigurationProperties - err = json.Unmarshal(*v, &virtualMachineScaleSetNetworkConfigurationProperties) - if err != nil { - return err - } - vmssnc.VirtualMachineScaleSetNetworkConfigurationProperties = &virtualMachineScaleSetNetworkConfigurationProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vmssnc.ID = &ID - } - } - } - - return nil -} - -// VirtualMachineScaleSetNetworkConfigurationDNSSettings describes a virtual machines scale sets network -// configuration's DNS settings. -type VirtualMachineScaleSetNetworkConfigurationDNSSettings struct { - // DNSServers - List of DNS servers IP addresses - DNSServers *[]string `json:"dnsServers,omitempty"` -} - -// VirtualMachineScaleSetNetworkConfigurationProperties describes a virtual machine scale set network -// profile's IP configuration. -type VirtualMachineScaleSetNetworkConfigurationProperties struct { - // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface. - Primary *bool `json:"primary,omitempty"` - // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - // NetworkSecurityGroup - The network security group. - NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` - // DNSSettings - The dns settings to be applied on the network interfaces. - DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` - // IPConfigurations - Specifies the IP configurations of the network interface. - IPConfigurations *[]VirtualMachineScaleSetIPConfiguration `json:"ipConfigurations,omitempty"` - // EnableIPForwarding - Whether IP forwarding enabled on this NIC. - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` -} - -// VirtualMachineScaleSetNetworkProfile describes a virtual machine scale set network profile. -type VirtualMachineScaleSetNetworkProfile struct { - // HealthProbe - A reference to a load balancer probe used to determine the health of an instance in the virtual machine scale set. The reference will be in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. - HealthProbe *APIEntityReference `json:"healthProbe,omitempty"` - // NetworkInterfaceConfigurations - The list of network configurations. - NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` -} - -// VirtualMachineScaleSetOSDisk describes a virtual machine scale set operating system disk. -type VirtualMachineScaleSetOSDisk struct { - // Name - The disk name. - Name *string `json:"name,omitempty"` - // Caching - Specifies the caching requirements.

    Possible values are:

    **None**

    **ReadOnly**

    **ReadWrite**

    Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` - // CreateOption - Specifies how the virtual machines in the scale set should be created.

    The only allowed value is: **FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' - CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` - // DiffDiskSettings - Specifies the ephemeral disk Settings for the operating system disk used by the virtual machine scale set. - DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` - // DiskSizeGB - Specifies the size of the operating system disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.

    This value cannot be larger than 1023 GB - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // OsType - This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD.

    Possible values are:

    **Windows**

    **Linux**. Possible values include: 'Windows', 'Linux' - OsType OperatingSystemTypes `json:"osType,omitempty"` - // Image - Specifies information about the unmanaged user image to base the scale set on. - Image *VirtualHardDisk `json:"image,omitempty"` - // VhdContainers - Specifies the container urls that are used to store operating system disks for the scale set. - VhdContainers *[]string `json:"vhdContainers,omitempty"` - // ManagedDisk - The managed disk parameters. - ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` -} - -// VirtualMachineScaleSetOSProfile describes a virtual machine scale set OS profile. -type VirtualMachineScaleSetOSProfile struct { - // ComputerNamePrefix - Specifies the computer name prefix for all of the virtual machines in the scale set. Computer name prefixes must be 1 to 15 characters long. - ComputerNamePrefix *string `json:"computerNamePrefix,omitempty"` - // AdminUsername - Specifies the name of the administrator account.

    **Windows-only restriction:** Cannot end in "."

    **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5".

    **Minimum-length (Linux):** 1 character

    **Max-length (Linux):** 64 characters

    **Max-length (Windows):** 20 characters

  • For root access to the Linux VM, see [Using root privileges on Linux virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • For a list of built-in system users on Linux that should not be used in this field, see [Selecting User Names for Linux on Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) - AdminUsername *string `json:"adminUsername,omitempty"` - // AdminPassword - Specifies the password of the administrator account.

    **Minimum-length (Windows):** 8 characters

    **Minimum-length (Linux):** 6 characters

    **Max-length (Windows):** 123 characters

    **Max-length (Linux):** 72 characters

    **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled
    Has lower characters
    Has upper characters
    Has a digit
    Has a special character (Regex match [\W_])

    **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!"

    For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows VM](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-reset-rdp?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)

    For resetting root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-vmaccess-extension?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#reset-root-password) - AdminPassword *string `json:"adminPassword,omitempty"` - // CustomData - Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array is 65535 bytes.

    For using cloud-init for your VM, see [Using cloud-init to customize a Linux VM during creation](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-using-cloud-init?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) - CustomData *string `json:"customData,omitempty"` - // WindowsConfiguration - Specifies Windows operating system settings on the virtual machine. - WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` - // LinuxConfiguration - Specifies the Linux operating system settings on the virtual machine.

    For a list of supported Linux distributions, see [Linux on Azure-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)

    For running non-endorsed distributions, see [Information for Non-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` - // Secrets - Specifies set of certificates that should be installed onto the virtual machines in the scale set. - Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` -} - -// VirtualMachineScaleSetProperties describes the properties of a Virtual Machine Scale Set. -type VirtualMachineScaleSetProperties struct { - // UpgradePolicy - The upgrade policy. - UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` - // AutomaticRepairsPolicy - Policy for automatic repairs. - AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` - // VirtualMachineProfile - The virtual machine profile. - VirtualMachineProfile *VirtualMachineScaleSetVMProfile `json:"virtualMachineProfile,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. - Overprovision *bool `json:"overprovision,omitempty"` - // DoNotRunExtensionsOnOverprovisionedVMs - When Overprovision is enabled, extensions are launched only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions do not run on the extra overprovisioned VMs. - DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` - // UniqueID - READ-ONLY; Specifies the ID which uniquely identifies a Virtual Machine Scale Set. - UniqueID *string `json:"uniqueId,omitempty"` - // SinglePlacementGroup - When true this limits the scale set to a single placement group, of max size 100 virtual machines. - SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` - // ZoneBalance - Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage. - ZoneBalance *bool `json:"zoneBalance,omitempty"` - // PlatformFaultDomainCount - Fault Domain count for each placement group. - PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` - // ProximityPlacementGroup - Specifies information about the proximity placement group that the virtual machine scale set should be assigned to.

    Minimum api-version: 2018-04-01. - ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` - // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to support attaching managed data disks with UltraSSD_LRS storage account type. - AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` - // ScaleInPolicy - Specifies the scale-in policy that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled-in. - ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetProperties. -func (vmssp VirtualMachineScaleSetProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssp.UpgradePolicy != nil { - objectMap["upgradePolicy"] = vmssp.UpgradePolicy - } - if vmssp.AutomaticRepairsPolicy != nil { - objectMap["automaticRepairsPolicy"] = vmssp.AutomaticRepairsPolicy - } - if vmssp.VirtualMachineProfile != nil { - objectMap["virtualMachineProfile"] = vmssp.VirtualMachineProfile - } - if vmssp.Overprovision != nil { - objectMap["overprovision"] = vmssp.Overprovision - } - if vmssp.DoNotRunExtensionsOnOverprovisionedVMs != nil { - objectMap["doNotRunExtensionsOnOverprovisionedVMs"] = vmssp.DoNotRunExtensionsOnOverprovisionedVMs - } - if vmssp.SinglePlacementGroup != nil { - objectMap["singlePlacementGroup"] = vmssp.SinglePlacementGroup - } - if vmssp.ZoneBalance != nil { - objectMap["zoneBalance"] = vmssp.ZoneBalance - } - if vmssp.PlatformFaultDomainCount != nil { - objectMap["platformFaultDomainCount"] = vmssp.PlatformFaultDomainCount - } - if vmssp.ProximityPlacementGroup != nil { - objectMap["proximityPlacementGroup"] = vmssp.ProximityPlacementGroup - } - if vmssp.AdditionalCapabilities != nil { - objectMap["additionalCapabilities"] = vmssp.AdditionalCapabilities - } - if vmssp.ScaleInPolicy != nil { - objectMap["scaleInPolicy"] = vmssp.ScaleInPolicy - } - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetPublicIPAddressConfiguration describes a virtual machines scale set IP -// Configuration's PublicIPAddress configuration -type VirtualMachineScaleSetPublicIPAddressConfiguration struct { - // Name - The publicIP address configuration name. - Name *string `json:"name,omitempty"` - *VirtualMachineScaleSetPublicIPAddressConfigurationProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetPublicIPAddressConfiguration. -func (vmsspiac VirtualMachineScaleSetPublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmsspiac.Name != nil { - objectMap["name"] = vmsspiac.Name - } - if vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties != nil { - objectMap["properties"] = vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetPublicIPAddressConfiguration struct. -func (vmsspiac *VirtualMachineScaleSetPublicIPAddressConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vmsspiac.Name = &name - } - case "properties": - if v != nil { - var virtualMachineScaleSetPublicIPAddressConfigurationProperties VirtualMachineScaleSetPublicIPAddressConfigurationProperties - err = json.Unmarshal(*v, &virtualMachineScaleSetPublicIPAddressConfigurationProperties) - if err != nil { - return err - } - vmsspiac.VirtualMachineScaleSetPublicIPAddressConfigurationProperties = &virtualMachineScaleSetPublicIPAddressConfigurationProperties - } - } - } - - return nil -} - -// VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings describes a virtual machines scale sets -// network configuration's DNS settings. -type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings struct { - // DomainNameLabel - The Domain name label.The concatenation of the domain name label and vm index will be the domain name labels of the PublicIPAddress resources that will be created - DomainNameLabel *string `json:"domainNameLabel,omitempty"` -} - -// VirtualMachineScaleSetPublicIPAddressConfigurationProperties describes a virtual machines scale set IP -// Configuration's PublicIPAddress configuration -type VirtualMachineScaleSetPublicIPAddressConfigurationProperties struct { - // IdleTimeoutInMinutes - The idle timeout of the public IP address. - IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` - // DNSSettings - The dns settings to be applied on the publicIP addresses . - DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` - // IPTags - The list of IP tags associated with the public IP address. - IPTags *[]VirtualMachineScaleSetIPTag `json:"ipTags,omitempty"` - // PublicIPPrefix - The PublicIPPrefix from which to allocate publicIP addresses. - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - // PublicIPAddressVersion - Available from Api-Version 2019-07-01 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' - PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"` -} - -// VirtualMachineScaleSetReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. -type VirtualMachineScaleSetReimageParameters struct { - // InstanceIds - The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - InstanceIds *[]string `json:"instanceIds,omitempty"` - // TempDisk - Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. - TempDisk *bool `json:"tempDisk,omitempty"` -} - -// VirtualMachineScaleSetRollingUpgradesCancelFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualMachineScaleSetRollingUpgradesCancelFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetRollingUpgradesCancelFuture.Result. -func (future *VirtualMachineScaleSetRollingUpgradesCancelFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesCancelFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesCancelFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture an abstraction for monitoring and -// retrieving the results of a long-running operation. -type VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture.Result. -func (future *VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture an abstraction for monitoring and retrieving -// the results of a long-running operation. -type VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetRollingUpgradesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture.Result. -func (future *VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture) result(client VirtualMachineScaleSetRollingUpgradesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualMachineScaleSetsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsCreateOrUpdateFuture.Result. -func (future *VirtualMachineScaleSetsCreateOrUpdateFuture) result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmss.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmss.Response.Response, err = future.GetResult(sender); err == nil && vmss.Response.Response.StatusCode != http.StatusNoContent { - vmss, err = client.CreateOrUpdateResponder(vmss.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsCreateOrUpdateFuture", "Result", vmss.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSetsDeallocateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsDeallocateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsDeallocateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsDeallocateFuture.Result. -func (future *VirtualMachineScaleSetsDeallocateFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeallocateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeallocateFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsDeleteFuture.Result. -func (future *VirtualMachineScaleSetsDeleteFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsDeleteInstancesFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualMachineScaleSetsDeleteInstancesFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsDeleteInstancesFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsDeleteInstancesFuture.Result. -func (future *VirtualMachineScaleSetsDeleteInstancesFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsDeleteInstancesFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsDeleteInstancesFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetSku describes an available virtual machine scale set sku. -type VirtualMachineScaleSetSku struct { - // ResourceType - READ-ONLY; The type of resource the sku applies to. - ResourceType *string `json:"resourceType,omitempty"` - // Sku - READ-ONLY; The Sku. - Sku *Sku `json:"sku,omitempty"` - // Capacity - READ-ONLY; Specifies the number of virtual machines in the scale set. - Capacity *VirtualMachineScaleSetSkuCapacity `json:"capacity,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetSku. -func (vmsss VirtualMachineScaleSetSku) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetSkuCapacity describes scaling information of a sku. -type VirtualMachineScaleSetSkuCapacity struct { - // Minimum - READ-ONLY; The minimum capacity. - Minimum *int64 `json:"minimum,omitempty"` - // Maximum - READ-ONLY; The maximum capacity that can be set. - Maximum *int64 `json:"maximum,omitempty"` - // DefaultCapacity - READ-ONLY; The default capacity. - DefaultCapacity *int64 `json:"defaultCapacity,omitempty"` - // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'VirtualMachineScaleSetSkuScaleTypeAutomatic', 'VirtualMachineScaleSetSkuScaleTypeNone' - ScaleType VirtualMachineScaleSetSkuScaleType `json:"scaleType,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetSkuCapacity. -func (vmsssc VirtualMachineScaleSetSkuCapacity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetsPerformMaintenanceFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type VirtualMachineScaleSetsPerformMaintenanceFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsPerformMaintenanceFuture.Result. -func (future *VirtualMachineScaleSetsPerformMaintenanceFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsPerformMaintenanceFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsPowerOffFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsPowerOffFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsPowerOffFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsPowerOffFuture.Result. -func (future *VirtualMachineScaleSetsPowerOffFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsPowerOffFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsPowerOffFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsRedeployFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsRedeployFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsRedeployFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsRedeployFuture.Result. -func (future *VirtualMachineScaleSetsRedeployFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRedeployFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsRedeployFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsReimageAllFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsReimageAllFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsReimageAllFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsReimageAllFuture.Result. -func (future *VirtualMachineScaleSetsReimageAllFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageAllFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsReimageAllFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsReimageFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsReimageFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsReimageFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsReimageFuture.Result. -func (future *VirtualMachineScaleSetsReimageFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsReimageFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsReimageFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsRestartFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsRestartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsRestartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsRestartFuture.Result. -func (future *VirtualMachineScaleSetsRestartFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsRestartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsRestartFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetsStartFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsStartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsStartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsStartFuture.Result. -func (future *VirtualMachineScaleSetsStartFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsStartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsStartFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetStorageProfile describes a virtual machine scale set storage profile. -type VirtualMachineScaleSetStorageProfile struct { - // ImageReference - Specifies information about the image to use. You can specify information about platform images, marketplace images, or virtual machine images. This element is required when you want to use a platform image, marketplace image, or virtual machine image, but is not used in other creation operations. - ImageReference *ImageReference `json:"imageReference,omitempty"` - // OsDisk - Specifies information about the operating system disk used by the virtual machines in the scale set.

    For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - OsDisk *VirtualMachineScaleSetOSDisk `json:"osDisk,omitempty"` - // DataDisks - Specifies the parameters that are used to add data disks to the virtual machines in the scale set.

    For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` -} - -// VirtualMachineScaleSetsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (VirtualMachineScaleSet, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsUpdateFuture.Result. -func (future *VirtualMachineScaleSetsUpdateFuture) result(client VirtualMachineScaleSetsClient) (vmss VirtualMachineScaleSet, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmss.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmss.Response.Response, err = future.GetResult(sender); err == nil && vmss.Response.Response.StatusCode != http.StatusNoContent { - vmss, err = client.UpdateResponder(vmss.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateFuture", "Result", vmss.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSetsUpdateInstancesFuture an abstraction for monitoring and retrieving the results of -// a long-running operation. -type VirtualMachineScaleSetsUpdateInstancesFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetsUpdateInstancesFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetsUpdateInstancesFuture.Result. -func (future *VirtualMachineScaleSetsUpdateInstancesFuture) result(client VirtualMachineScaleSetsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsUpdateInstancesFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetsUpdateInstancesFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetUpdate describes a Virtual Machine Scale Set. -type VirtualMachineScaleSetUpdate struct { - // Sku - The virtual machine scale set sku. - Sku *Sku `json:"sku,omitempty"` - // Plan - The purchase plan when deploying a virtual machine scale set from VM Marketplace images. - Plan *Plan `json:"plan,omitempty"` - *VirtualMachineScaleSetUpdateProperties `json:"properties,omitempty"` - // Identity - The identity of the virtual machine scale set, if configured. - Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdate. -func (vmssu VirtualMachineScaleSetUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssu.Sku != nil { - objectMap["sku"] = vmssu.Sku - } - if vmssu.Plan != nil { - objectMap["plan"] = vmssu.Plan - } - if vmssu.VirtualMachineScaleSetUpdateProperties != nil { - objectMap["properties"] = vmssu.VirtualMachineScaleSetUpdateProperties - } - if vmssu.Identity != nil { - objectMap["identity"] = vmssu.Identity - } - if vmssu.Tags != nil { - objectMap["tags"] = vmssu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdate struct. -func (vmssu *VirtualMachineScaleSetUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - vmssu.Sku = &sku - } - case "plan": - if v != nil { - var plan Plan - err = json.Unmarshal(*v, &plan) - if err != nil { - return err - } - vmssu.Plan = &plan - } - case "properties": - if v != nil { - var virtualMachineScaleSetUpdateProperties VirtualMachineScaleSetUpdateProperties - err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateProperties) - if err != nil { - return err - } - vmssu.VirtualMachineScaleSetUpdateProperties = &virtualMachineScaleSetUpdateProperties - } - case "identity": - if v != nil { - var identity VirtualMachineScaleSetIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - vmssu.Identity = &identity - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vmssu.Tags = tags - } - } - } - - return nil -} - -// VirtualMachineScaleSetUpdateIPConfiguration describes a virtual machine scale set network profile's IP -// configuration. -type VirtualMachineScaleSetUpdateIPConfiguration struct { - // Name - The IP configuration name. - Name *string `json:"name,omitempty"` - *VirtualMachineScaleSetUpdateIPConfigurationProperties `json:"properties,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdateIPConfiguration. -func (vmssuic VirtualMachineScaleSetUpdateIPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssuic.Name != nil { - objectMap["name"] = vmssuic.Name - } - if vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties != nil { - objectMap["properties"] = vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties - } - if vmssuic.ID != nil { - objectMap["id"] = vmssuic.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdateIPConfiguration struct. -func (vmssuic *VirtualMachineScaleSetUpdateIPConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vmssuic.Name = &name - } - case "properties": - if v != nil { - var virtualMachineScaleSetUpdateIPConfigurationProperties VirtualMachineScaleSetUpdateIPConfigurationProperties - err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateIPConfigurationProperties) - if err != nil { - return err - } - vmssuic.VirtualMachineScaleSetUpdateIPConfigurationProperties = &virtualMachineScaleSetUpdateIPConfigurationProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vmssuic.ID = &ID - } - } - } - - return nil -} - -// VirtualMachineScaleSetUpdateIPConfigurationProperties describes a virtual machine scale set network -// profile's IP configuration properties. NOTE: The subnet of a scale set may be modified as long as the -// original subnet and the new subnet are in the same virtual network. -type VirtualMachineScaleSetUpdateIPConfigurationProperties struct { - // Subnet - The subnet. - Subnet *APIEntityReference `json:"subnet,omitempty"` - // Primary - Specifies the primary IP Configuration in case the network interface has more than one IP Configuration. - Primary *bool `json:"primary,omitempty"` - // PublicIPAddressConfiguration - The publicIPAddressConfiguration. - PublicIPAddressConfiguration *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` - // PrivateIPAddressVersion - Available from Api-Version 2017-03-30 onwards, it represents whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values are: 'IPv4' and 'IPv6'. Possible values include: 'IPv4', 'IPv6' - PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` - // ApplicationGatewayBackendAddressPools - The application gateway backend address pools. - ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` - // ApplicationSecurityGroups - Specifies an array of references to application security group. - ApplicationSecurityGroups *[]SubResource `json:"applicationSecurityGroups,omitempty"` - // LoadBalancerBackendAddressPools - The load balancer backend address pools. - LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` - // LoadBalancerInboundNatPools - The load balancer inbound nat pools. - LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` -} - -// VirtualMachineScaleSetUpdateNetworkConfiguration describes a virtual machine scale set network profile's -// network configurations. -type VirtualMachineScaleSetUpdateNetworkConfiguration struct { - // Name - The network configuration name. - Name *string `json:"name,omitempty"` - *VirtualMachineScaleSetUpdateNetworkConfigurationProperties `json:"properties,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdateNetworkConfiguration. -func (vmssunc VirtualMachineScaleSetUpdateNetworkConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssunc.Name != nil { - objectMap["name"] = vmssunc.Name - } - if vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties != nil { - objectMap["properties"] = vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties - } - if vmssunc.ID != nil { - objectMap["id"] = vmssunc.ID - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdateNetworkConfiguration struct. -func (vmssunc *VirtualMachineScaleSetUpdateNetworkConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vmssunc.Name = &name - } - case "properties": - if v != nil { - var virtualMachineScaleSetUpdateNetworkConfigurationProperties VirtualMachineScaleSetUpdateNetworkConfigurationProperties - err = json.Unmarshal(*v, &virtualMachineScaleSetUpdateNetworkConfigurationProperties) - if err != nil { - return err - } - vmssunc.VirtualMachineScaleSetUpdateNetworkConfigurationProperties = &virtualMachineScaleSetUpdateNetworkConfigurationProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vmssunc.ID = &ID - } - } - } - - return nil -} - -// VirtualMachineScaleSetUpdateNetworkConfigurationProperties describes a virtual machine scale set -// updatable network profile's IP configuration.Use this object for updating network profile's IP -// Configuration. -type VirtualMachineScaleSetUpdateNetworkConfigurationProperties struct { - // Primary - Whether this is a primary NIC on a virtual machine. - Primary *bool `json:"primary,omitempty"` - // EnableAcceleratedNetworking - Specifies whether the network interface is accelerated networking-enabled. - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - // NetworkSecurityGroup - The network security group. - NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` - // DNSSettings - The dns settings to be applied on the network interfaces. - DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` - // IPConfigurations - The virtual machine scale set IP Configuration. - IPConfigurations *[]VirtualMachineScaleSetUpdateIPConfiguration `json:"ipConfigurations,omitempty"` - // EnableIPForwarding - Whether IP forwarding enabled on this NIC. - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` -} - -// VirtualMachineScaleSetUpdateNetworkProfile describes a virtual machine scale set network profile. -type VirtualMachineScaleSetUpdateNetworkProfile struct { - // HealthProbe - A reference to a load balancer probe used to determine the health of an instance in the virtual machine scale set. The reference will be in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}'. - HealthProbe *APIEntityReference `json:"healthProbe,omitempty"` - // NetworkInterfaceConfigurations - The list of network configurations. - NetworkInterfaceConfigurations *[]VirtualMachineScaleSetUpdateNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` -} - -// VirtualMachineScaleSetUpdateOSDisk describes virtual machine scale set operating system disk Update -// Object. This should be used for Updating VMSS OS Disk. -type VirtualMachineScaleSetUpdateOSDisk struct { - // Caching - The caching type. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite' - Caching CachingTypes `json:"caching,omitempty"` - // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. - WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` - // DiskSizeGB - Specifies the size of the operating system disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.

    This value cannot be larger than 1023 GB - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // Image - The Source User Image VirtualHardDisk. This VirtualHardDisk will be copied before using it to attach to the Virtual Machine. If SourceImage is provided, the destination VirtualHardDisk should not exist. - Image *VirtualHardDisk `json:"image,omitempty"` - // VhdContainers - The list of virtual hard disk container uris. - VhdContainers *[]string `json:"vhdContainers,omitempty"` - // ManagedDisk - The managed disk parameters. - ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` -} - -// VirtualMachineScaleSetUpdateOSProfile describes a virtual machine scale set OS profile. -type VirtualMachineScaleSetUpdateOSProfile struct { - // CustomData - A base-64 encoded string of custom data. - CustomData *string `json:"customData,omitempty"` - // WindowsConfiguration - The Windows Configuration of the OS profile. - WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` - // LinuxConfiguration - The Linux Configuration of the OS profile. - LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` - // Secrets - The List of certificates for addition to the VM. - Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` -} - -// VirtualMachineScaleSetUpdateProperties describes the properties of a Virtual Machine Scale Set. -type VirtualMachineScaleSetUpdateProperties struct { - // UpgradePolicy - The upgrade policy. - UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` - // AutomaticRepairsPolicy - Policy for automatic repairs. - AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"` - // VirtualMachineProfile - The virtual machine profile. - VirtualMachineProfile *VirtualMachineScaleSetUpdateVMProfile `json:"virtualMachineProfile,omitempty"` - // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. - Overprovision *bool `json:"overprovision,omitempty"` - // DoNotRunExtensionsOnOverprovisionedVMs - When Overprovision is enabled, extensions are launched only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions do not run on the extra overprovisioned VMs. - DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` - // SinglePlacementGroup - When true this limits the scale set to a single placement group, of max size 100 virtual machines.NOTE: If singlePlacementGroup is true, it may be modified to false. However, if singlePlacementGroup is false, it may not be modified to true. - SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` - // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the Virtual Machines in the Virtual Machine Scale Set. For instance: whether the Virtual Machines have the capability to support attaching managed data disks with UltraSSD_LRS storage account type. - AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` - // ScaleInPolicy - Specifies the scale-in policy that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled-in. - ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"` - // ProximityPlacementGroup - Specifies information about the proximity placement group that the virtual machine scale set should be assigned to.

    Minimum api-version: 2018-04-01. - ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"` -} - -// VirtualMachineScaleSetUpdatePublicIPAddressConfiguration describes a virtual machines scale set IP -// Configuration's PublicIPAddress configuration -type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct { - // Name - The publicIP address configuration name. - Name *string `json:"name,omitempty"` - *VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetUpdatePublicIPAddressConfiguration. -func (vmssupiac VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssupiac.Name != nil { - objectMap["name"] = vmssupiac.Name - } - if vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties != nil { - objectMap["properties"] = vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct. -func (vmssupiac *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vmssupiac.Name = &name - } - case "properties": - if v != nil { - var virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties - err = json.Unmarshal(*v, &virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties) - if err != nil { - return err - } - vmssupiac.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties = &virtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties - } - } - } - - return nil -} - -// VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties describes a virtual machines scale -// set IP Configuration's PublicIPAddress configuration -type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties struct { - // IdleTimeoutInMinutes - The idle timeout of the public IP address. - IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` - // DNSSettings - The dns settings to be applied on the publicIP addresses . - DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` -} - -// VirtualMachineScaleSetUpdateStorageProfile describes a virtual machine scale set storage profile. -type VirtualMachineScaleSetUpdateStorageProfile struct { - // ImageReference - The image reference. - ImageReference *ImageReference `json:"imageReference,omitempty"` - // OsDisk - The OS disk. - OsDisk *VirtualMachineScaleSetUpdateOSDisk `json:"osDisk,omitempty"` - // DataDisks - The data disks. - DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` -} - -// VirtualMachineScaleSetUpdateVMProfile describes a virtual machine scale set virtual machine profile. -type VirtualMachineScaleSetUpdateVMProfile struct { - // OsProfile - The virtual machine scale set OS profile. - OsProfile *VirtualMachineScaleSetUpdateOSProfile `json:"osProfile,omitempty"` - // StorageProfile - The virtual machine scale set storage profile. - StorageProfile *VirtualMachineScaleSetUpdateStorageProfile `json:"storageProfile,omitempty"` - // NetworkProfile - The virtual machine scale set network profile. - NetworkProfile *VirtualMachineScaleSetUpdateNetworkProfile `json:"networkProfile,omitempty"` - // DiagnosticsProfile - The virtual machine scale set diagnostics profile. - DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` - // ExtensionProfile - The virtual machine scale set extension profile. - ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` - // LicenseType - The license type, which is for bring your own license scenario. - LicenseType *string `json:"licenseType,omitempty"` - // BillingProfile - Specifies the billing related details of a Azure Spot VMSS.

    Minimum api-version: 2019-03-01. - BillingProfile *BillingProfile `json:"billingProfile,omitempty"` - // ScheduledEventsProfile - Specifies Scheduled Event related configurations. - ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` -} - -// VirtualMachineScaleSetVM describes a virtual machine scale set virtual machine. -type VirtualMachineScaleSetVM struct { - autorest.Response `json:"-"` - // InstanceID - READ-ONLY; The virtual machine instance ID. - InstanceID *string `json:"instanceId,omitempty"` - // Sku - READ-ONLY; The virtual machine SKU. - Sku *Sku `json:"sku,omitempty"` - *VirtualMachineScaleSetVMProperties `json:"properties,omitempty"` - // Plan - Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. - Plan *Plan `json:"plan,omitempty"` - // Resources - READ-ONLY; The virtual machine child extension resources. - Resources *[]VirtualMachineExtension `json:"resources,omitempty"` - // Zones - READ-ONLY; The virtual machine zones. - Zones *[]string `json:"zones,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - Resource location - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVM. -func (vmssv VirtualMachineScaleSetVM) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssv.VirtualMachineScaleSetVMProperties != nil { - objectMap["properties"] = vmssv.VirtualMachineScaleSetVMProperties - } - if vmssv.Plan != nil { - objectMap["plan"] = vmssv.Plan - } - if vmssv.Location != nil { - objectMap["location"] = vmssv.Location - } - if vmssv.Tags != nil { - objectMap["tags"] = vmssv.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineScaleSetVM struct. -func (vmssv *VirtualMachineScaleSetVM) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "instanceId": - if v != nil { - var instanceID string - err = json.Unmarshal(*v, &instanceID) - if err != nil { - return err - } - vmssv.InstanceID = &instanceID - } - case "sku": - if v != nil { - var sku Sku - err = json.Unmarshal(*v, &sku) - if err != nil { - return err - } - vmssv.Sku = &sku - } - case "properties": - if v != nil { - var virtualMachineScaleSetVMProperties VirtualMachineScaleSetVMProperties - err = json.Unmarshal(*v, &virtualMachineScaleSetVMProperties) - if err != nil { - return err - } - vmssv.VirtualMachineScaleSetVMProperties = &virtualMachineScaleSetVMProperties - } - case "plan": - if v != nil { - var plan Plan - err = json.Unmarshal(*v, &plan) - if err != nil { - return err - } - vmssv.Plan = &plan - } - case "resources": - if v != nil { - var resources []VirtualMachineExtension - err = json.Unmarshal(*v, &resources) - if err != nil { - return err - } - vmssv.Resources = &resources - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - vmssv.Zones = &zones - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vmssv.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vmssv.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vmssv.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vmssv.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vmssv.Tags = tags - } - } - } - - return nil -} - -// VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMExtensionsClient) (VirtualMachineExtension, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture.Result. -func (future *VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (vme VirtualMachineExtension, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vme.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { - vme, err = client.CreateOrUpdateResponder(vme.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSetVMExtensionsDeleteFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type VirtualMachineScaleSetVMExtensionsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMExtensionsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMExtensionsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMExtensionsDeleteFuture.Result. -func (future *VirtualMachineScaleSetVMExtensionsDeleteFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMExtensionsSummary extensions summary for virtual machines of a virtual machine -// scale set. -type VirtualMachineScaleSetVMExtensionsSummary struct { - // Name - READ-ONLY; The extension name. - Name *string `json:"name,omitempty"` - // StatusesSummary - READ-ONLY; The extensions information. - StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMExtensionsSummary. -func (vmssves VirtualMachineScaleSetVMExtensionsSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetVMExtensionsUpdateFuture an abstraction for monitoring and retrieving the results -// of a long-running operation. -type VirtualMachineScaleSetVMExtensionsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMExtensionsClient) (VirtualMachineExtension, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMExtensionsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMExtensionsUpdateFuture.Result. -func (future *VirtualMachineScaleSetVMExtensionsUpdateFuture) result(client VirtualMachineScaleSetVMExtensionsClient) (vme VirtualMachineExtension, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vme.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMExtensionsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vme.Response.Response, err = future.GetResult(sender); err == nil && vme.Response.Response.StatusCode != http.StatusNoContent { - vme, err = client.UpdateResponder(vme.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsUpdateFuture", "Result", vme.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSetVMInstanceIDs specifies a list of virtual machine instance IDs from the VM scale -// set. -type VirtualMachineScaleSetVMInstanceIDs struct { - // InstanceIds - The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation being performed on all virtual machines in the virtual machine scale set. - InstanceIds *[]string `json:"instanceIds,omitempty"` -} - -// VirtualMachineScaleSetVMInstanceRequiredIDs specifies a list of virtual machine instance IDs from the VM -// scale set. -type VirtualMachineScaleSetVMInstanceRequiredIDs struct { - // InstanceIds - The virtual machine scale set instance ids. - InstanceIds *[]string `json:"instanceIds,omitempty"` -} - -// VirtualMachineScaleSetVMInstanceView the instance view of a virtual machine scale set VM. -type VirtualMachineScaleSetVMInstanceView struct { - autorest.Response `json:"-"` - // PlatformUpdateDomain - The Update Domain count. - PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` - // PlatformFaultDomain - The Fault Domain count. - PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` - // RdpThumbPrint - The Remote desktop certificate thumbprint. - RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` - // VMAgent - The VM Agent running on the virtual machine. - VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` - // MaintenanceRedeployStatus - The Maintenance Operation status on the virtual machine. - MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` - // Disks - The disks information. - Disks *[]DiskInstanceView `json:"disks,omitempty"` - // Extensions - The extensions information. - Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` - // VMHealth - READ-ONLY; The health status for the VM. - VMHealth *VirtualMachineHealthStatus `json:"vmHealth,omitempty"` - // BootDiagnostics - Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status.

    You can easily view the output of your console log.

    Azure also enables you to see a screenshot of the VM from the hypervisor. - BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` - // Statuses - The resource status information. - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` - // PlacementGroupID - The placement group in which the VM is running. If the VM is deallocated it will not have a placementGroupId. - PlacementGroupID *string `json:"placementGroupId,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMInstanceView. -func (vmssviv VirtualMachineScaleSetVMInstanceView) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssviv.PlatformUpdateDomain != nil { - objectMap["platformUpdateDomain"] = vmssviv.PlatformUpdateDomain - } - if vmssviv.PlatformFaultDomain != nil { - objectMap["platformFaultDomain"] = vmssviv.PlatformFaultDomain - } - if vmssviv.RdpThumbPrint != nil { - objectMap["rdpThumbPrint"] = vmssviv.RdpThumbPrint - } - if vmssviv.VMAgent != nil { - objectMap["vmAgent"] = vmssviv.VMAgent - } - if vmssviv.MaintenanceRedeployStatus != nil { - objectMap["maintenanceRedeployStatus"] = vmssviv.MaintenanceRedeployStatus - } - if vmssviv.Disks != nil { - objectMap["disks"] = vmssviv.Disks - } - if vmssviv.Extensions != nil { - objectMap["extensions"] = vmssviv.Extensions - } - if vmssviv.BootDiagnostics != nil { - objectMap["bootDiagnostics"] = vmssviv.BootDiagnostics - } - if vmssviv.Statuses != nil { - objectMap["statuses"] = vmssviv.Statuses - } - if vmssviv.PlacementGroupID != nil { - objectMap["placementGroupId"] = vmssviv.PlacementGroupID - } - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetVMListResult the List Virtual Machine Scale Set VMs operation response. -type VirtualMachineScaleSetVMListResult struct { - autorest.Response `json:"-"` - // Value - The list of virtual machine scale sets VMs. - Value *[]VirtualMachineScaleSetVM `json:"value,omitempty"` - // NextLink - The uri to fetch the next page of Virtual Machine Scale Set VMs. Call ListNext() with this to fetch the next page of VMSS VMs - NextLink *string `json:"nextLink,omitempty"` -} - -// VirtualMachineScaleSetVMListResultIterator provides access to a complete listing of -// VirtualMachineScaleSetVM values. -type VirtualMachineScaleSetVMListResultIterator struct { - i int - page VirtualMachineScaleSetVMListResultPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *VirtualMachineScaleSetVMListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *VirtualMachineScaleSetVMListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter VirtualMachineScaleSetVMListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter VirtualMachineScaleSetVMListResultIterator) Response() VirtualMachineScaleSetVMListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter VirtualMachineScaleSetVMListResultIterator) Value() VirtualMachineScaleSetVM { - if !iter.page.NotDone() { - return VirtualMachineScaleSetVM{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the VirtualMachineScaleSetVMListResultIterator type. -func NewVirtualMachineScaleSetVMListResultIterator(page VirtualMachineScaleSetVMListResultPage) VirtualMachineScaleSetVMListResultIterator { - return VirtualMachineScaleSetVMListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (vmssvlr VirtualMachineScaleSetVMListResult) IsEmpty() bool { - return vmssvlr.Value == nil || len(*vmssvlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (vmssvlr VirtualMachineScaleSetVMListResult) hasNextLink() bool { - return vmssvlr.NextLink != nil && len(*vmssvlr.NextLink) != 0 -} - -// virtualMachineScaleSetVMListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (vmssvlr VirtualMachineScaleSetVMListResult) virtualMachineScaleSetVMListResultPreparer(ctx context.Context) (*http.Request, error) { - if !vmssvlr.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(vmssvlr.NextLink))) -} - -// VirtualMachineScaleSetVMListResultPage contains a page of VirtualMachineScaleSetVM values. -type VirtualMachineScaleSetVMListResultPage struct { - fn func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error) - vmssvlr VirtualMachineScaleSetVMListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *VirtualMachineScaleSetVMListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.vmssvlr) - if err != nil { - return err - } - page.vmssvlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *VirtualMachineScaleSetVMListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page VirtualMachineScaleSetVMListResultPage) NotDone() bool { - return !page.vmssvlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page VirtualMachineScaleSetVMListResultPage) Response() VirtualMachineScaleSetVMListResult { - return page.vmssvlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page VirtualMachineScaleSetVMListResultPage) Values() []VirtualMachineScaleSetVM { - if page.vmssvlr.IsEmpty() { - return nil - } - return *page.vmssvlr.Value -} - -// Creates a new instance of the VirtualMachineScaleSetVMListResultPage type. -func NewVirtualMachineScaleSetVMListResultPage(cur VirtualMachineScaleSetVMListResult, getNextPage func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error)) VirtualMachineScaleSetVMListResultPage { - return VirtualMachineScaleSetVMListResultPage{ - fn: getNextPage, - vmssvlr: cur, - } -} - -// VirtualMachineScaleSetVMNetworkProfileConfiguration describes a virtual machine scale set VM network -// profile. -type VirtualMachineScaleSetVMNetworkProfileConfiguration struct { - // NetworkInterfaceConfigurations - The list of network configurations. - NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` -} - -// VirtualMachineScaleSetVMProfile describes a virtual machine scale set virtual machine profile. -type VirtualMachineScaleSetVMProfile struct { - // OsProfile - Specifies the operating system settings for the virtual machines in the scale set. - OsProfile *VirtualMachineScaleSetOSProfile `json:"osProfile,omitempty"` - // StorageProfile - Specifies the storage settings for the virtual machine disks. - StorageProfile *VirtualMachineScaleSetStorageProfile `json:"storageProfile,omitempty"` - // NetworkProfile - Specifies properties of the network interfaces of the virtual machines in the scale set. - NetworkProfile *VirtualMachineScaleSetNetworkProfile `json:"networkProfile,omitempty"` - // DiagnosticsProfile - Specifies the boot diagnostic settings state.

    Minimum api-version: 2015-06-15. - DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` - // ExtensionProfile - Specifies a collection of settings for extensions installed on virtual machines in the scale set. - ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` - // LicenseType - Specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system.

    Possible values are:

    Windows_Client

    Windows_Server

    If this element is included in a request for an update, the value must match the initial value. This value cannot be updated.

    For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)

    Minimum api-version: 2015-06-15 - LicenseType *string `json:"licenseType,omitempty"` - // Priority - Specifies the priority for the virtual machines in the scale set.

    Minimum api-version: 2017-10-30-preview. Possible values include: 'Regular', 'Low', 'Spot' - Priority VirtualMachinePriorityTypes `json:"priority,omitempty"` - // EvictionPolicy - Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set.

    For Azure Spot virtual machines, the only supported value is 'Deallocate' and the minimum api-version is 2019-03-01.

    For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview. Possible values include: 'Deallocate', 'Delete' - EvictionPolicy VirtualMachineEvictionPolicyTypes `json:"evictionPolicy,omitempty"` - // BillingProfile - Specifies the billing related details of a Azure Spot VMSS.

    Minimum api-version: 2019-03-01. - BillingProfile *BillingProfile `json:"billingProfile,omitempty"` - // ScheduledEventsProfile - Specifies Scheduled Event related configurations. - ScheduledEventsProfile *ScheduledEventsProfile `json:"scheduledEventsProfile,omitempty"` -} - -// VirtualMachineScaleSetVMProperties describes the properties of a virtual machine scale set virtual -// machine. -type VirtualMachineScaleSetVMProperties struct { - // LatestModelApplied - READ-ONLY; Specifies whether the latest model has been applied to the virtual machine. - LatestModelApplied *bool `json:"latestModelApplied,omitempty"` - // VMID - READ-ONLY; Azure VM unique ID. - VMID *string `json:"vmId,omitempty"` - // InstanceView - READ-ONLY; The virtual machine instance view. - InstanceView *VirtualMachineScaleSetVMInstanceView `json:"instanceView,omitempty"` - // HardwareProfile - Specifies the hardware settings for the virtual machine. - HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` - // StorageProfile - Specifies the storage settings for the virtual machine disks. - StorageProfile *StorageProfile `json:"storageProfile,omitempty"` - // AdditionalCapabilities - Specifies additional capabilities enabled or disabled on the virtual machine in the scale set. For instance: whether the virtual machine has the capability to support attaching managed data disks with UltraSSD_LRS storage account type. - AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"` - // OsProfile - Specifies the operating system settings for the virtual machine. - OsProfile *OSProfile `json:"osProfile,omitempty"` - // NetworkProfile - Specifies the network interfaces of the virtual machine. - NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` - // NetworkProfileConfiguration - Specifies the network profile configuration of the virtual machine. - NetworkProfileConfiguration *VirtualMachineScaleSetVMNetworkProfileConfiguration `json:"networkProfileConfiguration,omitempty"` - // DiagnosticsProfile - Specifies the boot diagnostic settings state.

    Minimum api-version: 2015-06-15. - DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` - // AvailabilitySet - Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Manage the availability of virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).

    For more information on Azure planned maintenance, see [Planned maintenance for virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)

    Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability set. - AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state, which only appears in the response. - ProvisioningState *string `json:"provisioningState,omitempty"` - // LicenseType - Specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system.

    Possible values are:

    Windows_Client

    Windows_Server

    If this element is included in a request for an update, the value must match the initial value. This value cannot be updated.

    For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)

    Minimum api-version: 2015-06-15 - LicenseType *string `json:"licenseType,omitempty"` - // ModelDefinitionApplied - READ-ONLY; Specifies whether the model applied to the virtual machine is the model of the virtual machine scale set or the customized model for the virtual machine. - ModelDefinitionApplied *string `json:"modelDefinitionApplied,omitempty"` - // ProtectionPolicy - Specifies the protection policy of the virtual machine. - ProtectionPolicy *VirtualMachineScaleSetVMProtectionPolicy `json:"protectionPolicy,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineScaleSetVMProperties. -func (vmssvp VirtualMachineScaleSetVMProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmssvp.HardwareProfile != nil { - objectMap["hardwareProfile"] = vmssvp.HardwareProfile - } - if vmssvp.StorageProfile != nil { - objectMap["storageProfile"] = vmssvp.StorageProfile - } - if vmssvp.AdditionalCapabilities != nil { - objectMap["additionalCapabilities"] = vmssvp.AdditionalCapabilities - } - if vmssvp.OsProfile != nil { - objectMap["osProfile"] = vmssvp.OsProfile - } - if vmssvp.NetworkProfile != nil { - objectMap["networkProfile"] = vmssvp.NetworkProfile - } - if vmssvp.NetworkProfileConfiguration != nil { - objectMap["networkProfileConfiguration"] = vmssvp.NetworkProfileConfiguration - } - if vmssvp.DiagnosticsProfile != nil { - objectMap["diagnosticsProfile"] = vmssvp.DiagnosticsProfile - } - if vmssvp.AvailabilitySet != nil { - objectMap["availabilitySet"] = vmssvp.AvailabilitySet - } - if vmssvp.LicenseType != nil { - objectMap["licenseType"] = vmssvp.LicenseType - } - if vmssvp.ProtectionPolicy != nil { - objectMap["protectionPolicy"] = vmssvp.ProtectionPolicy - } - return json.Marshal(objectMap) -} - -// VirtualMachineScaleSetVMProtectionPolicy the protection policy of a virtual machine scale set VM. -type VirtualMachineScaleSetVMProtectionPolicy struct { - // ProtectFromScaleIn - Indicates that the virtual machine scale set VM shouldn't be considered for deletion during a scale-in operation. - ProtectFromScaleIn *bool `json:"protectFromScaleIn,omitempty"` - // ProtectFromScaleSetActions - Indicates that model updates or actions (including scale-in) initiated on the virtual machine scale set should not be applied to the virtual machine scale set VM. - ProtectFromScaleSetActions *bool `json:"protectFromScaleSetActions,omitempty"` -} - -// VirtualMachineScaleSetVMReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. -type VirtualMachineScaleSetVMReimageParameters struct { - // TempDisk - Specifies whether to reimage temp disk. Default value: false. Note: This temp disk reimage parameter is only supported for VM/VMSS with Ephemeral OS disk. - TempDisk *bool `json:"tempDisk,omitempty"` -} - -// VirtualMachineScaleSetVMsDeallocateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsDeallocateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsDeallocateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsDeallocateFuture.Result. -func (future *VirtualMachineScaleSetVMsDeallocateFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeallocateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsDeallocateFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsDeleteFuture.Result. -func (future *VirtualMachineScaleSetVMsDeleteFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsPerformMaintenanceFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type VirtualMachineScaleSetVMsPerformMaintenanceFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsPerformMaintenanceFuture.Result. -func (future *VirtualMachineScaleSetVMsPerformMaintenanceFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsPerformMaintenanceFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsPowerOffFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsPowerOffFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsPowerOffFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsPowerOffFuture.Result. -func (future *VirtualMachineScaleSetVMsPowerOffFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsPowerOffFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsPowerOffFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsRedeployFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsRedeployFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsRedeployFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsRedeployFuture.Result. -func (future *VirtualMachineScaleSetVMsRedeployFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRedeployFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRedeployFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsReimageAllFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsReimageAllFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsReimageAllFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsReimageAllFuture.Result. -func (future *VirtualMachineScaleSetVMsReimageAllFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageAllFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsReimageAllFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsReimageFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsReimageFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsReimageFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsReimageFuture.Result. -func (future *VirtualMachineScaleSetVMsReimageFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsReimageFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsReimageFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsRestartFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsRestartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsRestartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsRestartFuture.Result. -func (future *VirtualMachineScaleSetVMsRestartFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRestartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRestartFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsRunCommandFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsRunCommandFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (RunCommandResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsRunCommandFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsRunCommandFuture.Result. -func (future *VirtualMachineScaleSetVMsRunCommandFuture) result(client VirtualMachineScaleSetVMsClient) (rcr RunCommandResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRunCommandFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - rcr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsRunCommandFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if rcr.Response.Response, err = future.GetResult(sender); err == nil && rcr.Response.Response.StatusCode != http.StatusNoContent { - rcr, err = client.RunCommandResponder(rcr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsRunCommandFuture", "Result", rcr.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineScaleSetVMsStartFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsStartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsStartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsStartFuture.Result. -func (future *VirtualMachineScaleSetVMsStartFuture) result(client VirtualMachineScaleSetVMsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsStartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsStartFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineScaleSetVMsUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineScaleSetVMsUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachineScaleSetVMsClient) (VirtualMachineScaleSetVM, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineScaleSetVMsUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachineScaleSetVMsUpdateFuture.Result. -func (future *VirtualMachineScaleSetVMsUpdateFuture) result(client VirtualMachineScaleSetVMsClient) (vmssv VirtualMachineScaleSetVM, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmssv.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachineScaleSetVMsUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmssv.Response.Response, err = future.GetResult(sender); err == nil && vmssv.Response.Response.StatusCode != http.StatusNoContent { - vmssv, err = client.UpdateResponder(vmssv.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsUpdateFuture", "Result", vmssv.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachinesCaptureFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesCaptureFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (VirtualMachineCaptureResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesCaptureFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesCaptureFuture.Result. -func (future *VirtualMachinesCaptureFuture) result(client VirtualMachinesClient) (vmcr VirtualMachineCaptureResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCaptureFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - vmcr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesCaptureFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if vmcr.Response.Response, err = future.GetResult(sender); err == nil && vmcr.Response.Response.StatusCode != http.StatusNoContent { - vmcr, err = client.CaptureResponder(vmcr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCaptureFuture", "Result", vmcr.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachinesConvertToManagedDisksFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachinesConvertToManagedDisksFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesConvertToManagedDisksFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesConvertToManagedDisksFuture.Result. -func (future *VirtualMachinesConvertToManagedDisksFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesConvertToManagedDisksFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesConvertToManagedDisksFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachinesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (VirtualMachine, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesCreateOrUpdateFuture.Result. -func (future *VirtualMachinesCreateOrUpdateFuture) result(client VirtualMachinesClient) (VM VirtualMachine, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - VM.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if VM.Response.Response, err = future.GetResult(sender); err == nil && VM.Response.Response.StatusCode != http.StatusNoContent { - VM, err = client.CreateOrUpdateResponder(VM.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesCreateOrUpdateFuture", "Result", VM.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachinesDeallocateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachinesDeallocateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesDeallocateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesDeallocateFuture.Result. -func (future *VirtualMachinesDeallocateFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeallocateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesDeallocateFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesDeleteFuture.Result. -func (future *VirtualMachinesDeleteFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineSize describes the properties of a VM size. -type VirtualMachineSize struct { - // Name - The name of the virtual machine size. - Name *string `json:"name,omitempty"` - // NumberOfCores - The number of cores supported by the virtual machine size. - NumberOfCores *int32 `json:"numberOfCores,omitempty"` - // OsDiskSizeInMB - The OS disk size, in MB, allowed by the virtual machine size. - OsDiskSizeInMB *int32 `json:"osDiskSizeInMB,omitempty"` - // ResourceDiskSizeInMB - The resource disk size, in MB, allowed by the virtual machine size. - ResourceDiskSizeInMB *int32 `json:"resourceDiskSizeInMB,omitempty"` - // MemoryInMB - The amount of memory, in MB, supported by the virtual machine size. - MemoryInMB *int32 `json:"memoryInMB,omitempty"` - // MaxDataDiskCount - The maximum number of data disks that can be attached to the virtual machine size. - MaxDataDiskCount *int32 `json:"maxDataDiskCount,omitempty"` -} - -// VirtualMachineSizeListResult the List Virtual Machine operation response. -type VirtualMachineSizeListResult struct { - autorest.Response `json:"-"` - // Value - The list of virtual machine sizes. - Value *[]VirtualMachineSize `json:"value,omitempty"` -} - -// VirtualMachinesPerformMaintenanceFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachinesPerformMaintenanceFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesPerformMaintenanceFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesPerformMaintenanceFuture.Result. -func (future *VirtualMachinesPerformMaintenanceFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPerformMaintenanceFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesPerformMaintenanceFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesPowerOffFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesPowerOffFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesPowerOffFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesPowerOffFuture.Result. -func (future *VirtualMachinesPowerOffFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesPowerOffFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesPowerOffFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesReapplyFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesReapplyFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesReapplyFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesReapplyFuture.Result. -func (future *VirtualMachinesReapplyFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesReapplyFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesReapplyFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesRedeployFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesRedeployFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesRedeployFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesRedeployFuture.Result. -func (future *VirtualMachinesRedeployFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRedeployFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRedeployFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesReimageFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesReimageFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesReimageFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesReimageFuture.Result. -func (future *VirtualMachinesReimageFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesReimageFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesReimageFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesRestartFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesRestartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesRestartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesRestartFuture.Result. -func (future *VirtualMachinesRestartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRestartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRestartFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachinesRunCommandFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachinesRunCommandFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (RunCommandResult, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesRunCommandFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesRunCommandFuture.Result. -func (future *VirtualMachinesRunCommandFuture) result(client VirtualMachinesClient) (rcr RunCommandResult, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRunCommandFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - rcr.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesRunCommandFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if rcr.Response.Response, err = future.GetResult(sender); err == nil && rcr.Response.Response.StatusCode != http.StatusNoContent { - rcr, err = client.RunCommandResponder(rcr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesRunCommandFuture", "Result", rcr.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachinesStartFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesStartFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesStartFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesStartFuture.Result. -func (future *VirtualMachinesStartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesStartFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesStartFuture") - return - } - ar.Response = future.Response() - return -} - -// VirtualMachineStatusCodeCount the status code and count of the virtual machine scale set instance view -// status summary. -type VirtualMachineStatusCodeCount struct { - // Code - READ-ONLY; The instance view status code. - Code *string `json:"code,omitempty"` - // Count - READ-ONLY; The number of instances having a particular status code. - Count *int32 `json:"count,omitempty"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineStatusCodeCount. -func (vmscc VirtualMachineStatusCodeCount) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// VirtualMachinesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (VirtualMachine, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for VirtualMachinesUpdateFuture.Result. -func (future *VirtualMachinesUpdateFuture) result(client VirtualMachinesClient) (VM VirtualMachine, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - VM.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if VM.Response.Response, err = future.GetResult(sender); err == nil && VM.Response.Response.StatusCode != http.StatusNoContent { - VM, err = client.UpdateResponder(VM.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesUpdateFuture", "Result", VM.Response.Response, "Failure responding to request") - } - } - return -} - -// VirtualMachineUpdate describes a Virtual Machine Update. -type VirtualMachineUpdate struct { - // Plan - Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. - Plan *Plan `json:"plan,omitempty"` - *VirtualMachineProperties `json:"properties,omitempty"` - // Identity - The identity of the virtual machine, if configured. - Identity *VirtualMachineIdentity `json:"identity,omitempty"` - // Zones - The virtual machine zones. - Zones *[]string `json:"zones,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for VirtualMachineUpdate. -func (vmu VirtualMachineUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if vmu.Plan != nil { - objectMap["plan"] = vmu.Plan - } - if vmu.VirtualMachineProperties != nil { - objectMap["properties"] = vmu.VirtualMachineProperties - } - if vmu.Identity != nil { - objectMap["identity"] = vmu.Identity - } - if vmu.Zones != nil { - objectMap["zones"] = vmu.Zones - } - if vmu.Tags != nil { - objectMap["tags"] = vmu.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for VirtualMachineUpdate struct. -func (vmu *VirtualMachineUpdate) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "plan": - if v != nil { - var plan Plan - err = json.Unmarshal(*v, &plan) - if err != nil { - return err - } - vmu.Plan = &plan - } - case "properties": - if v != nil { - var virtualMachineProperties VirtualMachineProperties - err = json.Unmarshal(*v, &virtualMachineProperties) - if err != nil { - return err - } - vmu.VirtualMachineProperties = &virtualMachineProperties - } - case "identity": - if v != nil { - var identity VirtualMachineIdentity - err = json.Unmarshal(*v, &identity) - if err != nil { - return err - } - vmu.Identity = &identity - } - case "zones": - if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) - if err != nil { - return err - } - vmu.Zones = &zones - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - vmu.Tags = tags - } - } - } - - return nil -} - -// VMScaleSetConvertToSinglePlacementGroupInput ... -type VMScaleSetConvertToSinglePlacementGroupInput struct { - // ActivePlacementGroupID - Id of the placement group in which you want future virtual machine instances to be placed. To query placement group Id, please use Virtual Machine Scale Set VMs - Get API. If not provided, the platform will choose one with maximum number of virtual machine instances. - ActivePlacementGroupID *string `json:"activePlacementGroupId,omitempty"` -} - -// WindowsConfiguration specifies Windows operating system settings on the virtual machine. -type WindowsConfiguration struct { - // ProvisionVMAgent - Indicates whether virtual machine agent should be provisioned on the virtual machine.

    When this property is not specified in the request body, default behavior is to set it to true. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM later. - ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` - // EnableAutomaticUpdates - Indicates whether Automatic Updates is enabled for the Windows virtual machine. Default value is true.

    For virtual machine scale sets, this property can be updated and updates will take effect on OS reprovisioning. - EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"` - // TimeZone - Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time".

    Possible values can be [TimeZoneInfo.Id](https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.id?#System_TimeZoneInfo_Id) value from time zones returned by [TimeZoneInfo.GetSystemTimeZones](https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.getsystemtimezones). - TimeZone *string `json:"timeZone,omitempty"` - // AdditionalUnattendContent - Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. - AdditionalUnattendContent *[]AdditionalUnattendContent `json:"additionalUnattendContent,omitempty"` - // WinRM - Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell. - WinRM *WinRMConfiguration `json:"winRM,omitempty"` -} - -// WinRMConfiguration describes Windows Remote Management configuration of the VM -type WinRMConfiguration struct { - // Listeners - The list of Windows Remote Management listeners - Listeners *[]WinRMListener `json:"listeners,omitempty"` -} - -// WinRMListener describes Protocol and thumbprint of Windows Remote Management listener -type WinRMListener struct { - // Protocol - Specifies the protocol of WinRM listener.

    Possible values are:
    **http**

    **https**. Possible values include: 'HTTP', 'HTTPS' - Protocol ProtocolTypes `json:"protocol,omitempty"` - // CertificateURL - This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, see [Add a key or secret to the key vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8:

    {
    "data":"",
    "dataType":"pfx",
    "password":""
    } - CertificateURL *string `json:"certificateUrl,omitempty"` -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/operations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/operations.go deleted file mode 100644 index 6d72041f39c3..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/operations.go +++ /dev/null @@ -1,98 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// OperationsClient is the compute Client -type OperationsClient struct { - BaseClient -} - -// NewOperationsClient creates an instance of the OperationsClient client. -func NewOperationsClient(subscriptionID string) OperationsClient { - return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { - return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gets a list of compute operations. -func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.OperationsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.OperationsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.OperationsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPath("/providers/Microsoft.Compute/operations"), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/proximityplacementgroups.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/proximityplacementgroups.go deleted file mode 100644 index 2a2d8856b034..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/proximityplacementgroups.go +++ /dev/null @@ -1,575 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ProximityPlacementGroupsClient is the compute Client -type ProximityPlacementGroupsClient struct { - BaseClient -} - -// NewProximityPlacementGroupsClient creates an instance of the ProximityPlacementGroupsClient client. -func NewProximityPlacementGroupsClient(subscriptionID string) ProximityPlacementGroupsClient { - return NewProximityPlacementGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewProximityPlacementGroupsClientWithBaseURI creates an instance of the ProximityPlacementGroupsClient client using -// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewProximityPlacementGroupsClientWithBaseURI(baseURI string, subscriptionID string) ProximityPlacementGroupsClient { - return ProximityPlacementGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate create or update a proximity placement group. -// Parameters: -// resourceGroupName - the name of the resource group. -// proximityPlacementGroupName - the name of the proximity placement group. -// parameters - parameters supplied to the Create Proximity Placement Group operation. -func (client ProximityPlacementGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroup) (result ProximityPlacementGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, proximityPlacementGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "CreateOrUpdate", resp, "Failure responding to request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client ProximityPlacementGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroup) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "proximityPlacementGroupName": autorest.Encode("path", proximityPlacementGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client ProximityPlacementGroupsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client ProximityPlacementGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result ProximityPlacementGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete a proximity placement group. -// Parameters: -// resourceGroupName - the name of the resource group. -// proximityPlacementGroupName - the name of the proximity placement group. -func (client ProximityPlacementGroupsClient) Delete(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, proximityPlacementGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Delete", resp, "Failure responding to request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client ProximityPlacementGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "proximityPlacementGroupName": autorest.Encode("path", proximityPlacementGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client ProximityPlacementGroupsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client ProximityPlacementGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about a proximity placement group . -// Parameters: -// resourceGroupName - the name of the resource group. -// proximityPlacementGroupName - the name of the proximity placement group. -// includeColocationStatus - includeColocationStatus=true enables fetching the colocation status of all the -// resources in the proximity placement group. -func (client ProximityPlacementGroupsClient) Get(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, includeColocationStatus string) (result ProximityPlacementGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, proximityPlacementGroupName, includeColocationStatus) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client ProximityPlacementGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, includeColocationStatus string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "proximityPlacementGroupName": autorest.Encode("path", proximityPlacementGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(includeColocationStatus) > 0 { - queryParameters["includeColocationStatus"] = autorest.Encode("query", includeColocationStatus) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client ProximityPlacementGroupsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client ProximityPlacementGroupsClient) GetResponder(resp *http.Response) (result ProximityPlacementGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByResourceGroup lists all proximity placement groups in a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client ProximityPlacementGroupsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ProximityPlacementGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.ppglr.Response.Response != nil { - sc = result.ppglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.ppglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.ppglr, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.ppglr.hasNextLink() && result.ppglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client ProximityPlacementGroupsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client ProximityPlacementGroupsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client ProximityPlacementGroupsClient) ListByResourceGroupResponder(resp *http.Response) (result ProximityPlacementGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client ProximityPlacementGroupsClient) listByResourceGroupNextResults(ctx context.Context, lastResults ProximityPlacementGroupListResult) (result ProximityPlacementGroupListResult, err error) { - req, err := lastResults.proximityPlacementGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client ProximityPlacementGroupsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ProximityPlacementGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// ListBySubscription lists all proximity placement groups in a subscription. -func (client ProximityPlacementGroupsClient) ListBySubscription(ctx context.Context) (result ProximityPlacementGroupListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.ListBySubscription") - defer func() { - sc := -1 - if result.ppglr.Response.Response != nil { - sc = result.ppglr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListBySubscription", nil, "Failure preparing request") - return - } - - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.ppglr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListBySubscription", resp, "Failure sending request") - return - } - - result.ppglr, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "ListBySubscription", resp, "Failure responding to request") - return - } - if result.ppglr.hasNextLink() && result.ppglr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client ProximityPlacementGroupsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/proximityPlacementGroups", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListBySubscriptionSender sends the ListBySubscription request. The method will close the -// http.Response Body if it receives an error. -func (client ProximityPlacementGroupsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always -// closes the http.Response Body. -func (client ProximityPlacementGroupsClient) ListBySubscriptionResponder(resp *http.Response) (result ProximityPlacementGroupListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listBySubscriptionNextResults retrieves the next set of results, if any. -func (client ProximityPlacementGroupsClient) listBySubscriptionNextResults(ctx context.Context, lastResults ProximityPlacementGroupListResult) (result ProximityPlacementGroupListResult, err error) { - req, err := lastResults.proximityPlacementGroupListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListBySubscriptionSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") - } - result, err = client.ListBySubscriptionResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client ProximityPlacementGroupsClient) ListBySubscriptionComplete(ctx context.Context) (result ProximityPlacementGroupListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.ListBySubscription") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListBySubscription(ctx) - return -} - -// Update update a proximity placement group. -// Parameters: -// resourceGroupName - the name of the resource group. -// proximityPlacementGroupName - the name of the proximity placement group. -// parameters - parameters supplied to the Update Proximity Placement Group operation. -func (client ProximityPlacementGroupsClient) Update(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroupUpdate) (result ProximityPlacementGroup, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProximityPlacementGroupsClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, proximityPlacementGroupName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ProximityPlacementGroupsClient", "Update", resp, "Failure responding to request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client ProximityPlacementGroupsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, proximityPlacementGroupName string, parameters ProximityPlacementGroupUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "proximityPlacementGroupName": autorest.Encode("path", proximityPlacementGroupName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/proximityPlacementGroups/{proximityPlacementGroupName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client ProximityPlacementGroupsClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client ProximityPlacementGroupsClient) UpdateResponder(resp *http.Response) (result ProximityPlacementGroup, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/resourceskus.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/resourceskus.go deleted file mode 100644 index 9c967d93aa8d..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/resourceskus.go +++ /dev/null @@ -1,149 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// ResourceSkusClient is the compute Client -type ResourceSkusClient struct { - BaseClient -} - -// NewResourceSkusClient creates an instance of the ResourceSkusClient client. -func NewResourceSkusClient(subscriptionID string) ResourceSkusClient { - return NewResourceSkusClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewResourceSkusClientWithBaseURI creates an instance of the ResourceSkusClient client using a custom endpoint. Use -// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewResourceSkusClientWithBaseURI(baseURI string, subscriptionID string) ResourceSkusClient { - return ResourceSkusClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gets the list of Microsoft.Compute SKUs available for your Subscription. -// Parameters: -// filter - the filter to apply on the operation. Only **location** filter is supported currently. -func (client ResourceSkusClient) List(ctx context.Context, filter string) (result ResourceSkusResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusClient.List") - defer func() { - sc := -1 - if result.rsr.Response.Response != nil { - sc = result.rsr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, filter) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.rsr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", resp, "Failure sending request") - return - } - - result.rsr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", resp, "Failure responding to request") - return - } - if result.rsr.hasNextLink() && result.rsr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ResourceSkusClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-04-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/skus", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ResourceSkusClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ResourceSkusClient) ListResponder(resp *http.Response) (result ResourceSkusResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client ResourceSkusClient) listNextResults(ctx context.Context, lastResults ResourceSkusResult) (result ResourceSkusResult, err error) { - req, err := lastResults.resourceSkusResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ResourceSkusClient) ListComplete(ctx context.Context, filter string) (result ResourceSkusResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, filter) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/snapshots.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/snapshots.go deleted file mode 100644 index 382b9ae7793d..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/snapshots.go +++ /dev/null @@ -1,765 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// SnapshotsClient is the compute Client -type SnapshotsClient struct { - BaseClient -} - -// NewSnapshotsClient creates an instance of the SnapshotsClient client. -func NewSnapshotsClient(subscriptionID string) SnapshotsClient { - return NewSnapshotsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewSnapshotsClientWithBaseURI creates an instance of the SnapshotsClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) SnapshotsClient { - return SnapshotsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or updates a snapshot. -// Parameters: -// resourceGroupName - the name of the resource group. -// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot -// is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. -// snapshot - snapshot object supplied in the body of the Put disk operation. -func (client SnapshotsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, snapshotName string, snapshot Snapshot) (result SnapshotsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: snapshot, - Constraints: []validation.Constraint{{Target: "snapshot.SnapshotProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.CreationData", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.CreationData.ImageReference", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.CreationData.ImageReference.ID", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - {Target: "snapshot.SnapshotProperties.EncryptionSettingsCollection", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.EncryptionSettingsCollection.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}, - }}}}}); err != nil { - return result, validation.NewError("compute.SnapshotsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, snapshotName, snapshot) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client SnapshotsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, snapshotName string, snapshot Snapshot) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotName": autorest.Encode("path", snapshotName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - snapshot.ManagedBy = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters), - autorest.WithJSON(snapshot), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client SnapshotsClient) CreateOrUpdateSender(req *http.Request) (future SnapshotsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) CreateOrUpdateResponder(resp *http.Response) (result Snapshot, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a snapshot. -// Parameters: -// resourceGroupName - the name of the resource group. -// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot -// is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. -func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, snapshotName string) (result SnapshotsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, snapshotName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client SnapshotsClient) DeletePreparer(ctx context.Context, resourceGroupName string, snapshotName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotName": autorest.Encode("path", snapshotName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client SnapshotsClient) DeleteSender(req *http.Request) (future SnapshotsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets information about a snapshot. -// Parameters: -// resourceGroupName - the name of the resource group. -// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot -// is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. -func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, snapshotName string) (result Snapshot, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, snapshotName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client SnapshotsClient) GetPreparer(ctx context.Context, resourceGroupName string, snapshotName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotName": autorest.Encode("path", snapshotName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client SnapshotsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) GetResponder(resp *http.Response) (result Snapshot, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GrantAccess grants access to a snapshot. -// Parameters: -// resourceGroupName - the name of the resource group. -// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot -// is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. -// grantAccessData - access data object supplied in the body of the get snapshot access operation. -func (client SnapshotsClient) GrantAccess(ctx context.Context, resourceGroupName string, snapshotName string, grantAccessData GrantAccessData) (result SnapshotsGrantAccessFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.GrantAccess") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: grantAccessData, - Constraints: []validation.Constraint{{Target: "grantAccessData.DurationInSeconds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.SnapshotsClient", "GrantAccess", err.Error()) - } - - req, err := client.GrantAccessPreparer(ctx, resourceGroupName, snapshotName, grantAccessData) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "GrantAccess", nil, "Failure preparing request") - return - } - - result, err = client.GrantAccessSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "GrantAccess", result.Response(), "Failure sending request") - return - } - - return -} - -// GrantAccessPreparer prepares the GrantAccess request. -func (client SnapshotsClient) GrantAccessPreparer(ctx context.Context, resourceGroupName string, snapshotName string, grantAccessData GrantAccessData) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotName": autorest.Encode("path", snapshotName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess", pathParameters), - autorest.WithJSON(grantAccessData), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GrantAccessSender sends the GrantAccess request. The method will close the -// http.Response Body if it receives an error. -func (client SnapshotsClient) GrantAccessSender(req *http.Request) (future SnapshotsGrantAccessFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// GrantAccessResponder handles the response to the GrantAccess request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) GrantAccessResponder(resp *http.Response) (result AccessURI, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists snapshots under a subscription. -func (client SnapshotsClient) List(ctx context.Context) (result SnapshotListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.List") - defer func() { - sc := -1 - if result.sl.Response.Response != nil { - sc = result.sl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.sl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "List", resp, "Failure sending request") - return - } - - result.sl, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "List", resp, "Failure responding to request") - return - } - if result.sl.hasNextLink() && result.sl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client SnapshotsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/snapshots", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client SnapshotsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) ListResponder(resp *http.Response) (result SnapshotList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client SnapshotsClient) listNextResults(ctx context.Context, lastResults SnapshotList) (result SnapshotList, err error) { - req, err := lastResults.snapshotListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client SnapshotsClient) ListComplete(ctx context.Context) (result SnapshotListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx) - return -} - -// ListByResourceGroup lists snapshots under a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client SnapshotsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result SnapshotListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.sl.Response.Response != nil { - sc = result.sl.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "ListByResourceGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.sl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "ListByResourceGroup", resp, "Failure sending request") - return - } - - result.sl, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "ListByResourceGroup", resp, "Failure responding to request") - return - } - if result.sl.hasNextLink() && result.sl.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client SnapshotsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the -// http.Response Body if it receives an error. -func (client SnapshotsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) ListByResourceGroupResponder(resp *http.Response) (result SnapshotList, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByResourceGroupNextResults retrieves the next set of results, if any. -func (client SnapshotsClient) listByResourceGroupNextResults(ctx context.Context, lastResults SnapshotList) (result SnapshotList, err error) { - req, err := lastResults.snapshotListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByResourceGroupSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByResourceGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client SnapshotsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result SnapshotListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.ListByResourceGroup") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) - return -} - -// RevokeAccess revokes access to a snapshot. -// Parameters: -// resourceGroupName - the name of the resource group. -// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot -// is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. -func (client SnapshotsClient) RevokeAccess(ctx context.Context, resourceGroupName string, snapshotName string) (result SnapshotsRevokeAccessFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.RevokeAccess") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RevokeAccessPreparer(ctx, resourceGroupName, snapshotName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "RevokeAccess", nil, "Failure preparing request") - return - } - - result, err = client.RevokeAccessSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "RevokeAccess", result.Response(), "Failure sending request") - return - } - - return -} - -// RevokeAccessPreparer prepares the RevokeAccess request. -func (client SnapshotsClient) RevokeAccessPreparer(ctx context.Context, resourceGroupName string, snapshotName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotName": autorest.Encode("path", snapshotName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RevokeAccessSender sends the RevokeAccess request. The method will close the -// http.Response Body if it receives an error. -func (client SnapshotsClient) RevokeAccessSender(req *http.Request) (future SnapshotsRevokeAccessFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RevokeAccessResponder handles the response to the RevokeAccess request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) RevokeAccessResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Update updates (patches) a snapshot. -// Parameters: -// resourceGroupName - the name of the resource group. -// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot -// is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters. -// snapshot - snapshot object supplied in the body of the Patch snapshot operation. -func (client SnapshotsClient) Update(ctx context.Context, resourceGroupName string, snapshotName string, snapshot SnapshotUpdate) (result SnapshotsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, snapshotName, snapshot) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client SnapshotsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, snapshotName string, snapshot SnapshotUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "snapshotName": autorest.Encode("path", snapshotName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters), - autorest.WithJSON(snapshot), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client SnapshotsClient) UpdateSender(req *http.Request) (future SnapshotsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client SnapshotsClient) UpdateResponder(resp *http.Response) (result Snapshot, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/usage.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/usage.go deleted file mode 100644 index 78e2d5c3e48c..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/usage.go +++ /dev/null @@ -1,155 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// UsageClient is the compute Client -type UsageClient struct { - BaseClient -} - -// NewUsageClient creates an instance of the UsageClient client. -func NewUsageClient(subscriptionID string) UsageClient { - return NewUsageClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewUsageClientWithBaseURI creates an instance of the UsageClient client using a custom endpoint. Use this when -// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewUsageClientWithBaseURI(baseURI string, subscriptionID string) UsageClient { - return UsageClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List gets, for the specified location, the current compute resource usage information as well as the limits for -// compute resources under the subscription. -// Parameters: -// location - the location for which resource usage is queried. -func (client UsageClient) List(ctx context.Context, location string) (result ListUsagesResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UsageClient.List") - defer func() { - sc := -1 - if result.lur.Response.Response != nil { - sc = result.lur.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: location, - Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.UsageClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.UsageClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.lur.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.UsageClient", "List", resp, "Failure sending request") - return - } - - result.lur, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.UsageClient", "List", resp, "Failure responding to request") - return - } - if result.lur.hasNextLink() && result.lur.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client UsageClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client UsageClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client UsageClient) ListResponder(resp *http.Response) (result ListUsagesResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client UsageClient) listNextResults(ctx context.Context, lastResults ListUsagesResult) (result ListUsagesResult, err error) { - req, err := lastResults.listUsagesResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.UsageClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.UsageClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.UsageClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client UsageClient) ListComplete(ctx context.Context, location string) (result ListUsagesResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UsageClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, location) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/version.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/version.go deleted file mode 100644 index 2a7f5ba07e33..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/version.go +++ /dev/null @@ -1,19 +0,0 @@ -package compute - -import "github.com/Azure/azure-sdk-for-go/version" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -// UserAgent returns the UserAgent string to use when sending http.Requests. -func UserAgent() string { - return "Azure-SDK-For-Go/" + Version() + " compute/2019-07-01" -} - -// Version returns the semantic version (see http://semver.org) of the client. -func Version() string { - return version.Number -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/virtualmachineextensionimages.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/virtualmachineextensionimages.go deleted file mode 100644 index b320a317ccfa..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/virtualmachineextensionimages.go +++ /dev/null @@ -1,270 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineExtensionImagesClient is the compute Client -type VirtualMachineExtensionImagesClient struct { - BaseClient -} - -// NewVirtualMachineExtensionImagesClient creates an instance of the VirtualMachineExtensionImagesClient client. -func NewVirtualMachineExtensionImagesClient(subscriptionID string) VirtualMachineExtensionImagesClient { - return NewVirtualMachineExtensionImagesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineExtensionImagesClientWithBaseURI creates an instance of the VirtualMachineExtensionImagesClient -// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI -// (sovereign clouds, Azure stack). -func NewVirtualMachineExtensionImagesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineExtensionImagesClient { - return VirtualMachineExtensionImagesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets a virtual machine extension image. -// Parameters: -// location - the name of a supported Azure region. -func (client VirtualMachineExtensionImagesClient) Get(ctx context.Context, location string, publisherName string, typeParameter string, version string) (result VirtualMachineExtensionImage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionImagesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, location, publisherName, typeParameter, version) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineExtensionImagesClient) GetPreparer(ctx context.Context, location string, publisherName string, typeParameter string, version string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "publisherName": autorest.Encode("path", publisherName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "type": autorest.Encode("path", typeParameter), - "version": autorest.Encode("path", version), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineExtensionImagesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineExtensionImagesClient) GetResponder(resp *http.Response) (result VirtualMachineExtensionImage, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListTypes gets a list of virtual machine extension image types. -// Parameters: -// location - the name of a supported Azure region. -func (client VirtualMachineExtensionImagesClient) ListTypes(ctx context.Context, location string, publisherName string) (result ListVirtualMachineExtensionImage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionImagesClient.ListTypes") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListTypesPreparer(ctx, location, publisherName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListTypes", nil, "Failure preparing request") - return - } - - resp, err := client.ListTypesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListTypes", resp, "Failure sending request") - return - } - - result, err = client.ListTypesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListTypes", resp, "Failure responding to request") - return - } - - return -} - -// ListTypesPreparer prepares the ListTypes request. -func (client VirtualMachineExtensionImagesClient) ListTypesPreparer(ctx context.Context, location string, publisherName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "publisherName": autorest.Encode("path", publisherName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListTypesSender sends the ListTypes request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineExtensionImagesClient) ListTypesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListTypesResponder handles the response to the ListTypes request. The method always -// closes the http.Response Body. -func (client VirtualMachineExtensionImagesClient) ListTypesResponder(resp *http.Response) (result ListVirtualMachineExtensionImage, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListVersions gets a list of virtual machine extension image versions. -// Parameters: -// location - the name of a supported Azure region. -// filter - the filter to apply on the operation. -func (client VirtualMachineExtensionImagesClient) ListVersions(ctx context.Context, location string, publisherName string, typeParameter string, filter string, top *int32, orderby string) (result ListVirtualMachineExtensionImage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionImagesClient.ListVersions") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListVersionsPreparer(ctx, location, publisherName, typeParameter, filter, top, orderby) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListVersions", nil, "Failure preparing request") - return - } - - resp, err := client.ListVersionsSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListVersions", resp, "Failure sending request") - return - } - - result, err = client.ListVersionsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListVersions", resp, "Failure responding to request") - return - } - - return -} - -// ListVersionsPreparer prepares the ListVersions request. -func (client VirtualMachineExtensionImagesClient) ListVersionsPreparer(ctx context.Context, location string, publisherName string, typeParameter string, filter string, top *int32, orderby string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "publisherName": autorest.Encode("path", publisherName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "type": autorest.Encode("path", typeParameter), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - if len(orderby) > 0 { - queryParameters["$orderby"] = autorest.Encode("query", orderby) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListVersionsSender sends the ListVersions request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineExtensionImagesClient) ListVersionsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListVersionsResponder handles the response to the ListVersions request. The method always -// closes the http.Response Body. -func (client VirtualMachineExtensionImagesClient) ListVersionsResponder(resp *http.Response) (result ListVirtualMachineExtensionImage, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/virtualmachineextensions.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/virtualmachineextensions.go deleted file mode 100644 index ef883f483a0e..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/virtualmachineextensions.go +++ /dev/null @@ -1,442 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineExtensionsClient is the compute Client -type VirtualMachineExtensionsClient struct { - BaseClient -} - -// NewVirtualMachineExtensionsClient creates an instance of the VirtualMachineExtensionsClient client. -func NewVirtualMachineExtensionsClient(subscriptionID string) VirtualMachineExtensionsClient { - return NewVirtualMachineExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineExtensionsClientWithBaseURI creates an instance of the VirtualMachineExtensionsClient client using -// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewVirtualMachineExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineExtensionsClient { - return VirtualMachineExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate the operation to create or update the extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine where the extension should be created or updated. -// VMExtensionName - the name of the virtual machine extension. -// extensionParameters - parameters supplied to the Create Virtual Machine Extension operation. -func (client VirtualMachineExtensionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtension) (result VirtualMachineExtensionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMName, VMExtensionName, extensionParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualMachineExtensionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtension) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmExtensionName": autorest.Encode("path", VMExtensionName), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters), - autorest.WithJSON(extensionParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineExtensionsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineExtensionsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualMachineExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete the operation to delete the extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine where the extension should be deleted. -// VMExtensionName - the name of the virtual machine extension. -func (client VirtualMachineExtensionsClient) Delete(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string) (result VirtualMachineExtensionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, VMName, VMExtensionName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualMachineExtensionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmExtensionName": autorest.Encode("path", VMExtensionName), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineExtensionsClient) DeleteSender(req *http.Request) (future VirtualMachineExtensionsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualMachineExtensionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get the operation to get the extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine containing the extension. -// VMExtensionName - the name of the virtual machine extension. -// expand - the expand expression to apply on the operation. -func (client VirtualMachineExtensionsClient) Get(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, expand string) (result VirtualMachineExtension, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, VMName, VMExtensionName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineExtensionsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmExtensionName": autorest.Encode("path", VMExtensionName), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineExtensionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List the operation to get all extensions of a Virtual Machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine containing the extension. -// expand - the expand expression to apply on the operation. -func (client VirtualMachineExtensionsClient) List(ctx context.Context, resourceGroupName string, VMName string, expand string) (result VirtualMachineExtensionsListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, resourceGroupName, VMName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineExtensionsClient) ListPreparer(ctx context.Context, resourceGroupName string, VMName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineExtensionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineExtensionsClient) ListResponder(resp *http.Response) (result VirtualMachineExtensionsListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Update the operation to update the extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine where the extension should be updated. -// VMExtensionName - the name of the virtual machine extension. -// extensionParameters - parameters supplied to the Update Virtual Machine Extension operation. -func (client VirtualMachineExtensionsClient) Update(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtensionUpdate) (result VirtualMachineExtensionsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, VMName, VMExtensionName, extensionParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client VirtualMachineExtensionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtensionUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmExtensionName": autorest.Encode("path", VMExtensionName), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters), - autorest.WithJSON(extensionParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineExtensionsClient) UpdateSender(req *http.Request) (future VirtualMachineExtensionsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client VirtualMachineExtensionsClient) UpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/virtualmachineimages.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/virtualmachineimages.go deleted file mode 100644 index 2300a951ba67..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/virtualmachineimages.go +++ /dev/null @@ -1,432 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineImagesClient is the compute Client -type VirtualMachineImagesClient struct { - BaseClient -} - -// NewVirtualMachineImagesClient creates an instance of the VirtualMachineImagesClient client. -func NewVirtualMachineImagesClient(subscriptionID string) VirtualMachineImagesClient { - return NewVirtualMachineImagesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineImagesClientWithBaseURI creates an instance of the VirtualMachineImagesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewVirtualMachineImagesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineImagesClient { - return VirtualMachineImagesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets a virtual machine image. -// Parameters: -// location - the name of a supported Azure region. -// publisherName - a valid image publisher. -// offer - a valid image publisher offer. -// skus - a valid image SKU. -// version - a valid image SKU version. -func (client VirtualMachineImagesClient) Get(ctx context.Context, location string, publisherName string, offer string, skus string, version string) (result VirtualMachineImage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, location, publisherName, offer, skus, version) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineImagesClient) GetPreparer(ctx context.Context, location string, publisherName string, offer string, skus string, version string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "offer": autorest.Encode("path", offer), - "publisherName": autorest.Encode("path", publisherName), - "skus": autorest.Encode("path", skus), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "version": autorest.Encode("path", version), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineImagesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineImagesClient) GetResponder(resp *http.Response) (result VirtualMachineImage, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. -// Parameters: -// location - the name of a supported Azure region. -// publisherName - a valid image publisher. -// offer - a valid image publisher offer. -// skus - a valid image SKU. -// expand - the expand expression to apply on the operation. -func (client VirtualMachineImagesClient) List(ctx context.Context, location string, publisherName string, offer string, skus string, expand string, top *int32, orderby string) (result ListVirtualMachineImageResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, location, publisherName, offer, skus, expand, top, orderby) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineImagesClient) ListPreparer(ctx context.Context, location string, publisherName string, offer string, skus string, expand string, top *int32, orderby string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "offer": autorest.Encode("path", offer), - "publisherName": autorest.Encode("path", publisherName), - "skus": autorest.Encode("path", skus), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - if len(orderby) > 0 { - queryParameters["$orderby"] = autorest.Encode("query", orderby) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineImagesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineImagesClient) ListResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListOffers gets a list of virtual machine image offers for the specified location and publisher. -// Parameters: -// location - the name of a supported Azure region. -// publisherName - a valid image publisher. -func (client VirtualMachineImagesClient) ListOffers(ctx context.Context, location string, publisherName string) (result ListVirtualMachineImageResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.ListOffers") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListOffersPreparer(ctx, location, publisherName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListOffers", nil, "Failure preparing request") - return - } - - resp, err := client.ListOffersSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListOffers", resp, "Failure sending request") - return - } - - result, err = client.ListOffersResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListOffers", resp, "Failure responding to request") - return - } - - return -} - -// ListOffersPreparer prepares the ListOffers request. -func (client VirtualMachineImagesClient) ListOffersPreparer(ctx context.Context, location string, publisherName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "publisherName": autorest.Encode("path", publisherName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListOffersSender sends the ListOffers request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineImagesClient) ListOffersSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListOffersResponder handles the response to the ListOffers request. The method always -// closes the http.Response Body. -func (client VirtualMachineImagesClient) ListOffersResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListPublishers gets a list of virtual machine image publishers for the specified Azure location. -// Parameters: -// location - the name of a supported Azure region. -func (client VirtualMachineImagesClient) ListPublishers(ctx context.Context, location string) (result ListVirtualMachineImageResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.ListPublishers") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPublishersPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListPublishers", nil, "Failure preparing request") - return - } - - resp, err := client.ListPublishersSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListPublishers", resp, "Failure sending request") - return - } - - result, err = client.ListPublishersResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListPublishers", resp, "Failure responding to request") - return - } - - return -} - -// ListPublishersPreparer prepares the ListPublishers request. -func (client VirtualMachineImagesClient) ListPublishersPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListPublishersSender sends the ListPublishers request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineImagesClient) ListPublishersSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListPublishersResponder handles the response to the ListPublishers request. The method always -// closes the http.Response Body. -func (client VirtualMachineImagesClient) ListPublishersResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListSkus gets a list of virtual machine image SKUs for the specified location, publisher, and offer. -// Parameters: -// location - the name of a supported Azure region. -// publisherName - a valid image publisher. -// offer - a valid image publisher offer. -func (client VirtualMachineImagesClient) ListSkus(ctx context.Context, location string, publisherName string, offer string) (result ListVirtualMachineImageResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.ListSkus") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListSkusPreparer(ctx, location, publisherName, offer) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListSkus", nil, "Failure preparing request") - return - } - - resp, err := client.ListSkusSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListSkus", resp, "Failure sending request") - return - } - - result, err = client.ListSkusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListSkus", resp, "Failure responding to request") - return - } - - return -} - -// ListSkusPreparer prepares the ListSkus request. -func (client VirtualMachineImagesClient) ListSkusPreparer(ctx context.Context, location string, publisherName string, offer string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "offer": autorest.Encode("path", offer), - "publisherName": autorest.Encode("path", publisherName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSkusSender sends the ListSkus request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineImagesClient) ListSkusSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListSkusResponder handles the response to the ListSkus request. The method always -// closes the http.Response Body. -func (client VirtualMachineImagesClient) ListSkusResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/virtualmachineruncommands.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/virtualmachineruncommands.go deleted file mode 100644 index 02a46f9d8abb..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/virtualmachineruncommands.go +++ /dev/null @@ -1,237 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineRunCommandsClient is the compute Client -type VirtualMachineRunCommandsClient struct { - BaseClient -} - -// NewVirtualMachineRunCommandsClient creates an instance of the VirtualMachineRunCommandsClient client. -func NewVirtualMachineRunCommandsClient(subscriptionID string) VirtualMachineRunCommandsClient { - return NewVirtualMachineRunCommandsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineRunCommandsClientWithBaseURI creates an instance of the VirtualMachineRunCommandsClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewVirtualMachineRunCommandsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineRunCommandsClient { - return VirtualMachineRunCommandsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Get gets specific run command for a subscription in a location. -// Parameters: -// location - the location upon which run commands is queried. -// commandID - the command id. -func (client VirtualMachineRunCommandsClient) Get(ctx context.Context, location string, commandID string) (result RunCommandDocument, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: location, - Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachineRunCommandsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, location, commandID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineRunCommandsClient) GetPreparer(ctx context.Context, location string, commandID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "commandId": autorest.Encode("path", commandID), - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands/{commandId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineRunCommandsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineRunCommandsClient) GetResponder(resp *http.Response) (result RunCommandDocument, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all available run commands for a subscription in a location. -// Parameters: -// location - the location upon which run commands is queried. -func (client VirtualMachineRunCommandsClient) List(ctx context.Context, location string) (result RunCommandListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.List") - defer func() { - sc := -1 - if result.rclr.Response.Response != nil { - sc = result.rclr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: location, - Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachineRunCommandsClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.rclr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "List", resp, "Failure sending request") - return - } - - result.rclr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "List", resp, "Failure responding to request") - return - } - if result.rclr.hasNextLink() && result.rclr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineRunCommandsClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineRunCommandsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineRunCommandsClient) ListResponder(resp *http.Response) (result RunCommandListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualMachineRunCommandsClient) listNextResults(ctx context.Context, lastResults RunCommandListResult) (result RunCommandListResult, err error) { - req, err := lastResults.runCommandListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineRunCommandsClient) ListComplete(ctx context.Context, location string) (result RunCommandListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, location) - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/virtualmachines.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/virtualmachines.go deleted file mode 100644 index 4aff443c3a1a..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/virtualmachines.go +++ /dev/null @@ -1,1869 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachinesClient is the compute Client -type VirtualMachinesClient struct { - BaseClient -} - -// NewVirtualMachinesClient creates an instance of the VirtualMachinesClient client. -func NewVirtualMachinesClient(subscriptionID string) VirtualMachinesClient { - return NewVirtualMachinesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachinesClientWithBaseURI creates an instance of the VirtualMachinesClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVirtualMachinesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachinesClient { - return VirtualMachinesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Capture captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create -// similar VMs. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// parameters - parameters supplied to the Capture Virtual Machine operation. -func (client VirtualMachinesClient) Capture(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachineCaptureParameters) (result VirtualMachinesCaptureFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Capture") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VhdPrefix", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.DestinationContainerName", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.OverwriteVhds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachinesClient", "Capture", err.Error()) - } - - req, err := client.CapturePreparer(ctx, resourceGroupName, VMName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Capture", nil, "Failure preparing request") - return - } - - result, err = client.CaptureSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Capture", result.Response(), "Failure sending request") - return - } - - return -} - -// CapturePreparer prepares the Capture request. -func (client VirtualMachinesClient) CapturePreparer(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachineCaptureParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CaptureSender sends the Capture request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) CaptureSender(req *http.Request) (future VirtualMachinesCaptureFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CaptureResponder handles the response to the Capture request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) CaptureResponder(resp *http.Response) (result VirtualMachineCaptureResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ConvertToManagedDisks converts virtual machine disks from blob-based to managed disks. Virtual machine must be -// stop-deallocated before invoking this operation.
    For Windows, please refer to [Convert a virtual machine from -// unmanaged disks to managed -// disks.](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/convert-unmanaged-to-managed-disks).
    For -// Linux, please refer to [Convert a virtual machine from unmanaged disks to managed -// disks.](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/convert-unmanaged-to-managed-disks). -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) ConvertToManagedDisks(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesConvertToManagedDisksFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ConvertToManagedDisks") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ConvertToManagedDisksPreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ConvertToManagedDisks", nil, "Failure preparing request") - return - } - - result, err = client.ConvertToManagedDisksSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ConvertToManagedDisks", result.Response(), "Failure sending request") - return - } - - return -} - -// ConvertToManagedDisksPreparer prepares the ConvertToManagedDisks request. -func (client VirtualMachinesClient) ConvertToManagedDisksPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/convertToManagedDisks", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ConvertToManagedDisksSender sends the ConvertToManagedDisks request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) ConvertToManagedDisksSender(req *http.Request) (future VirtualMachinesConvertToManagedDisksFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ConvertToManagedDisksResponder handles the response to the ConvertToManagedDisks request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) ConvertToManagedDisksResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// CreateOrUpdate the operation to create or update a virtual machine. Please note some properties can be set only -// during virtual machine creation. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// parameters - parameters supplied to the Create Virtual Machine operation. -func (client VirtualMachinesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachine) (result VirtualMachinesCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VirtualMachineProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SecretURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachinesClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualMachinesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachine) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.Resources = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachinesCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachine, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Deallocate shuts down the virtual machine and releases the compute resources. You are not billed for the compute -// resources that this virtual machine uses. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) Deallocate(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesDeallocateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Deallocate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeallocatePreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Deallocate", nil, "Failure preparing request") - return - } - - result, err = client.DeallocateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Deallocate", result.Response(), "Failure sending request") - return - } - - return -} - -// DeallocatePreparer prepares the Deallocate request. -func (client VirtualMachinesClient) DeallocatePreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeallocateSender sends the Deallocate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) DeallocateSender(req *http.Request) (future VirtualMachinesDeallocateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeallocateResponder handles the response to the Deallocate request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) DeallocateResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Delete the operation to delete a virtual machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) Delete(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualMachinesClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) DeleteSender(req *http.Request) (future VirtualMachinesDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Generalize sets the OS state of the virtual machine to generalized. It is recommended to sysprep the virtual machine -// before performing this operation.
    For Windows, please refer to [Create a managed image of a generalized VM in -// Azure](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/capture-image-resource).
    For Linux, please -// refer to [How to create an image of a virtual machine or -// VHD](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/capture-image). -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) Generalize(ctx context.Context, resourceGroupName string, VMName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Generalize") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GeneralizePreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Generalize", nil, "Failure preparing request") - return - } - - resp, err := client.GeneralizeSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Generalize", resp, "Failure sending request") - return - } - - result, err = client.GeneralizeResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Generalize", resp, "Failure responding to request") - return - } - - return -} - -// GeneralizePreparer prepares the Generalize request. -func (client VirtualMachinesClient) GeneralizePreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/generalize", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GeneralizeSender sends the Generalize request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) GeneralizeSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GeneralizeResponder handles the response to the Generalize request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) GeneralizeResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get retrieves information about the model view or the instance view of a virtual machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// expand - the expand expression to apply on the operation. -func (client VirtualMachinesClient) Get(ctx context.Context, resourceGroupName string, VMName string, expand InstanceViewTypes) (result VirtualMachine, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, VMName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachinesClient) GetPreparer(ctx context.Context, resourceGroupName string, VMName string, expand InstanceViewTypes) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) GetResponder(resp *http.Response) (result VirtualMachine, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// InstanceView retrieves information about the run-time state of a virtual machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) InstanceView(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachineInstanceView, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.InstanceView") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.InstanceViewPreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "InstanceView", nil, "Failure preparing request") - return - } - - resp, err := client.InstanceViewSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "InstanceView", resp, "Failure sending request") - return - } - - result, err = client.InstanceViewResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "InstanceView", resp, "Failure responding to request") - return - } - - return -} - -// InstanceViewPreparer prepares the InstanceView request. -func (client VirtualMachinesClient) InstanceViewPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/instanceView", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// InstanceViewSender sends the InstanceView request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) InstanceViewSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// InstanceViewResponder handles the response to the InstanceView request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) InstanceViewResponder(resp *http.Response) (result VirtualMachineInstanceView, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to -// get the next page of virtual machines. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client VirtualMachinesClient) List(ctx context.Context, resourceGroupName string) (result VirtualMachineListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.List") - defer func() { - sc := -1 - if result.vmlr.Response.Response != nil { - sc = result.vmlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vmlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", resp, "Failure sending request") - return - } - - result.vmlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", resp, "Failure responding to request") - return - } - if result.vmlr.hasNextLink() && result.vmlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachinesClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) ListResponder(resp *http.Response) (result VirtualMachineListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualMachinesClient) listNextResults(ctx context.Context, lastResults VirtualMachineListResult) (result VirtualMachineListResult, err error) { - req, err := lastResults.virtualMachineListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachinesClient) ListComplete(ctx context.Context, resourceGroupName string) (result VirtualMachineListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll lists all of the virtual machines in the specified subscription. Use the nextLink property in the response -// to get the next page of virtual machines. -// Parameters: -// statusOnly - statusOnly=true enables fetching run time status of all Virtual Machines in the subscription. -func (client VirtualMachinesClient) ListAll(ctx context.Context, statusOnly string) (result VirtualMachineListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListAll") - defer func() { - sc := -1 - if result.vmlr.Response.Response != nil { - sc = result.vmlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx, statusOnly) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.vmlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", resp, "Failure sending request") - return - } - - result.vmlr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAll", resp, "Failure responding to request") - return - } - if result.vmlr.hasNextLink() && result.vmlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client VirtualMachinesClient) ListAllPreparer(ctx context.Context, statusOnly string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(statusOnly) > 0 { - queryParameters["statusOnly"] = autorest.Encode("query", statusOnly) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) ListAllResponder(resp *http.Response) (result VirtualMachineListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client VirtualMachinesClient) listAllNextResults(ctx context.Context, lastResults VirtualMachineListResult) (result VirtualMachineListResult, err error) { - req, err := lastResults.virtualMachineListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachinesClient) ListAllComplete(ctx context.Context, statusOnly string) (result VirtualMachineListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx, statusOnly) - return -} - -// ListAvailableSizes lists all available virtual machine sizes to which the specified virtual machine can be resized. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) ListAvailableSizes(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachineSizeListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListAvailableSizes") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListAvailableSizesPreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAvailableSizes", nil, "Failure preparing request") - return - } - - resp, err := client.ListAvailableSizesSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAvailableSizes", resp, "Failure sending request") - return - } - - result, err = client.ListAvailableSizesResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAvailableSizes", resp, "Failure responding to request") - return - } - - return -} - -// ListAvailableSizesPreparer prepares the ListAvailableSizes request. -func (client VirtualMachinesClient) ListAvailableSizesPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAvailableSizesSender sends the ListAvailableSizes request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) ListAvailableSizesSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAvailableSizesResponder handles the response to the ListAvailableSizes request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) ListAvailableSizesResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByLocation gets all the virtual machines under the specified subscription for the specified location. -// Parameters: -// location - the location for which virtual machines under the subscription are queried. -func (client VirtualMachinesClient) ListByLocation(ctx context.Context, location string) (result VirtualMachineListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListByLocation") - defer func() { - sc := -1 - if result.vmlr.Response.Response != nil { - sc = result.vmlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: location, - Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachinesClient", "ListByLocation", err.Error()) - } - - result.fn = client.listByLocationNextResults - req, err := client.ListByLocationPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListByLocation", nil, "Failure preparing request") - return - } - - resp, err := client.ListByLocationSender(req) - if err != nil { - result.vmlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListByLocation", resp, "Failure sending request") - return - } - - result.vmlr, err = client.ListByLocationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListByLocation", resp, "Failure responding to request") - return - } - if result.vmlr.hasNextLink() && result.vmlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListByLocationPreparer prepares the ListByLocation request. -func (client VirtualMachinesClient) ListByLocationPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/virtualMachines", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByLocationSender sends the ListByLocation request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) ListByLocationSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByLocationResponder handles the response to the ListByLocation request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) ListByLocationResponder(resp *http.Response) (result VirtualMachineListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByLocationNextResults retrieves the next set of results, if any. -func (client VirtualMachinesClient) listByLocationNextResults(ctx context.Context, lastResults VirtualMachineListResult) (result VirtualMachineListResult, err error) { - req, err := lastResults.virtualMachineListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listByLocationNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByLocationSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listByLocationNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByLocationResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listByLocationNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByLocationComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachinesClient) ListByLocationComplete(ctx context.Context, location string) (result VirtualMachineListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListByLocation") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByLocation(ctx, location) - return -} - -// PerformMaintenance shuts down the virtual machine, moves it to an already updated node, and powers it back on during -// the self-service phase of planned maintenance. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) PerformMaintenance(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesPerformMaintenanceFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.PerformMaintenance") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PerformMaintenancePreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PerformMaintenance", nil, "Failure preparing request") - return - } - - result, err = client.PerformMaintenanceSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PerformMaintenance", result.Response(), "Failure sending request") - return - } - - return -} - -// PerformMaintenancePreparer prepares the PerformMaintenance request. -func (client VirtualMachinesClient) PerformMaintenancePreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/performMaintenance", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PerformMaintenanceSender sends the PerformMaintenance request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) PerformMaintenanceSender(req *http.Request) (future VirtualMachinesPerformMaintenanceFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PerformMaintenanceResponder handles the response to the PerformMaintenance request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) PerformMaintenanceResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// PowerOff the operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same -// provisioned resources. You are still charged for this virtual machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// skipShutdown - the parameter to request non-graceful VM shutdown. True value for this flag indicates -// non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not -// specified -func (client VirtualMachinesClient) PowerOff(ctx context.Context, resourceGroupName string, VMName string, skipShutdown *bool) (result VirtualMachinesPowerOffFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.PowerOff") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PowerOffPreparer(ctx, resourceGroupName, VMName, skipShutdown) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PowerOff", nil, "Failure preparing request") - return - } - - result, err = client.PowerOffSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PowerOff", result.Response(), "Failure sending request") - return - } - - return -} - -// PowerOffPreparer prepares the PowerOff request. -func (client VirtualMachinesClient) PowerOffPreparer(ctx context.Context, resourceGroupName string, VMName string, skipShutdown *bool) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if skipShutdown != nil { - queryParameters["skipShutdown"] = autorest.Encode("query", *skipShutdown) - } else { - queryParameters["skipShutdown"] = autorest.Encode("query", false) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PowerOffSender sends the PowerOff request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) PowerOffSender(req *http.Request) (future VirtualMachinesPowerOffFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PowerOffResponder handles the response to the PowerOff request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) PowerOffResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Reapply the operation to reapply a virtual machine's state. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) Reapply(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesReapplyFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Reapply") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ReapplyPreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Reapply", nil, "Failure preparing request") - return - } - - result, err = client.ReapplySender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Reapply", result.Response(), "Failure sending request") - return - } - - return -} - -// ReapplyPreparer prepares the Reapply request. -func (client VirtualMachinesClient) ReapplyPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reapply", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReapplySender sends the Reapply request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) ReapplySender(req *http.Request) (future VirtualMachinesReapplyFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ReapplyResponder handles the response to the Reapply request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) ReapplyResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Redeploy shuts down the virtual machine, moves it to a new node, and powers it back on. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) Redeploy(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesRedeployFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Redeploy") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RedeployPreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Redeploy", nil, "Failure preparing request") - return - } - - result, err = client.RedeploySender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Redeploy", result.Response(), "Failure sending request") - return - } - - return -} - -// RedeployPreparer prepares the Redeploy request. -func (client VirtualMachinesClient) RedeployPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/redeploy", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RedeploySender sends the Redeploy request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) RedeploySender(req *http.Request) (future VirtualMachinesRedeployFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RedeployResponder handles the response to the Redeploy request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) RedeployResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Reimage reimages the virtual machine which has an ephemeral OS disk back to its initial state. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// parameters - parameters supplied to the Reimage Virtual Machine operation. -func (client VirtualMachinesClient) Reimage(ctx context.Context, resourceGroupName string, VMName string, parameters *VirtualMachineReimageParameters) (result VirtualMachinesReimageFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Reimage") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ReimagePreparer(ctx, resourceGroupName, VMName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Reimage", nil, "Failure preparing request") - return - } - - result, err = client.ReimageSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Reimage", result.Response(), "Failure sending request") - return - } - - return -} - -// ReimagePreparer prepares the Reimage request. -func (client VirtualMachinesClient) ReimagePreparer(ctx context.Context, resourceGroupName string, VMName string, parameters *VirtualMachineReimageParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/reimage", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if parameters != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(parameters)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReimageSender sends the Reimage request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) ReimageSender(req *http.Request) (future VirtualMachinesReimageFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ReimageResponder handles the response to the Reimage request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Restart the operation to restart a virtual machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) Restart(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesRestartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Restart") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RestartPreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Restart", nil, "Failure preparing request") - return - } - - result, err = client.RestartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Restart", result.Response(), "Failure sending request") - return - } - - return -} - -// RestartPreparer prepares the Restart request. -func (client VirtualMachinesClient) RestartPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RestartSender sends the Restart request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) RestartSender(req *http.Request) (future VirtualMachinesRestartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RestartResponder handles the response to the Restart request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// RunCommand run command on the VM. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// parameters - parameters supplied to the Run command operation. -func (client VirtualMachinesClient) RunCommand(ctx context.Context, resourceGroupName string, VMName string, parameters RunCommandInput) (result VirtualMachinesRunCommandFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.RunCommand") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.CommandID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachinesClient", "RunCommand", err.Error()) - } - - req, err := client.RunCommandPreparer(ctx, resourceGroupName, VMName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "RunCommand", nil, "Failure preparing request") - return - } - - result, err = client.RunCommandSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "RunCommand", result.Response(), "Failure sending request") - return - } - - return -} - -// RunCommandPreparer prepares the RunCommand request. -func (client VirtualMachinesClient) RunCommandPreparer(ctx context.Context, resourceGroupName string, VMName string, parameters RunCommandInput) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommand", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RunCommandSender sends the RunCommand request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) RunCommandSender(req *http.Request) (future VirtualMachinesRunCommandFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RunCommandResponder handles the response to the RunCommand request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) RunCommandResponder(resp *http.Response) (result RunCommandResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Start the operation to start a virtual machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -func (client VirtualMachinesClient) Start(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesStartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Start") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StartPreparer(ctx, resourceGroupName, VMName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Start", nil, "Failure preparing request") - return - } - - result, err = client.StartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Start", result.Response(), "Failure sending request") - return - } - - return -} - -// StartPreparer prepares the Start request. -func (client VirtualMachinesClient) StartPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartSender sends the Start request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) StartSender(req *http.Request) (future VirtualMachinesStartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StartResponder handles the response to the Start request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Update the operation to update a virtual machine. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMName - the name of the virtual machine. -// parameters - parameters supplied to the Update Virtual Machine operation. -func (client VirtualMachinesClient) Update(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachineUpdate) (result VirtualMachinesUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, VMName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client VirtualMachinesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachineUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmName": autorest.Encode("path", VMName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachinesClient) UpdateSender(req *http.Request) (future VirtualMachinesUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client VirtualMachinesClient) UpdateResponder(resp *http.Response) (result VirtualMachine, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesetextensions.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesetextensions.go deleted file mode 100644 index 5a360beacb76..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesetextensions.go +++ /dev/null @@ -1,483 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineScaleSetExtensionsClient is the compute Client -type VirtualMachineScaleSetExtensionsClient struct { - BaseClient -} - -// NewVirtualMachineScaleSetExtensionsClient creates an instance of the VirtualMachineScaleSetExtensionsClient client. -func NewVirtualMachineScaleSetExtensionsClient(subscriptionID string) VirtualMachineScaleSetExtensionsClient { - return NewVirtualMachineScaleSetExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineScaleSetExtensionsClientWithBaseURI creates an instance of the -// VirtualMachineScaleSetExtensionsClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVirtualMachineScaleSetExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetExtensionsClient { - return VirtualMachineScaleSetExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate the operation to create or update an extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set where the extension should be create or updated. -// vmssExtensionName - the name of the VM scale set extension. -// extensionParameters - parameters supplied to the Create VM scale set Extension operation. -func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension) (result VirtualMachineScaleSetExtensionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName, extensionParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - "vmssExtensionName": autorest.Encode("path", vmssExtensionName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - extensionParameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", pathParameters), - autorest.WithJSON(extensionParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineScaleSetExtensionsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineScaleSetExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete the operation to delete the extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set where the extension should be deleted. -// vmssExtensionName - the name of the VM scale set extension. -func (client VirtualMachineScaleSetExtensionsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string) (result VirtualMachineScaleSetExtensionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualMachineScaleSetExtensionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - "vmssExtensionName": autorest.Encode("path", vmssExtensionName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetExtensionsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetExtensionsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetExtensionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get the operation to get the extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set containing the extension. -// vmssExtensionName - the name of the VM scale set extension. -// expand - the expand expression to apply on the operation. -func (client VirtualMachineScaleSetExtensionsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, expand string) (result VirtualMachineScaleSetExtension, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineScaleSetExtensionsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - "vmssExtensionName": autorest.Encode("path", vmssExtensionName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetExtensionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSetExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets a list of all extensions in a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set containing the extension. -func (client VirtualMachineScaleSetExtensionsClient) List(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetExtensionListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.List") - defer func() { - sc := -1 - if result.vmsselr.Response.Response != nil { - sc = result.vmsselr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vmsselr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "List", resp, "Failure sending request") - return - } - - result.vmsselr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "List", resp, "Failure responding to request") - return - } - if result.vmsselr.hasNextLink() && result.vmsselr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineScaleSetExtensionsClient) ListPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetExtensionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetExtensionsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetExtensionListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualMachineScaleSetExtensionsClient) listNextResults(ctx context.Context, lastResults VirtualMachineScaleSetExtensionListResult) (result VirtualMachineScaleSetExtensionListResult, err error) { - req, err := lastResults.virtualMachineScaleSetExtensionListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineScaleSetExtensionsClient) ListComplete(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetExtensionListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, VMScaleSetName) - return -} - -// Update the operation to update an extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set where the extension should be updated. -// vmssExtensionName - the name of the VM scale set extension. -// extensionParameters - parameters supplied to the Update VM scale set Extension operation. -func (client VirtualMachineScaleSetExtensionsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtensionUpdate) (result VirtualMachineScaleSetExtensionsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName, extensionParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client VirtualMachineScaleSetExtensionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtensionUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - "vmssExtensionName": autorest.Encode("path", vmssExtensionName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - extensionParameters.Name = nil - extensionParameters.Type = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", pathParameters), - autorest.WithJSON(extensionParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetExtensionsClient) UpdateSender(req *http.Request) (future VirtualMachineScaleSetExtensionsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetExtensionsClient) UpdateResponder(resp *http.Response) (result VirtualMachineScaleSetExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesetrollingupgrades.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesetrollingupgrades.go deleted file mode 100644 index ebaf4581dd6e..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesetrollingupgrades.go +++ /dev/null @@ -1,346 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineScaleSetRollingUpgradesClient is the compute Client -type VirtualMachineScaleSetRollingUpgradesClient struct { - BaseClient -} - -// NewVirtualMachineScaleSetRollingUpgradesClient creates an instance of the -// VirtualMachineScaleSetRollingUpgradesClient client. -func NewVirtualMachineScaleSetRollingUpgradesClient(subscriptionID string) VirtualMachineScaleSetRollingUpgradesClient { - return NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI creates an instance of the -// VirtualMachineScaleSetRollingUpgradesClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetRollingUpgradesClient { - return VirtualMachineScaleSetRollingUpgradesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Cancel cancels the current virtual machine scale set rolling upgrade. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -func (client VirtualMachineScaleSetRollingUpgradesClient) Cancel(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetRollingUpgradesCancelFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetRollingUpgradesClient.Cancel") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CancelPreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "Cancel", nil, "Failure preparing request") - return - } - - result, err = client.CancelSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "Cancel", result.Response(), "Failure sending request") - return - } - - return -} - -// CancelPreparer prepares the Cancel request. -func (client VirtualMachineScaleSetRollingUpgradesClient) CancelPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/cancel", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CancelSender sends the Cancel request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetRollingUpgradesClient) CancelSender(req *http.Request) (future VirtualMachineScaleSetRollingUpgradesCancelFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CancelResponder handles the response to the Cancel request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetRollingUpgradesClient) CancelResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// GetLatest gets the status of the latest virtual machine scale set rolling upgrade. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatest(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result RollingUpgradeStatusInfo, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetRollingUpgradesClient.GetLatest") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetLatestPreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "GetLatest", nil, "Failure preparing request") - return - } - - resp, err := client.GetLatestSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "GetLatest", resp, "Failure sending request") - return - } - - result, err = client.GetLatestResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "GetLatest", resp, "Failure responding to request") - return - } - - return -} - -// GetLatestPreparer prepares the GetLatest request. -func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/latest", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetLatestSender sends the GetLatest request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetLatestResponder handles the response to the GetLatest request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestResponder(resp *http.Response) (result RollingUpgradeStatusInfo, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// StartExtensionUpgrade starts a rolling upgrade to move all extensions for all virtual machine scale set instances to -// the latest available extension version. Instances which are already running the latest extension versions are not -// affected. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -func (client VirtualMachineScaleSetRollingUpgradesClient) StartExtensionUpgrade(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetRollingUpgradesClient.StartExtensionUpgrade") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StartExtensionUpgradePreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "StartExtensionUpgrade", nil, "Failure preparing request") - return - } - - result, err = client.StartExtensionUpgradeSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "StartExtensionUpgrade", result.Response(), "Failure sending request") - return - } - - return -} - -// StartExtensionUpgradePreparer prepares the StartExtensionUpgrade request. -func (client VirtualMachineScaleSetRollingUpgradesClient) StartExtensionUpgradePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensionRollingUpgrade", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartExtensionUpgradeSender sends the StartExtensionUpgrade request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetRollingUpgradesClient) StartExtensionUpgradeSender(req *http.Request) (future VirtualMachineScaleSetRollingUpgradesStartExtensionUpgradeFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StartExtensionUpgradeResponder handles the response to the StartExtensionUpgrade request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetRollingUpgradesClient) StartExtensionUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// StartOSUpgrade starts a rolling upgrade to move all virtual machine scale set instances to the latest available -// Platform Image OS version. Instances which are already running the latest available OS version are not affected. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgrade(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetRollingUpgradesClient.StartOSUpgrade") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StartOSUpgradePreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "StartOSUpgrade", nil, "Failure preparing request") - return - } - - result, err = client.StartOSUpgradeSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "StartOSUpgrade", result.Response(), "Failure sending request") - return - } - - return -} - -// StartOSUpgradePreparer prepares the StartOSUpgrade request. -func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osRollingUpgrade", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartOSUpgradeSender sends the StartOSUpgrade request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradeSender(req *http.Request) (future VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StartOSUpgradeResponder handles the response to the StartOSUpgrade request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesets.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesets.go deleted file mode 100644 index 0c9d98a27d92..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesets.go +++ /dev/null @@ -1,1937 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineScaleSetsClient is the compute Client -type VirtualMachineScaleSetsClient struct { - BaseClient -} - -// NewVirtualMachineScaleSetsClient creates an instance of the VirtualMachineScaleSetsClient client. -func NewVirtualMachineScaleSetsClient(subscriptionID string) VirtualMachineScaleSetsClient { - return NewVirtualMachineScaleSetsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineScaleSetsClientWithBaseURI creates an instance of the VirtualMachineScaleSetsClient client using a -// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, -// Azure stack). -func NewVirtualMachineScaleSetsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetsClient { - return VirtualMachineScaleSetsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// ConvertToSinglePlacementGroup converts SinglePlacementGroup property to true for a existing virtual machine scale -// set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the virtual machine scale set to create or update. -// parameters - the input object for ConvertToSinglePlacementGroup API. -func (client VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroup(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VMScaleSetConvertToSinglePlacementGroupInput) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ConvertToSinglePlacementGroup") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ConvertToSinglePlacementGroupPreparer(ctx, resourceGroupName, VMScaleSetName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ConvertToSinglePlacementGroup", nil, "Failure preparing request") - return - } - - resp, err := client.ConvertToSinglePlacementGroupSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ConvertToSinglePlacementGroup", resp, "Failure sending request") - return - } - - result, err = client.ConvertToSinglePlacementGroupResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ConvertToSinglePlacementGroup", resp, "Failure responding to request") - return - } - - return -} - -// ConvertToSinglePlacementGroupPreparer prepares the ConvertToSinglePlacementGroup request. -func (client VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroupPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VMScaleSetConvertToSinglePlacementGroupInput) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/convertToSinglePlacementGroup", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ConvertToSinglePlacementGroupSender sends the ConvertToSinglePlacementGroup request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroupSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ConvertToSinglePlacementGroupResponder handles the response to the ConvertToSinglePlacementGroup request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroupResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// CreateOrUpdate create or update a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set to create or update. -// parameters - the scale set object. -func (client VirtualMachineScaleSetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSet) (result VirtualMachineScaleSetsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxBatchInstancePercent", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxBatchInstancePercent", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, - {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxBatchInstancePercent", Name: validation.InclusiveMinimum, Rule: int64(5), Chain: nil}, - }}, - {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyInstancePercent", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyInstancePercent", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, - {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyInstancePercent", Name: validation.InclusiveMinimum, Rule: int64(5), Chain: nil}, - }}, - {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyUpgradedInstancePercent", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyUpgradedInstancePercent", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, - {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyUpgradedInstancePercent", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachineScaleSetsClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMScaleSetName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualMachineScaleSetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSet) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineScaleSetsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineScaleSet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Deallocate deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the -// compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. -func (client VirtualMachineScaleSetsClient) Deallocate(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsDeallocateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Deallocate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeallocatePreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Deallocate", nil, "Failure preparing request") - return - } - - result, err = client.DeallocateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Deallocate", result.Response(), "Failure sending request") - return - } - - return -} - -// DeallocatePreparer prepares the Deallocate request. -func (client VirtualMachineScaleSetsClient) DeallocatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMInstanceIDs != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMInstanceIDs)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeallocateSender sends the Deallocate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) DeallocateSender(req *http.Request) (future VirtualMachineScaleSetsDeallocateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeallocateResponder handles the response to the Deallocate request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) DeallocateResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Delete deletes a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -func (client VirtualMachineScaleSetsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualMachineScaleSetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// DeleteInstances deletes virtual machines in a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. -func (client VirtualMachineScaleSetsClient) DeleteInstances(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs) (result VirtualMachineScaleSetsDeleteInstancesFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.DeleteInstances") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: VMInstanceIDs, - Constraints: []validation.Constraint{{Target: "VMInstanceIDs.InstanceIds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachineScaleSetsClient", "DeleteInstances", err.Error()) - } - - req, err := client.DeleteInstancesPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "DeleteInstances", nil, "Failure preparing request") - return - } - - result, err = client.DeleteInstancesSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "DeleteInstances", result.Response(), "Failure sending request") - return - } - - return -} - -// DeleteInstancesPreparer prepares the DeleteInstances request. -func (client VirtualMachineScaleSetsClient) DeleteInstancesPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete", pathParameters), - autorest.WithJSON(VMInstanceIDs), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteInstancesSender sends the DeleteInstances request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) DeleteInstancesSender(req *http.Request) (future VirtualMachineScaleSetsDeleteInstancesFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteInstancesResponder handles the response to the DeleteInstances request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) DeleteInstancesResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// ForceRecoveryServiceFabricPlatformUpdateDomainWalk manual platform update domain walk to update virtual machines in -// a service fabric virtual machine scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// platformUpdateDomain - the platform update domain for which a manual recovery walk is requested -func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalk(ctx context.Context, resourceGroupName string, VMScaleSetName string, platformUpdateDomain int32) (result RecoveryWalkResponse, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ForceRecoveryServiceFabricPlatformUpdateDomainWalkPreparer(ctx, resourceGroupName, VMScaleSetName, platformUpdateDomain) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ForceRecoveryServiceFabricPlatformUpdateDomainWalk", nil, "Failure preparing request") - return - } - - resp, err := client.ForceRecoveryServiceFabricPlatformUpdateDomainWalkSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ForceRecoveryServiceFabricPlatformUpdateDomainWalk", resp, "Failure sending request") - return - } - - result, err = client.ForceRecoveryServiceFabricPlatformUpdateDomainWalkResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ForceRecoveryServiceFabricPlatformUpdateDomainWalk", resp, "Failure responding to request") - return - } - - return -} - -// ForceRecoveryServiceFabricPlatformUpdateDomainWalkPreparer prepares the ForceRecoveryServiceFabricPlatformUpdateDomainWalk request. -func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalkPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, platformUpdateDomain int32) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - "platformUpdateDomain": autorest.Encode("query", platformUpdateDomain), - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/forceRecoveryServiceFabricPlatformUpdateDomainWalk", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ForceRecoveryServiceFabricPlatformUpdateDomainWalkSender sends the ForceRecoveryServiceFabricPlatformUpdateDomainWalk request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalkSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ForceRecoveryServiceFabricPlatformUpdateDomainWalkResponder handles the response to the ForceRecoveryServiceFabricPlatformUpdateDomainWalk request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalkResponder(resp *http.Response) (result RecoveryWalkResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get display information about a virtual machine scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -func (client VirtualMachineScaleSetsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSet, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineScaleSetsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetInstanceView gets the status of a VM scale set instance. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -func (client VirtualMachineScaleSetsClient) GetInstanceView(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetInstanceView, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.GetInstanceView") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetInstanceViewPreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetInstanceView", nil, "Failure preparing request") - return - } - - resp, err := client.GetInstanceViewSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetInstanceView", resp, "Failure sending request") - return - } - - result, err = client.GetInstanceViewResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetInstanceView", resp, "Failure responding to request") - return - } - - return -} - -// GetInstanceViewPreparer prepares the GetInstanceView request. -func (client VirtualMachineScaleSetsClient) GetInstanceViewPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetInstanceViewSender sends the GetInstanceView request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) GetInstanceViewSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetInstanceViewResponder handles the response to the GetInstanceView request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) GetInstanceViewResponder(resp *http.Response) (result VirtualMachineScaleSetInstanceView, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetOSUpgradeHistory gets list of OS upgrades on a VM scale set instance. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistory(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetListOSUpgradeHistoryPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.GetOSUpgradeHistory") - defer func() { - sc := -1 - if result.vmsslouh.Response.Response != nil { - sc = result.vmsslouh.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.getOSUpgradeHistoryNextResults - req, err := client.GetOSUpgradeHistoryPreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetOSUpgradeHistory", nil, "Failure preparing request") - return - } - - resp, err := client.GetOSUpgradeHistorySender(req) - if err != nil { - result.vmsslouh.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetOSUpgradeHistory", resp, "Failure sending request") - return - } - - result.vmsslouh, err = client.GetOSUpgradeHistoryResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetOSUpgradeHistory", resp, "Failure responding to request") - return - } - if result.vmsslouh.hasNextLink() && result.vmsslouh.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// GetOSUpgradeHistoryPreparer prepares the GetOSUpgradeHistory request. -func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistoryPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osUpgradeHistory", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetOSUpgradeHistorySender sends the GetOSUpgradeHistory request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistorySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetOSUpgradeHistoryResponder handles the response to the GetOSUpgradeHistory request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistoryResponder(resp *http.Response) (result VirtualMachineScaleSetListOSUpgradeHistory, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// getOSUpgradeHistoryNextResults retrieves the next set of results, if any. -func (client VirtualMachineScaleSetsClient) getOSUpgradeHistoryNextResults(ctx context.Context, lastResults VirtualMachineScaleSetListOSUpgradeHistory) (result VirtualMachineScaleSetListOSUpgradeHistory, err error) { - req, err := lastResults.virtualMachineScaleSetListOSUpgradeHistoryPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "getOSUpgradeHistoryNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.GetOSUpgradeHistorySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "getOSUpgradeHistoryNextResults", resp, "Failure sending next results request") - } - result, err = client.GetOSUpgradeHistoryResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "getOSUpgradeHistoryNextResults", resp, "Failure responding to next results request") - } - return -} - -// GetOSUpgradeHistoryComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistoryComplete(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetListOSUpgradeHistoryIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.GetOSUpgradeHistory") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.GetOSUpgradeHistory(ctx, resourceGroupName, VMScaleSetName) - return -} - -// List gets a list of all VM scale sets under a resource group. -// Parameters: -// resourceGroupName - the name of the resource group. -func (client VirtualMachineScaleSetsClient) List(ctx context.Context, resourceGroupName string) (result VirtualMachineScaleSetListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.List") - defer func() { - sc := -1 - if result.vmsslr.Response.Response != nil { - sc = result.vmsslr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vmsslr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", resp, "Failure sending request") - return - } - - result.vmsslr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "List", resp, "Failure responding to request") - return - } - if result.vmsslr.hasNextLink() && result.vmsslr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineScaleSetsClient) ListPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualMachineScaleSetsClient) listNextResults(ctx context.Context, lastResults VirtualMachineScaleSetListResult) (result VirtualMachineScaleSetListResult, err error) { - req, err := lastResults.virtualMachineScaleSetListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineScaleSetsClient) ListComplete(ctx context.Context, resourceGroupName string) (result VirtualMachineScaleSetListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName) - return -} - -// ListAll gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use -// nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is null to fetch all -// the VM Scale Sets. -func (client VirtualMachineScaleSetsClient) ListAll(ctx context.Context) (result VirtualMachineScaleSetListWithLinkResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListAll") - defer func() { - sc := -1 - if result.vmsslwlr.Response.Response != nil { - sc = result.vmsslwlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listAllNextResults - req, err := client.ListAllPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", nil, "Failure preparing request") - return - } - - resp, err := client.ListAllSender(req) - if err != nil { - result.vmsslwlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", resp, "Failure sending request") - return - } - - result.vmsslwlr, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListAll", resp, "Failure responding to request") - return - } - if result.vmsslwlr.hasNextLink() && result.vmsslwlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListAllPreparer prepares the ListAll request. -func (client VirtualMachineScaleSetsClient) ListAllPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListAllSender sends the ListAll request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) ListAllSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListAllResponder handles the response to the ListAll request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) ListAllResponder(resp *http.Response) (result VirtualMachineScaleSetListWithLinkResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listAllNextResults retrieves the next set of results, if any. -func (client VirtualMachineScaleSetsClient) listAllNextResults(ctx context.Context, lastResults VirtualMachineScaleSetListWithLinkResult) (result VirtualMachineScaleSetListWithLinkResult, err error) { - req, err := lastResults.virtualMachineScaleSetListWithLinkResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listAllNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListAllSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listAllNextResults", resp, "Failure sending next results request") - } - result, err = client.ListAllResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listAllNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListAllComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineScaleSetsClient) ListAllComplete(ctx context.Context) (result VirtualMachineScaleSetListWithLinkResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListAll") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListAll(ctx) - return -} - -// ListSkus gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed -// for each SKU. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -func (client VirtualMachineScaleSetsClient) ListSkus(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetListSkusResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListSkus") - defer func() { - sc := -1 - if result.vmsslsr.Response.Response != nil { - sc = result.vmsslsr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listSkusNextResults - req, err := client.ListSkusPreparer(ctx, resourceGroupName, VMScaleSetName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", nil, "Failure preparing request") - return - } - - resp, err := client.ListSkusSender(req) - if err != nil { - result.vmsslsr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", resp, "Failure sending request") - return - } - - result.vmsslsr, err = client.ListSkusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ListSkus", resp, "Failure responding to request") - return - } - if result.vmsslsr.hasNextLink() && result.vmsslsr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListSkusPreparer prepares the ListSkus request. -func (client VirtualMachineScaleSetsClient) ListSkusPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSkusSender sends the ListSkus request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) ListSkusSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListSkusResponder handles the response to the ListSkus request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) ListSkusResponder(resp *http.Response) (result VirtualMachineScaleSetListSkusResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listSkusNextResults retrieves the next set of results, if any. -func (client VirtualMachineScaleSetsClient) listSkusNextResults(ctx context.Context, lastResults VirtualMachineScaleSetListSkusResult) (result VirtualMachineScaleSetListSkusResult, err error) { - req, err := lastResults.virtualMachineScaleSetListSkusResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listSkusNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSkusSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listSkusNextResults", resp, "Failure sending next results request") - } - result, err = client.ListSkusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "listSkusNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListSkusComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineScaleSetsClient) ListSkusComplete(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetListSkusResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ListSkus") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListSkus(ctx, resourceGroupName, VMScaleSetName) - return -} - -// PerformMaintenance perform maintenance on one or more virtual machines in a VM scale set. Operation on instances -// which are not eligible for perform maintenance will be failed. Please refer to best practices for more details: -// https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-maintenance-notifications -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. -func (client VirtualMachineScaleSetsClient) PerformMaintenance(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsPerformMaintenanceFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.PerformMaintenance") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PerformMaintenancePreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PerformMaintenance", nil, "Failure preparing request") - return - } - - result, err = client.PerformMaintenanceSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PerformMaintenance", result.Response(), "Failure sending request") - return - } - - return -} - -// PerformMaintenancePreparer prepares the PerformMaintenance request. -func (client VirtualMachineScaleSetsClient) PerformMaintenancePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/performMaintenance", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMInstanceIDs != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMInstanceIDs)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PerformMaintenanceSender sends the PerformMaintenance request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) PerformMaintenanceSender(req *http.Request) (future VirtualMachineScaleSetsPerformMaintenanceFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PerformMaintenanceResponder handles the response to the PerformMaintenance request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) PerformMaintenanceResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// PowerOff power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and -// you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. -// skipShutdown - the parameter to request non-graceful VM shutdown. True value for this flag indicates -// non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not -// specified -func (client VirtualMachineScaleSetsClient) PowerOff(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, skipShutdown *bool) (result VirtualMachineScaleSetsPowerOffFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.PowerOff") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PowerOffPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs, skipShutdown) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PowerOff", nil, "Failure preparing request") - return - } - - result, err = client.PowerOffSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PowerOff", result.Response(), "Failure sending request") - return - } - - return -} - -// PowerOffPreparer prepares the PowerOff request. -func (client VirtualMachineScaleSetsClient) PowerOffPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, skipShutdown *bool) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if skipShutdown != nil { - queryParameters["skipShutdown"] = autorest.Encode("query", *skipShutdown) - } else { - queryParameters["skipShutdown"] = autorest.Encode("query", false) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMInstanceIDs != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMInstanceIDs)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PowerOffSender sends the PowerOff request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) PowerOffSender(req *http.Request) (future VirtualMachineScaleSetsPowerOffFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PowerOffResponder handles the response to the PowerOff request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) PowerOffResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Redeploy shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers -// them back on. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. -func (client VirtualMachineScaleSetsClient) Redeploy(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsRedeployFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Redeploy") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RedeployPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Redeploy", nil, "Failure preparing request") - return - } - - result, err = client.RedeploySender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Redeploy", result.Response(), "Failure sending request") - return - } - - return -} - -// RedeployPreparer prepares the Redeploy request. -func (client VirtualMachineScaleSetsClient) RedeployPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/redeploy", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMInstanceIDs != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMInstanceIDs)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RedeploySender sends the Redeploy request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) RedeploySender(req *http.Request) (future VirtualMachineScaleSetsRedeployFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RedeployResponder handles the response to the Redeploy request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) RedeployResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Reimage reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a -// ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// VMScaleSetReimageInput - parameters for Reimaging VM ScaleSet. -func (client VirtualMachineScaleSetsClient) Reimage(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMScaleSetReimageInput *VirtualMachineScaleSetReimageParameters) (result VirtualMachineScaleSetsReimageFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Reimage") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ReimagePreparer(ctx, resourceGroupName, VMScaleSetName, VMScaleSetReimageInput) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Reimage", nil, "Failure preparing request") - return - } - - result, err = client.ReimageSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Reimage", result.Response(), "Failure sending request") - return - } - - return -} - -// ReimagePreparer prepares the Reimage request. -func (client VirtualMachineScaleSetsClient) ReimagePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMScaleSetReimageInput *VirtualMachineScaleSetReimageParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMScaleSetReimageInput != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMScaleSetReimageInput)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReimageSender sends the Reimage request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) ReimageSender(req *http.Request) (future VirtualMachineScaleSetsReimageFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ReimageResponder handles the response to the Reimage request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// ReimageAll reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation -// is only supported for managed disks. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. -func (client VirtualMachineScaleSetsClient) ReimageAll(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsReimageAllFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.ReimageAll") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ReimageAllPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ReimageAll", nil, "Failure preparing request") - return - } - - result, err = client.ReimageAllSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ReimageAll", result.Response(), "Failure sending request") - return - } - - return -} - -// ReimageAllPreparer prepares the ReimageAll request. -func (client VirtualMachineScaleSetsClient) ReimageAllPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMInstanceIDs != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMInstanceIDs)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReimageAllSender sends the ReimageAll request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) ReimageAllSender(req *http.Request) (future VirtualMachineScaleSetsReimageAllFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ReimageAllResponder handles the response to the ReimageAll request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) ReimageAllResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Restart restarts one or more virtual machines in a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. -func (client VirtualMachineScaleSetsClient) Restart(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsRestartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Restart") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RestartPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Restart", nil, "Failure preparing request") - return - } - - result, err = client.RestartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Restart", result.Response(), "Failure sending request") - return - } - - return -} - -// RestartPreparer prepares the Restart request. -func (client VirtualMachineScaleSetsClient) RestartPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMInstanceIDs != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMInstanceIDs)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RestartSender sends the Restart request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) RestartSender(req *http.Request) (future VirtualMachineScaleSetsRestartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RestartResponder handles the response to the Restart request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Start starts one or more virtual machines in a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. -func (client VirtualMachineScaleSetsClient) Start(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsStartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Start") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StartPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Start", nil, "Failure preparing request") - return - } - - result, err = client.StartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Start", result.Response(), "Failure sending request") - return - } - - return -} - -// StartPreparer prepares the Start request. -func (client VirtualMachineScaleSetsClient) StartPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMInstanceIDs != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMInstanceIDs)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartSender sends the Start request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) StartSender(req *http.Request) (future VirtualMachineScaleSetsStartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StartResponder handles the response to the Start request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Update update a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set to create or update. -// parameters - the scale set object. -func (client VirtualMachineScaleSetsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSetUpdate) (result VirtualMachineScaleSetsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, VMScaleSetName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client VirtualMachineScaleSetsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSetUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) UpdateSender(req *http.Request) (future VirtualMachineScaleSetsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) UpdateResponder(resp *http.Response) (result VirtualMachineScaleSet, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// UpdateInstances upgrades one or more virtual machines to the latest SKU set in the VM scale set model. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. -func (client VirtualMachineScaleSetsClient) UpdateInstances(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs) (result VirtualMachineScaleSetsUpdateInstancesFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetsClient.UpdateInstances") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: VMInstanceIDs, - Constraints: []validation.Constraint{{Target: "VMInstanceIDs.InstanceIds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachineScaleSetsClient", "UpdateInstances", err.Error()) - } - - req, err := client.UpdateInstancesPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "UpdateInstances", nil, "Failure preparing request") - return - } - - result, err = client.UpdateInstancesSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "UpdateInstances", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdateInstancesPreparer prepares the UpdateInstances request. -func (client VirtualMachineScaleSetsClient) UpdateInstancesPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade", pathParameters), - autorest.WithJSON(VMInstanceIDs), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateInstancesSender sends the UpdateInstances request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetsClient) UpdateInstancesSender(req *http.Request) (future VirtualMachineScaleSetsUpdateInstancesFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateInstancesResponder handles the response to the UpdateInstances request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetsClient) UpdateInstancesResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesetvmextensions.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesetvmextensions.go deleted file mode 100644 index d8c46855240c..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesetvmextensions.go +++ /dev/null @@ -1,453 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineScaleSetVMExtensionsClient is the compute Client -type VirtualMachineScaleSetVMExtensionsClient struct { - BaseClient -} - -// NewVirtualMachineScaleSetVMExtensionsClient creates an instance of the VirtualMachineScaleSetVMExtensionsClient -// client. -func NewVirtualMachineScaleSetVMExtensionsClient(subscriptionID string) VirtualMachineScaleSetVMExtensionsClient { - return NewVirtualMachineScaleSetVMExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineScaleSetVMExtensionsClientWithBaseURI creates an instance of the -// VirtualMachineScaleSetVMExtensionsClient client using a custom endpoint. Use this when interacting with an Azure -// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewVirtualMachineScaleSetVMExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetVMExtensionsClient { - return VirtualMachineScaleSetVMExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate the operation to create or update the VMSS VM extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// VMExtensionName - the name of the virtual machine extension. -// extensionParameters - parameters supplied to the Create Virtual Machine Extension operation. -func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineExtension) (result VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMExtensionName, extensionParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - result, err = client.CreateOrUpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") - return - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineExtension) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmExtensionName": autorest.Encode("path", VMExtensionName), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}", pathParameters), - autorest.WithJSON(extensionParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineScaleSetVMExtensionsCreateOrUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete the operation to delete the VMSS VM extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// VMExtensionName - the name of the virtual machine extension. -func (client VirtualMachineScaleSetVMExtensionsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string) (result VirtualMachineScaleSetVMExtensionsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMExtensionName) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualMachineScaleSetVMExtensionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmExtensionName": autorest.Encode("path", VMExtensionName), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMExtensionsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetVMExtensionsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMExtensionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get the operation to get the VMSS VM extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// VMExtensionName - the name of the virtual machine extension. -// expand - the expand expression to apply on the operation. -func (client VirtualMachineScaleSetVMExtensionsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, expand string) (result VirtualMachineExtension, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMExtensionName, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineScaleSetVMExtensionsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmExtensionName": autorest.Encode("path", VMExtensionName), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMExtensionsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List the operation to get all extensions of an instance in Virtual Machine Scaleset. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// expand - the expand expression to apply on the operation. -func (client VirtualMachineScaleSetVMExtensionsClient) List(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (result VirtualMachineExtensionsListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ListPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineScaleSetVMExtensionsClient) ListPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMExtensionsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMExtensionsClient) ListResponder(resp *http.Response) (result VirtualMachineExtensionsListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Update the operation to update the VMSS VM extension. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// VMExtensionName - the name of the virtual machine extension. -// extensionParameters - parameters supplied to the Update Virtual Machine Extension operation. -func (client VirtualMachineScaleSetVMExtensionsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineExtensionUpdate) (result VirtualMachineScaleSetVMExtensionsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMExtensionsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMExtensionName, extensionParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMExtensionsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client VirtualMachineScaleSetVMExtensionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMExtensionName string, extensionParameters VirtualMachineExtensionUpdate) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmExtensionName": autorest.Encode("path", VMExtensionName), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualMachines/{instanceId}/extensions/{vmExtensionName}", pathParameters), - autorest.WithJSON(extensionParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMExtensionsClient) UpdateSender(req *http.Request) (future VirtualMachineScaleSetVMExtensionsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMExtensionsClient) UpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesetvms.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesetvms.go deleted file mode 100644 index 05e847d9b690..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesetvms.go +++ /dev/null @@ -1,1263 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineScaleSetVMsClient is the compute Client -type VirtualMachineScaleSetVMsClient struct { - BaseClient -} - -// NewVirtualMachineScaleSetVMsClient creates an instance of the VirtualMachineScaleSetVMsClient client. -func NewVirtualMachineScaleSetVMsClient(subscriptionID string) VirtualMachineScaleSetVMsClient { - return NewVirtualMachineScaleSetVMsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineScaleSetVMsClientWithBaseURI creates an instance of the VirtualMachineScaleSetVMsClient client -// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign -// clouds, Azure stack). -func NewVirtualMachineScaleSetVMsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetVMsClient { - return VirtualMachineScaleSetVMsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// Deallocate deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the -// compute resources it uses. You are not billed for the compute resources of this virtual machine once it is -// deallocated. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) Deallocate(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsDeallocateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Deallocate") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeallocatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Deallocate", nil, "Failure preparing request") - return - } - - result, err = client.DeallocateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Deallocate", result.Response(), "Failure sending request") - return - } - - return -} - -// DeallocatePreparer prepares the Deallocate request. -func (client VirtualMachineScaleSetVMsClient) DeallocatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeallocateSender sends the Deallocate request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) DeallocateSender(req *http.Request) (future VirtualMachineScaleSetVMsDeallocateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeallocateResponder handles the response to the Deallocate request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) DeallocateResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Delete deletes a virtual machine from a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Delete") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client VirtualMachineScaleSetVMsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetVMsDeleteFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets a virtual machine from a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// expand - the expand expression to apply on the operation. -func (client VirtualMachineScaleSetVMsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand InstanceViewTypes) (result VirtualMachineScaleSetVM, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Get") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Get", resp, "Failure responding to request") - return - } - - return -} - -// GetPreparer prepares the Get request. -func (client VirtualMachineScaleSetVMsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, expand InstanceViewTypes) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(string(expand)) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetSender sends the Get request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSetVM, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// GetInstanceView gets the status of a virtual machine from a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) GetInstanceView(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMInstanceView, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.GetInstanceView") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetInstanceViewPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "GetInstanceView", nil, "Failure preparing request") - return - } - - resp, err := client.GetInstanceViewSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "GetInstanceView", resp, "Failure sending request") - return - } - - result, err = client.GetInstanceViewResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "GetInstanceView", resp, "Failure responding to request") - return - } - - return -} - -// GetInstanceViewPreparer prepares the GetInstanceView request. -func (client VirtualMachineScaleSetVMsClient) GetInstanceViewPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/instanceView", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetInstanceViewSender sends the GetInstanceView request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) GetInstanceViewSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetInstanceViewResponder handles the response to the GetInstanceView request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) GetInstanceViewResponder(resp *http.Response) (result VirtualMachineScaleSetVMInstanceView, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets a list of all virtual machines in a VM scale sets. -// Parameters: -// resourceGroupName - the name of the resource group. -// virtualMachineScaleSetName - the name of the VM scale set. -// filter - the filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, -// 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'. -// selectParameter - the list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. -// expand - the expand expression to apply to the operation. Allowed values are 'instanceView'. -func (client VirtualMachineScaleSetVMsClient) List(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result VirtualMachineScaleSetVMListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.List") - defer func() { - sc := -1 - if result.vmssvlr.Response.Response != nil { - sc = result.vmssvlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, virtualMachineScaleSetName, filter, selectParameter, expand) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.vmssvlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", resp, "Failure sending request") - return - } - - result.vmssvlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", resp, "Failure responding to request") - return - } - if result.vmssvlr.hasNextLink() && result.vmssvlr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineScaleSetVMsClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if len(selectParameter) > 0 { - queryParameters["$select"] = autorest.Encode("query", selectParameter) - } - if len(expand) > 0 { - queryParameters["$expand"] = autorest.Encode("query", expand) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetVMListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listNextResults retrieves the next set of results, if any. -func (client VirtualMachineScaleSetVMsClient) listNextResults(ctx context.Context, lastResults VirtualMachineScaleSetVMListResult) (result VirtualMachineScaleSetVMListResult, err error) { - req, err := lastResults.virtualMachineScaleSetVMListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "listNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineScaleSetVMsClient) ListComplete(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result VirtualMachineScaleSetVMListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, virtualMachineScaleSetName, filter, selectParameter, expand) - return -} - -// PerformMaintenance shuts down the virtual machine in a VMScaleSet, moves it to an already updated node, and powers -// it back on during the self-service phase of planned maintenance. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) PerformMaintenance(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsPerformMaintenanceFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.PerformMaintenance") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PerformMaintenancePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PerformMaintenance", nil, "Failure preparing request") - return - } - - result, err = client.PerformMaintenanceSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PerformMaintenance", result.Response(), "Failure sending request") - return - } - - return -} - -// PerformMaintenancePreparer prepares the PerformMaintenance request. -func (client VirtualMachineScaleSetVMsClient) PerformMaintenancePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/performMaintenance", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PerformMaintenanceSender sends the PerformMaintenance request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) PerformMaintenanceSender(req *http.Request) (future VirtualMachineScaleSetVMsPerformMaintenanceFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PerformMaintenanceResponder handles the response to the PerformMaintenance request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) PerformMaintenanceResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// PowerOff power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are -// getting charged for the resources. Instead, use deallocate to release resources and avoid charges. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// skipShutdown - the parameter to request non-graceful VM shutdown. True value for this flag indicates -// non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not -// specified -func (client VirtualMachineScaleSetVMsClient) PowerOff(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, skipShutdown *bool) (result VirtualMachineScaleSetVMsPowerOffFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.PowerOff") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.PowerOffPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, skipShutdown) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PowerOff", nil, "Failure preparing request") - return - } - - result, err = client.PowerOffSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PowerOff", result.Response(), "Failure sending request") - return - } - - return -} - -// PowerOffPreparer prepares the PowerOff request. -func (client VirtualMachineScaleSetVMsClient) PowerOffPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, skipShutdown *bool) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if skipShutdown != nil { - queryParameters["skipShutdown"] = autorest.Encode("query", *skipShutdown) - } else { - queryParameters["skipShutdown"] = autorest.Encode("query", false) - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// PowerOffSender sends the PowerOff request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) PowerOffSender(req *http.Request) (future VirtualMachineScaleSetVMsPowerOffFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// PowerOffResponder handles the response to the PowerOff request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) PowerOffResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Redeploy shuts down the virtual machine in the virtual machine scale set, moves it to a new node, and powers it back -// on. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) Redeploy(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsRedeployFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Redeploy") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RedeployPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Redeploy", nil, "Failure preparing request") - return - } - - result, err = client.RedeploySender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Redeploy", result.Response(), "Failure sending request") - return - } - - return -} - -// RedeployPreparer prepares the Redeploy request. -func (client VirtualMachineScaleSetVMsClient) RedeployPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/redeploy", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RedeploySender sends the Redeploy request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) RedeploySender(req *http.Request) (future VirtualMachineScaleSetVMsRedeployFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RedeployResponder handles the response to the Redeploy request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) RedeployResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Reimage reimages (upgrade the operating system) a specific virtual machine in a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// VMScaleSetVMReimageInput - parameters for the Reimaging Virtual machine in ScaleSet. -func (client VirtualMachineScaleSetVMsClient) Reimage(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMScaleSetVMReimageInput *VirtualMachineScaleSetVMReimageParameters) (result VirtualMachineScaleSetVMsReimageFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Reimage") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ReimagePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMScaleSetVMReimageInput) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Reimage", nil, "Failure preparing request") - return - } - - result, err = client.ReimageSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Reimage", result.Response(), "Failure sending request") - return - } - - return -} - -// ReimagePreparer prepares the Reimage request. -func (client VirtualMachineScaleSetVMsClient) ReimagePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMScaleSetVMReimageInput *VirtualMachineScaleSetVMReimageParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage", pathParameters), - autorest.WithQueryParameters(queryParameters)) - if VMScaleSetVMReimageInput != nil { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMScaleSetVMReimageInput)) - } - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReimageSender sends the Reimage request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) ReimageSender(req *http.Request) (future VirtualMachineScaleSetVMsReimageFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ReimageResponder handles the response to the Reimage request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// ReimageAll allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This -// operation is only supported for managed disks. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) ReimageAll(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsReimageAllFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.ReimageAll") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.ReimageAllPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "ReimageAll", nil, "Failure preparing request") - return - } - - result, err = client.ReimageAllSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "ReimageAll", result.Response(), "Failure sending request") - return - } - - return -} - -// ReimageAllPreparer prepares the ReimageAll request. -func (client VirtualMachineScaleSetVMsClient) ReimageAllPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimageall", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ReimageAllSender sends the ReimageAll request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) ReimageAllSender(req *http.Request) (future VirtualMachineScaleSetVMsReimageAllFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// ReimageAllResponder handles the response to the ReimageAll request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) ReimageAllResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Restart restarts a virtual machine in a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) Restart(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsRestartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Restart") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.RestartPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Restart", nil, "Failure preparing request") - return - } - - result, err = client.RestartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Restart", result.Response(), "Failure sending request") - return - } - - return -} - -// RestartPreparer prepares the Restart request. -func (client VirtualMachineScaleSetVMsClient) RestartPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RestartSender sends the Restart request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) RestartSender(req *http.Request) (future VirtualMachineScaleSetVMsRestartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RestartResponder handles the response to the Restart request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// RunCommand run command on a virtual machine in a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -// parameters - parameters supplied to the Run command operation. -func (client VirtualMachineScaleSetVMsClient) RunCommand(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, parameters RunCommandInput) (result VirtualMachineScaleSetVMsRunCommandFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.RunCommand") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.CommandID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachineScaleSetVMsClient", "RunCommand", err.Error()) - } - - req, err := client.RunCommandPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "RunCommand", nil, "Failure preparing request") - return - } - - result, err = client.RunCommandSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "RunCommand", result.Response(), "Failure sending request") - return - } - - return -} - -// RunCommandPreparer prepares the RunCommand request. -func (client VirtualMachineScaleSetVMsClient) RunCommandPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, parameters RunCommandInput) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/runCommand", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// RunCommandSender sends the RunCommand request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) RunCommandSender(req *http.Request) (future VirtualMachineScaleSetVMsRunCommandFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// RunCommandResponder handles the response to the RunCommand request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) RunCommandResponder(resp *http.Response) (result RunCommandResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Start starts a virtual machine in a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set. -// instanceID - the instance ID of the virtual machine. -func (client VirtualMachineScaleSetVMsClient) Start(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsStartFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Start") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.StartPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Start", nil, "Failure preparing request") - return - } - - result, err = client.StartSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Start", result.Response(), "Failure sending request") - return - } - - return -} - -// StartPreparer prepares the Start request. -func (client VirtualMachineScaleSetVMsClient) StartPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// StartSender sends the Start request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) StartSender(req *http.Request) (future VirtualMachineScaleSetVMsStartFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// StartResponder handles the response to the Start request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Update updates a virtual machine of a VM scale set. -// Parameters: -// resourceGroupName - the name of the resource group. -// VMScaleSetName - the name of the VM scale set where the extension should be create or updated. -// instanceID - the instance ID of the virtual machine. -// parameters - parameters supplied to the Update Virtual Machine Scale Sets VM operation. -func (client VirtualMachineScaleSetVMsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, parameters VirtualMachineScaleSetVM) (result VirtualMachineScaleSetVMsUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Update") - defer func() { - sc := -1 - if result.FutureAPI != nil && result.FutureAPI.Response() != nil { - sc = result.FutureAPI.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SecretURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.VirtualMachineScaleSetVMProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachineScaleSetVMsClient", "Update", err.Error()) - } - - req, err := client.UpdatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client VirtualMachineScaleSetVMsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, parameters VirtualMachineScaleSetVM) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "instanceId": autorest.Encode("path", instanceID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "vmScaleSetName": autorest.Encode("path", VMScaleSetName), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - parameters.InstanceID = nil - parameters.Sku = nil - parameters.Resources = nil - parameters.Zones = nil - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateSender sends the Update request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineScaleSetVMsClient) UpdateSender(req *http.Request) (future VirtualMachineScaleSetVMsUpdateFuture, err error) { - var resp *http.Response - future.FutureAPI = &azure.Future{} - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - var azf azure.Future - azf, err = azure.NewFutureFromResponse(resp) - future.FutureAPI = &azf - future.Result = future.result - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client VirtualMachineScaleSetVMsClient) UpdateResponder(resp *http.Response) (result VirtualMachineScaleSetVM, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/virtualmachinesizes.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/virtualmachinesizes.go deleted file mode 100644 index 63fca1d18433..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/virtualmachinesizes.go +++ /dev/null @@ -1,114 +0,0 @@ -package compute - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// VirtualMachineSizesClient is the compute Client -type VirtualMachineSizesClient struct { - BaseClient -} - -// NewVirtualMachineSizesClient creates an instance of the VirtualMachineSizesClient client. -func NewVirtualMachineSizesClient(subscriptionID string) VirtualMachineSizesClient { - return NewVirtualMachineSizesClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewVirtualMachineSizesClientWithBaseURI creates an instance of the VirtualMachineSizesClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewVirtualMachineSizesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineSizesClient { - return VirtualMachineSizesClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List this API is deprecated. Use [Resources -// Skus](https://docs.microsoft.com/en-us/rest/api/compute/resourceskus/list) -// Parameters: -// location - the location upon which virtual-machine-sizes is queried. -func (client VirtualMachineSizesClient) List(ctx context.Context, location string) (result VirtualMachineSizeListResult, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineSizesClient.List") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: location, - Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("compute.VirtualMachineSizesClient", "List", err.Error()) - } - - req, err := client.ListPreparer(ctx, location) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineSizesClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "compute.VirtualMachineSizesClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "compute.VirtualMachineSizesClient", "List", resp, "Failure responding to request") - return - } - - return -} - -// ListPreparer prepares the List request. -func (client VirtualMachineSizesClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-07-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client VirtualMachineSizesClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client VirtualMachineSizesClient) ListResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/CHANGELOG.md b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/CHANGELOG.md deleted file mode 100644 index 52911e4cc5e4..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Change History - diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/_meta.json b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/_meta.json deleted file mode 100644 index 04957b5c7609..000000000000 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/_meta.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "commit": "1c8d7850afbec9ede6de6f2d14bcc30896a74ed6", - "readme": "/_/azure-rest-api-specs/specification/network/resource-manager/readme.md", - "tag": "package-2021-08", - "use": "@microsoft.azure/autorest.go@2.1.188", - "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.188 --tag=package-2021-08 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix /_/azure-rest-api-specs/specification/network/resource-manager/readme.md", - "additional_properties": { - "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix" - } -} \ No newline at end of file diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/CHANGELOG.md b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/CHANGELOG.md similarity index 100% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/CHANGELOG.md rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/CHANGELOG.md diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/_meta.json b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/_meta.json similarity index 59% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/_meta.json rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/_meta.json index 6663f4e2919a..1ccde570f9ae 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute/_meta.json +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/_meta.json @@ -1,10 +1,10 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", - "readme": "/_/azure-rest-api-specs/specification/compute/resource-manager/readme.md", - "tag": "package-2019-07", - "use": "@microsoft.azure/autorest.go@2.1.187", + "commit": "c91eca4e2081703002581da6f58f9d9332e1afd1", + "readme": "/_/azure-rest-api-specs/specification/network/resource-manager/readme.md", + "tag": "package-2022-07", + "use": "@microsoft.azure/autorest.go@2.1.188", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2019-07 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/compute/resource-manager/readme.md", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.188 --tag=package-2022-07 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/network/resource-manager/readme.md", "additional_properties": { "additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION" } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/adminrulecollections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/adminrulecollections.go new file mode 100644 index 000000000000..2292b61ce294 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/adminrulecollections.go @@ -0,0 +1,431 @@ +package network + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// AdminRuleCollectionsClient is the network Client +type AdminRuleCollectionsClient struct { + BaseClient +} + +// NewAdminRuleCollectionsClient creates an instance of the AdminRuleCollectionsClient client. +func NewAdminRuleCollectionsClient(subscriptionID string) AdminRuleCollectionsClient { + return NewAdminRuleCollectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAdminRuleCollectionsClientWithBaseURI creates an instance of the AdminRuleCollectionsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewAdminRuleCollectionsClientWithBaseURI(baseURI string, subscriptionID string) AdminRuleCollectionsClient { + return AdminRuleCollectionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates an admin rule collection. +// Parameters: +// ruleCollection - the Rule Collection to create or update +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +// configurationName - the name of the network manager Security Configuration. +// ruleCollectionName - the name of the network manager security Configuration rule collection. +func (client AdminRuleCollectionsClient) CreateOrUpdate(ctx context.Context, ruleCollection AdminRuleCollection, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string) (result AdminRuleCollection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AdminRuleCollectionsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: ruleCollection, + Constraints: []validation.Constraint{{Target: "ruleCollection.AdminRuleCollectionPropertiesFormat", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "ruleCollection.AdminRuleCollectionPropertiesFormat.AppliesToGroups", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("network.AdminRuleCollectionsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, ruleCollection, resourceGroupName, networkManagerName, configurationName, ruleCollectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AdminRuleCollectionsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.AdminRuleCollectionsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AdminRuleCollectionsClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client AdminRuleCollectionsClient) CreateOrUpdatePreparer(ctx context.Context, ruleCollection AdminRuleCollection, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "configurationName": autorest.Encode("path", configurationName), + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "ruleCollectionName": autorest.Encode("path", ruleCollectionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + ruleCollection.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}", pathParameters), + autorest.WithJSON(ruleCollection), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client AdminRuleCollectionsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client AdminRuleCollectionsClient) CreateOrUpdateResponder(resp *http.Response) (result AdminRuleCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an admin rule collection. +// Parameters: +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +// configurationName - the name of the network manager Security Configuration. +// ruleCollectionName - the name of the network manager security Configuration rule collection. +// force - deletes the resource even if it is part of a deployed configuration. If the configuration has been +// deployed, the service will do a cleanup deployment in the background, prior to the delete. +func (client AdminRuleCollectionsClient) Delete(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, force *bool) (result AdminRuleCollectionsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AdminRuleCollectionsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, force) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AdminRuleCollectionsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AdminRuleCollectionsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AdminRuleCollectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, force *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "configurationName": autorest.Encode("path", configurationName), + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "ruleCollectionName": autorest.Encode("path", ruleCollectionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if force != nil { + queryParameters["force"] = autorest.Encode("query", *force) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client AdminRuleCollectionsClient) DeleteSender(req *http.Request) (future AdminRuleCollectionsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client AdminRuleCollectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a network manager security admin configuration rule collection. +// Parameters: +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +// configurationName - the name of the network manager Security Configuration. +// ruleCollectionName - the name of the network manager security Configuration rule collection. +func (client AdminRuleCollectionsClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string) (result AdminRuleCollection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AdminRuleCollectionsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, networkManagerName, configurationName, ruleCollectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AdminRuleCollectionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.AdminRuleCollectionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AdminRuleCollectionsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client AdminRuleCollectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "configurationName": autorest.Encode("path", configurationName), + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "ruleCollectionName": autorest.Encode("path", ruleCollectionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client AdminRuleCollectionsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AdminRuleCollectionsClient) GetResponder(resp *http.Response) (result AdminRuleCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all the rule collections in a security admin configuration, in a paginated format. +// Parameters: +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +// configurationName - the name of the network manager Security Configuration. +// top - an optional query parameter which specifies the maximum number of records to be returned by the +// server. +// skipToken - skipToken is only used if a previous operation returned a partial result. If a previous response +// contains a nextLink element, the value of the nextLink element will include a skipToken parameter that +// specifies a starting point to use for subsequent calls. +func (client AdminRuleCollectionsClient) List(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, top *int32, skipToken string) (result AdminRuleCollectionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AdminRuleCollectionsClient.List") + defer func() { + sc := -1 + if result.arclr.Response.Response != nil { + sc = result.arclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, + {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("network.AdminRuleCollectionsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, networkManagerName, configurationName, top, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AdminRuleCollectionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.arclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.AdminRuleCollectionsClient", "List", resp, "Failure sending request") + return + } + + result.arclr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AdminRuleCollectionsClient", "List", resp, "Failure responding to request") + return + } + if result.arclr.hasNextLink() && result.arclr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client AdminRuleCollectionsClient) ListPreparer(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, top *int32, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "configurationName": autorest.Encode("path", configurationName), + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client AdminRuleCollectionsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client AdminRuleCollectionsClient) ListResponder(resp *http.Response) (result AdminRuleCollectionListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client AdminRuleCollectionsClient) listNextResults(ctx context.Context, lastResults AdminRuleCollectionListResult) (result AdminRuleCollectionListResult, err error) { + req, err := lastResults.adminRuleCollectionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "network.AdminRuleCollectionsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.AdminRuleCollectionsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AdminRuleCollectionsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client AdminRuleCollectionsClient) ListComplete(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, top *int32, skipToken string) (result AdminRuleCollectionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AdminRuleCollectionsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, networkManagerName, configurationName, top, skipToken) + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/adminrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/adminrules.go new file mode 100644 index 000000000000..e38d6e174a6a --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/adminrules.go @@ -0,0 +1,430 @@ +package network + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// AdminRulesClient is the network Client +type AdminRulesClient struct { + BaseClient +} + +// NewAdminRulesClient creates an instance of the AdminRulesClient client. +func NewAdminRulesClient(subscriptionID string) AdminRulesClient { + return NewAdminRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAdminRulesClientWithBaseURI creates an instance of the AdminRulesClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewAdminRulesClientWithBaseURI(baseURI string, subscriptionID string) AdminRulesClient { + return AdminRulesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates an admin rule. +// Parameters: +// adminRule - the admin rule to create or update +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +// configurationName - the name of the network manager Security Configuration. +// ruleCollectionName - the name of the network manager security Configuration rule collection. +// ruleName - the name of the rule. +func (client AdminRulesClient) CreateOrUpdate(ctx context.Context, adminRule BasicBaseAdminRule, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string) (result BaseAdminRuleModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AdminRulesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, adminRule, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AdminRulesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.AdminRulesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AdminRulesClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client AdminRulesClient) CreateOrUpdatePreparer(ctx context.Context, adminRule BasicBaseAdminRule, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "configurationName": autorest.Encode("path", configurationName), + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "ruleCollectionName": autorest.Encode("path", ruleCollectionName), + "ruleName": autorest.Encode("path", ruleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}", pathParameters), + autorest.WithJSON(adminRule), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client AdminRulesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client AdminRulesClient) CreateOrUpdateResponder(resp *http.Response) (result BaseAdminRuleModel, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an admin rule. +// Parameters: +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +// configurationName - the name of the network manager Security Configuration. +// ruleCollectionName - the name of the network manager security Configuration rule collection. +// ruleName - the name of the rule. +// force - deletes the resource even if it is part of a deployed configuration. If the configuration has been +// deployed, the service will do a cleanup deployment in the background, prior to the delete. +func (client AdminRulesClient) Delete(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, force *bool) (result AdminRulesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AdminRulesClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName, force) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AdminRulesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AdminRulesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AdminRulesClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string, force *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "configurationName": autorest.Encode("path", configurationName), + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "ruleCollectionName": autorest.Encode("path", ruleCollectionName), + "ruleName": autorest.Encode("path", ruleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if force != nil { + queryParameters["force"] = autorest.Encode("query", *force) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client AdminRulesClient) DeleteSender(req *http.Request) (future AdminRulesDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client AdminRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a network manager security configuration admin rule. +// Parameters: +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +// configurationName - the name of the network manager Security Configuration. +// ruleCollectionName - the name of the network manager security Configuration rule collection. +// ruleName - the name of the rule. +func (client AdminRulesClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string) (result BaseAdminRuleModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AdminRulesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, ruleName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AdminRulesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.AdminRulesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AdminRulesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client AdminRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, ruleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "configurationName": autorest.Encode("path", configurationName), + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "ruleCollectionName": autorest.Encode("path", ruleCollectionName), + "ruleName": autorest.Encode("path", ruleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules/{ruleName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client AdminRulesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AdminRulesClient) GetResponder(resp *http.Response) (result BaseAdminRuleModel, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list all network manager security configuration admin rules. +// Parameters: +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +// configurationName - the name of the network manager Security Configuration. +// ruleCollectionName - the name of the network manager security Configuration rule collection. +// top - an optional query parameter which specifies the maximum number of records to be returned by the +// server. +// skipToken - skipToken is only used if a previous operation returned a partial result. If a previous response +// contains a nextLink element, the value of the nextLink element will include a skipToken parameter that +// specifies a starting point to use for subsequent calls. +func (client AdminRulesClient) List(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, top *int32, skipToken string) (result AdminRuleListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AdminRulesClient.List") + defer func() { + sc := -1 + if result.arlr.Response.Response != nil { + sc = result.arlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, + {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("network.AdminRulesClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, top, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AdminRulesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.arlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.AdminRulesClient", "List", resp, "Failure sending request") + return + } + + result.arlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AdminRulesClient", "List", resp, "Failure responding to request") + return + } + if result.arlr.hasNextLink() && result.arlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client AdminRulesClient) ListPreparer(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, top *int32, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "configurationName": autorest.Encode("path", configurationName), + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "ruleCollectionName": autorest.Encode("path", ruleCollectionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}/ruleCollections/{ruleCollectionName}/rules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client AdminRulesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client AdminRulesClient) ListResponder(resp *http.Response) (result AdminRuleListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client AdminRulesClient) listNextResults(ctx context.Context, lastResults AdminRuleListResult) (result AdminRuleListResult, err error) { + req, err := lastResults.adminRuleListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "network.AdminRulesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.AdminRulesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AdminRulesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client AdminRulesClient) ListComplete(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, ruleCollectionName string, top *int32, skipToken string) (result AdminRuleListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AdminRulesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, networkManagerName, configurationName, ruleCollectionName, top, skipToken) + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/applicationgatewayprivateendpointconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationgatewayprivateendpointconnections.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/applicationgatewayprivateendpointconnections.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationgatewayprivateendpointconnections.go index 2e1a4a6839b9..917f0b7b641b 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/applicationgatewayprivateendpointconnections.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationgatewayprivateendpointconnections.go @@ -72,7 +72,7 @@ func (client ApplicationGatewayPrivateEndpointConnectionsClient) DeletePreparer( "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -159,7 +159,7 @@ func (client ApplicationGatewayPrivateEndpointConnectionsClient) GetPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -240,7 +240,7 @@ func (client ApplicationGatewayPrivateEndpointConnectionsClient) ListPreparer(ct "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -349,7 +349,7 @@ func (client ApplicationGatewayPrivateEndpointConnectionsClient) UpdatePreparer( "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/applicationgatewayprivatelinkresources.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationgatewayprivatelinkresources.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/applicationgatewayprivatelinkresources.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationgatewayprivatelinkresources.go index b3c4a19361d6..e899d166e863 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/applicationgatewayprivatelinkresources.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationgatewayprivatelinkresources.go @@ -82,7 +82,7 @@ func (client ApplicationGatewayPrivateLinkResourcesClient) ListPreparer(ctx cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/applicationgateways.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationgateways.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/applicationgateways.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationgateways.go index 08eed6176d25..55a64bbc1ae7 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/applicationgateways.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationgateways.go @@ -71,7 +71,7 @@ func (client ApplicationGatewaysClient) BackendHealthPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -156,7 +156,7 @@ func (client ApplicationGatewaysClient) BackendHealthOnDemandPreparer(ctx contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -269,7 +269,7 @@ func (client ApplicationGatewaysClient) CreateOrUpdatePreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -351,7 +351,7 @@ func (client ApplicationGatewaysClient) DeletePreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -436,7 +436,7 @@ func (client ApplicationGatewaysClient) GetPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -510,7 +510,7 @@ func (client ApplicationGatewaysClient) GetSslPredefinedPolicyPreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -589,7 +589,7 @@ func (client ApplicationGatewaysClient) ListPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -702,7 +702,7 @@ func (client ApplicationGatewaysClient) ListAllPreparer(ctx context.Context) (*h "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -810,7 +810,7 @@ func (client ApplicationGatewaysClient) ListAvailableRequestHeadersPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -881,7 +881,7 @@ func (client ApplicationGatewaysClient) ListAvailableResponseHeadersPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -952,7 +952,7 @@ func (client ApplicationGatewaysClient) ListAvailableServerVariablesPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1023,7 +1023,7 @@ func (client ApplicationGatewaysClient) ListAvailableSslOptionsPreparer(ctx cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1099,7 +1099,7 @@ func (client ApplicationGatewaysClient) ListAvailableSslPredefinedPoliciesPrepar "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1207,7 +1207,7 @@ func (client ApplicationGatewaysClient) ListAvailableWafRuleSetsPreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1276,7 +1276,7 @@ func (client ApplicationGatewaysClient) StartPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1354,7 +1354,7 @@ func (client ApplicationGatewaysClient) StopPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1440,7 +1440,7 @@ func (client ApplicationGatewaysClient) UpdateTagsPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationgatewaywafdynamicmanifests.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationgatewaywafdynamicmanifests.go new file mode 100644 index 000000000000..b77a7e4da9eb --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationgatewaywafdynamicmanifests.go @@ -0,0 +1,149 @@ +package network + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ApplicationGatewayWafDynamicManifestsClient is the network Client +type ApplicationGatewayWafDynamicManifestsClient struct { + BaseClient +} + +// NewApplicationGatewayWafDynamicManifestsClient creates an instance of the +// ApplicationGatewayWafDynamicManifestsClient client. +func NewApplicationGatewayWafDynamicManifestsClient(subscriptionID string) ApplicationGatewayWafDynamicManifestsClient { + return NewApplicationGatewayWafDynamicManifestsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewApplicationGatewayWafDynamicManifestsClientWithBaseURI creates an instance of the +// ApplicationGatewayWafDynamicManifestsClient client using a custom endpoint. Use this when interacting with an Azure +// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewApplicationGatewayWafDynamicManifestsClientWithBaseURI(baseURI string, subscriptionID string) ApplicationGatewayWafDynamicManifestsClient { + return ApplicationGatewayWafDynamicManifestsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets the regional application gateway waf manifest. +// Parameters: +// location - the region where the nrp are located at. +func (client ApplicationGatewayWafDynamicManifestsClient) Get(ctx context.Context, location string) (result ApplicationGatewayWafDynamicManifestResultListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayWafDynamicManifestsClient.Get") + defer func() { + sc := -1 + if result.agwdmrl.Response.Response != nil { + sc = result.agwdmrl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.getNextResults + req, err := client.GetPreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewayWafDynamicManifestsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.agwdmrl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.ApplicationGatewayWafDynamicManifestsClient", "Get", resp, "Failure sending request") + return + } + + result.agwdmrl, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewayWafDynamicManifestsClient", "Get", resp, "Failure responding to request") + return + } + if result.agwdmrl.hasNextLink() && result.agwdmrl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ApplicationGatewayWafDynamicManifestsClient) GetPreparer(ctx context.Context, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/applicationGatewayWafDynamicManifests", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ApplicationGatewayWafDynamicManifestsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ApplicationGatewayWafDynamicManifestsClient) GetResponder(resp *http.Response) (result ApplicationGatewayWafDynamicManifestResultList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getNextResults retrieves the next set of results, if any. +func (client ApplicationGatewayWafDynamicManifestsClient) getNextResults(ctx context.Context, lastResults ApplicationGatewayWafDynamicManifestResultList) (result ApplicationGatewayWafDynamicManifestResultList, err error) { + req, err := lastResults.applicationGatewayWafDynamicManifestResultListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "network.ApplicationGatewayWafDynamicManifestsClient", "getNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.ApplicationGatewayWafDynamicManifestsClient", "getNextResults", resp, "Failure sending next results request") + } + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewayWafDynamicManifestsClient", "getNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetComplete enumerates all values, automatically crossing page boundaries as required. +func (client ApplicationGatewayWafDynamicManifestsClient) GetComplete(ctx context.Context, location string) (result ApplicationGatewayWafDynamicManifestResultListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayWafDynamicManifestsClient.Get") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.Get(ctx, location) + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationgatewaywafdynamicmanifestsdefault.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationgatewaywafdynamicmanifestsdefault.go new file mode 100644 index 000000000000..5068e59eef52 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationgatewaywafdynamicmanifestsdefault.go @@ -0,0 +1,107 @@ +package network + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ApplicationGatewayWafDynamicManifestsDefaultClient is the network Client +type ApplicationGatewayWafDynamicManifestsDefaultClient struct { + BaseClient +} + +// NewApplicationGatewayWafDynamicManifestsDefaultClient creates an instance of the +// ApplicationGatewayWafDynamicManifestsDefaultClient client. +func NewApplicationGatewayWafDynamicManifestsDefaultClient(subscriptionID string) ApplicationGatewayWafDynamicManifestsDefaultClient { + return NewApplicationGatewayWafDynamicManifestsDefaultClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewApplicationGatewayWafDynamicManifestsDefaultClientWithBaseURI creates an instance of the +// ApplicationGatewayWafDynamicManifestsDefaultClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewApplicationGatewayWafDynamicManifestsDefaultClientWithBaseURI(baseURI string, subscriptionID string) ApplicationGatewayWafDynamicManifestsDefaultClient { + return ApplicationGatewayWafDynamicManifestsDefaultClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets the regional application gateway waf manifest. +// Parameters: +// location - the region where the nrp are located at. +func (client ApplicationGatewayWafDynamicManifestsDefaultClient) Get(ctx context.Context, location string) (result ApplicationGatewayWafDynamicManifestResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayWafDynamicManifestsDefaultClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewayWafDynamicManifestsDefaultClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.ApplicationGatewayWafDynamicManifestsDefaultClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewayWafDynamicManifestsDefaultClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ApplicationGatewayWafDynamicManifestsDefaultClient) GetPreparer(ctx context.Context, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/applicationGatewayWafDynamicManifests/dafault", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ApplicationGatewayWafDynamicManifestsDefaultClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ApplicationGatewayWafDynamicManifestsDefaultClient) GetResponder(resp *http.Response) (result ApplicationGatewayWafDynamicManifestResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/applicationsecuritygroups.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationsecuritygroups.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/applicationsecuritygroups.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationsecuritygroups.go index 062cd381e95b..7e0bf86d3a64 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/applicationsecuritygroups.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/applicationsecuritygroups.go @@ -70,7 +70,7 @@ func (client ApplicationSecurityGroupsClient) CreateOrUpdatePreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -152,7 +152,7 @@ func (client ApplicationSecurityGroupsClient) DeletePreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -237,7 +237,7 @@ func (client ApplicationSecurityGroupsClient) GetPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -316,7 +316,7 @@ func (client ApplicationSecurityGroupsClient) ListPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -429,7 +429,7 @@ func (client ApplicationSecurityGroupsClient) ListAllPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -543,7 +543,7 @@ func (client ApplicationSecurityGroupsClient) UpdateTagsPreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/availabledelegations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/availabledelegations.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/availabledelegations.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/availabledelegations.go index 14c6080dde1d..f5262c88511f 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/availabledelegations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/availabledelegations.go @@ -79,7 +79,7 @@ func (client AvailableDelegationsClient) ListPreparer(ctx context.Context, locat "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/availableendpointservices.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/availableendpointservices.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/availableendpointservices.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/availableendpointservices.go index 6da78683f7f8..c5ac9b3f4e76 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/availableendpointservices.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/availableendpointservices.go @@ -79,7 +79,7 @@ func (client AvailableEndpointServicesClient) ListPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/availableprivateendpointtypes.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/availableprivateendpointtypes.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/availableprivateendpointtypes.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/availableprivateendpointtypes.go index 2a76e1d7f1f0..cfbe6e507560 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/availableprivateendpointtypes.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/availableprivateendpointtypes.go @@ -79,7 +79,7 @@ func (client AvailablePrivateEndpointTypesClient) ListPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -198,7 +198,7 @@ func (client AvailablePrivateEndpointTypesClient) ListByResourceGroupPreparer(ct "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/availableresourcegroupdelegations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/availableresourcegroupdelegations.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/availableresourcegroupdelegations.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/availableresourcegroupdelegations.go index 240254d7c7cc..81bce6207291 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/availableresourcegroupdelegations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/availableresourcegroupdelegations.go @@ -82,7 +82,7 @@ func (client AvailableResourceGroupDelegationsClient) ListPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/availableservicealiases.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/availableservicealiases.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/availableservicealiases.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/availableservicealiases.go index 439235398ba2..6b7a2b613dd2 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/availableservicealiases.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/availableservicealiases.go @@ -79,7 +79,7 @@ func (client AvailableServiceAliasesClient) ListPreparer(ctx context.Context, lo "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -197,7 +197,7 @@ func (client AvailableServiceAliasesClient) ListByResourceGroupPreparer(ctx cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/azurefirewallfqdntags.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/azurefirewallfqdntags.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/azurefirewallfqdntags.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/azurefirewallfqdntags.go index d6bc156d54d6..d8d05de9f5b7 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/azurefirewallfqdntags.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/azurefirewallfqdntags.go @@ -76,7 +76,7 @@ func (client AzureFirewallFqdnTagsClient) ListAllPreparer(ctx context.Context) ( "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/azurefirewalls.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/azurefirewalls.go similarity index 86% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/azurefirewalls.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/azurefirewalls.go index df0196dca0e0..3246b6636b66 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/azurefirewalls.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/azurefirewalls.go @@ -77,7 +77,7 @@ func (client AzureFirewallsClient) CreateOrUpdatePreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -159,7 +159,7 @@ func (client AzureFirewallsClient) DeletePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -244,7 +244,7 @@ func (client AzureFirewallsClient) GetPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -323,7 +323,7 @@ func (client AzureFirewallsClient) ListPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -436,7 +436,7 @@ func (client AzureFirewallsClient) ListAllPreparer(ctx context.Context) (*http.R "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -504,6 +504,85 @@ func (client AzureFirewallsClient) ListAllComplete(ctx context.Context) (result return } +// ListLearnedPrefixes retrieves a list of all IP prefixes that azure firewall has learned to not SNAT. +// Parameters: +// resourceGroupName - the name of the resource group. +// azureFirewallName - the name of the azure firewall. +func (client AzureFirewallsClient) ListLearnedPrefixes(ctx context.Context, resourceGroupName string, azureFirewallName string) (result AzureFirewallsListLearnedPrefixesFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AzureFirewallsClient.ListLearnedPrefixes") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListLearnedPrefixesPreparer(ctx, resourceGroupName, azureFirewallName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "ListLearnedPrefixes", nil, "Failure preparing request") + return + } + + result, err = client.ListLearnedPrefixesSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AzureFirewallsClient", "ListLearnedPrefixes", result.Response(), "Failure sending request") + return + } + + return +} + +// ListLearnedPrefixesPreparer prepares the ListLearnedPrefixes request. +func (client AzureFirewallsClient) ListLearnedPrefixesPreparer(ctx context.Context, resourceGroupName string, azureFirewallName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "azureFirewallName": autorest.Encode("path", azureFirewallName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}/learnedIPPrefixes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListLearnedPrefixesSender sends the ListLearnedPrefixes request. The method will close the +// http.Response Body if it receives an error. +func (client AzureFirewallsClient) ListLearnedPrefixesSender(req *http.Request) (future AzureFirewallsListLearnedPrefixesFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ListLearnedPrefixesResponder handles the response to the ListLearnedPrefixes request. The method always +// closes the http.Response Body. +func (client AzureFirewallsClient) ListLearnedPrefixesResponder(resp *http.Response) (result IPPrefixesList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // UpdateTags updates tags of an Azure Firewall resource. // Parameters: // resourceGroupName - the name of the resource group. @@ -543,7 +622,7 @@ func (client AzureFirewallsClient) UpdateTagsPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/bastionhosts.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/bastionhosts.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/bastionhosts.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/bastionhosts.go index 79580ade1c35..f7f7b35717ed 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/bastionhosts.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/bastionhosts.go @@ -81,7 +81,7 @@ func (client BastionHostsClient) CreateOrUpdatePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -163,7 +163,7 @@ func (client BastionHostsClient) DeletePreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -248,7 +248,7 @@ func (client BastionHostsClient) GetPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -324,7 +324,7 @@ func (client BastionHostsClient) ListPreparer(ctx context.Context) (*http.Reques "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -440,7 +440,7 @@ func (client BastionHostsClient) ListByResourceGroupPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -547,7 +547,7 @@ func (client BastionHostsClient) UpdateTagsPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/bgpservicecommunities.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/bgpservicecommunities.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/bgpservicecommunities.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/bgpservicecommunities.go index b4898bf21d2d..661637839aec 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/bgpservicecommunities.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/bgpservicecommunities.go @@ -76,7 +76,7 @@ func (client BgpServiceCommunitiesClient) ListPreparer(ctx context.Context) (*ht "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/client.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/client.go similarity index 63% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/client.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/client.go index b8d584889611..33703c4c94df 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/client.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/client.go @@ -1,6 +1,6 @@ // Deprecated: Please note, this package has been deprecated. A replacement package is available [github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork). We strongly encourage you to upgrade to continue receiving updates. See [Migration Guide](https://aka.ms/azsdk/golang/t2/migration) for guidance on upgrading. Refer to our [deprecation policy](https://azure.github.io/azure-sdk/policies_support.html) for more details. // -// Package network implements the Azure ARM Network service API version 2021-08-01. +// Package network implements the Azure ARM Network service API version . // // Network Client package network @@ -15,6 +15,7 @@ import ( "context" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" "github.com/Azure/go-autorest/tracing" "net/http" ) @@ -91,7 +92,7 @@ func (client BaseClient) CheckDNSNameAvailabilityPreparer(ctx context.Context, l "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, "domainNameLabel": autorest.Encode("query", domainNameLabel), @@ -162,7 +163,7 @@ func (client BaseClient) DeleteBastionShareableLinkPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -255,7 +256,7 @@ func (client BaseClient) DisconnectActiveSessionsPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -325,6 +326,80 @@ func (client BaseClient) DisconnectActiveSessionsComplete(ctx context.Context, r return } +// ExpressRouteProviderPortMethod retrieves detail of a provider port. +// Parameters: +// providerport - the name of the provider port. +func (client BaseClient) ExpressRouteProviderPortMethod(ctx context.Context, providerport string) (result ExpressRouteProviderPort, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ExpressRouteProviderPortMethod") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ExpressRouteProviderPortMethodPreparer(ctx, providerport) + if err != nil { + err = autorest.NewErrorWithError(err, "network.BaseClient", "ExpressRouteProviderPortMethod", nil, "Failure preparing request") + return + } + + resp, err := client.ExpressRouteProviderPortMethodSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.BaseClient", "ExpressRouteProviderPortMethod", resp, "Failure sending request") + return + } + + result, err = client.ExpressRouteProviderPortMethodResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.BaseClient", "ExpressRouteProviderPortMethod", resp, "Failure responding to request") + return + } + + return +} + +// ExpressRouteProviderPortMethodPreparer prepares the ExpressRouteProviderPortMethod request. +func (client BaseClient) ExpressRouteProviderPortMethodPreparer(ctx context.Context, providerport string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "providerport": autorest.Encode("path", providerport), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteProviderPorts/{providerport}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ExpressRouteProviderPortMethodSender sends the ExpressRouteProviderPortMethod request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ExpressRouteProviderPortMethodSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ExpressRouteProviderPortMethodResponder handles the response to the ExpressRouteProviderPortMethod request. The method always +// closes the http.Response Body. +func (client BaseClient) ExpressRouteProviderPortMethodResponder(resp *http.Response) (result ExpressRouteProviderPort, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // Generatevirtualwanvpnserverconfigurationvpnprofile generates a unique VPN profile for P2S clients for VirtualWan and // associated VpnServerConfiguration combination in the specified resource group. // Parameters: @@ -365,7 +440,7 @@ func (client BaseClient) GeneratevirtualwanvpnserverconfigurationvpnprofilePrepa "virtualWANName": autorest.Encode("path", virtualWANName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -446,7 +521,7 @@ func (client BaseClient) GetActiveSessionsPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -579,7 +654,7 @@ func (client BaseClient) GetBastionShareableLinkPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -649,6 +724,379 @@ func (client BaseClient) GetBastionShareableLinkComplete(ctx context.Context, re return } +// ListActiveConnectivityConfigurations lists active connectivity configurations in a network manager. +// Parameters: +// parameters - active Configuration Parameter. +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +// top - an optional query parameter which specifies the maximum number of records to be returned by the +// server. +func (client BaseClient) ListActiveConnectivityConfigurations(ctx context.Context, parameters ActiveConfigurationParameter, resourceGroupName string, networkManagerName string, top *int32) (result ActiveConnectivityConfigurationsListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListActiveConnectivityConfigurations") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, + {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("network.BaseClient", "ListActiveConnectivityConfigurations", err.Error()) + } + + req, err := client.ListActiveConnectivityConfigurationsPreparer(ctx, parameters, resourceGroupName, networkManagerName, top) + if err != nil { + err = autorest.NewErrorWithError(err, "network.BaseClient", "ListActiveConnectivityConfigurations", nil, "Failure preparing request") + return + } + + resp, err := client.ListActiveConnectivityConfigurationsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.BaseClient", "ListActiveConnectivityConfigurations", resp, "Failure sending request") + return + } + + result, err = client.ListActiveConnectivityConfigurationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.BaseClient", "ListActiveConnectivityConfigurations", resp, "Failure responding to request") + return + } + + return +} + +// ListActiveConnectivityConfigurationsPreparer prepares the ListActiveConnectivityConfigurations request. +func (client BaseClient) ListActiveConnectivityConfigurationsPreparer(ctx context.Context, parameters ActiveConfigurationParameter, resourceGroupName string, networkManagerName string, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/listActiveConnectivityConfigurations", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListActiveConnectivityConfigurationsSender sends the ListActiveConnectivityConfigurations request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ListActiveConnectivityConfigurationsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListActiveConnectivityConfigurationsResponder handles the response to the ListActiveConnectivityConfigurations request. The method always +// closes the http.Response Body. +func (client BaseClient) ListActiveConnectivityConfigurationsResponder(resp *http.Response) (result ActiveConnectivityConfigurationsListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListActiveSecurityAdminRules lists active security admin rules in a network manager. +// Parameters: +// parameters - active Configuration Parameter. +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +// top - an optional query parameter which specifies the maximum number of records to be returned by the +// server. +func (client BaseClient) ListActiveSecurityAdminRules(ctx context.Context, parameters ActiveConfigurationParameter, resourceGroupName string, networkManagerName string, top *int32) (result ActiveSecurityAdminRulesListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListActiveSecurityAdminRules") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, + {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("network.BaseClient", "ListActiveSecurityAdminRules", err.Error()) + } + + req, err := client.ListActiveSecurityAdminRulesPreparer(ctx, parameters, resourceGroupName, networkManagerName, top) + if err != nil { + err = autorest.NewErrorWithError(err, "network.BaseClient", "ListActiveSecurityAdminRules", nil, "Failure preparing request") + return + } + + resp, err := client.ListActiveSecurityAdminRulesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.BaseClient", "ListActiveSecurityAdminRules", resp, "Failure sending request") + return + } + + result, err = client.ListActiveSecurityAdminRulesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.BaseClient", "ListActiveSecurityAdminRules", resp, "Failure responding to request") + return + } + + return +} + +// ListActiveSecurityAdminRulesPreparer prepares the ListActiveSecurityAdminRules request. +func (client BaseClient) ListActiveSecurityAdminRulesPreparer(ctx context.Context, parameters ActiveConfigurationParameter, resourceGroupName string, networkManagerName string, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/listActiveSecurityAdminRules", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListActiveSecurityAdminRulesSender sends the ListActiveSecurityAdminRules request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ListActiveSecurityAdminRulesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListActiveSecurityAdminRulesResponder handles the response to the ListActiveSecurityAdminRules request. The method always +// closes the http.Response Body. +func (client BaseClient) ListActiveSecurityAdminRulesResponder(resp *http.Response) (result ActiveSecurityAdminRulesListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListNetworkManagerEffectiveConnectivityConfigurations list all effective connectivity configurations applied on a +// virtual network. +// Parameters: +// parameters - parameters supplied to list correct page. +// resourceGroupName - the name of the resource group. +// virtualNetworkName - the name of the virtual network. +// top - an optional query parameter which specifies the maximum number of records to be returned by the +// server. +func (client BaseClient) ListNetworkManagerEffectiveConnectivityConfigurations(ctx context.Context, parameters QueryRequestOptions, resourceGroupName string, virtualNetworkName string, top *int32) (result ManagerEffectiveConnectivityConfigurationListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListNetworkManagerEffectiveConnectivityConfigurations") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, + {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("network.BaseClient", "ListNetworkManagerEffectiveConnectivityConfigurations", err.Error()) + } + + req, err := client.ListNetworkManagerEffectiveConnectivityConfigurationsPreparer(ctx, parameters, resourceGroupName, virtualNetworkName, top) + if err != nil { + err = autorest.NewErrorWithError(err, "network.BaseClient", "ListNetworkManagerEffectiveConnectivityConfigurations", nil, "Failure preparing request") + return + } + + resp, err := client.ListNetworkManagerEffectiveConnectivityConfigurationsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.BaseClient", "ListNetworkManagerEffectiveConnectivityConfigurations", resp, "Failure sending request") + return + } + + result, err = client.ListNetworkManagerEffectiveConnectivityConfigurationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.BaseClient", "ListNetworkManagerEffectiveConnectivityConfigurations", resp, "Failure responding to request") + return + } + + return +} + +// ListNetworkManagerEffectiveConnectivityConfigurationsPreparer prepares the ListNetworkManagerEffectiveConnectivityConfigurations request. +func (client BaseClient) ListNetworkManagerEffectiveConnectivityConfigurationsPreparer(ctx context.Context, parameters QueryRequestOptions, resourceGroupName string, virtualNetworkName string, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualNetworkName": autorest.Encode("path", virtualNetworkName), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/listNetworkManagerEffectiveConnectivityConfigurations", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListNetworkManagerEffectiveConnectivityConfigurationsSender sends the ListNetworkManagerEffectiveConnectivityConfigurations request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ListNetworkManagerEffectiveConnectivityConfigurationsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListNetworkManagerEffectiveConnectivityConfigurationsResponder handles the response to the ListNetworkManagerEffectiveConnectivityConfigurations request. The method always +// closes the http.Response Body. +func (client BaseClient) ListNetworkManagerEffectiveConnectivityConfigurationsResponder(resp *http.Response) (result ManagerEffectiveConnectivityConfigurationListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListNetworkManagerEffectiveSecurityAdminRules list all effective security admin rules applied on a virtual network. +// Parameters: +// parameters - parameters supplied to list correct page. +// resourceGroupName - the name of the resource group. +// virtualNetworkName - the name of the virtual network. +// top - an optional query parameter which specifies the maximum number of records to be returned by the +// server. +func (client BaseClient) ListNetworkManagerEffectiveSecurityAdminRules(ctx context.Context, parameters QueryRequestOptions, resourceGroupName string, virtualNetworkName string, top *int32) (result ManagerEffectiveSecurityAdminRulesListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListNetworkManagerEffectiveSecurityAdminRules") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, + {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("network.BaseClient", "ListNetworkManagerEffectiveSecurityAdminRules", err.Error()) + } + + req, err := client.ListNetworkManagerEffectiveSecurityAdminRulesPreparer(ctx, parameters, resourceGroupName, virtualNetworkName, top) + if err != nil { + err = autorest.NewErrorWithError(err, "network.BaseClient", "ListNetworkManagerEffectiveSecurityAdminRules", nil, "Failure preparing request") + return + } + + resp, err := client.ListNetworkManagerEffectiveSecurityAdminRulesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.BaseClient", "ListNetworkManagerEffectiveSecurityAdminRules", resp, "Failure sending request") + return + } + + result, err = client.ListNetworkManagerEffectiveSecurityAdminRulesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.BaseClient", "ListNetworkManagerEffectiveSecurityAdminRules", resp, "Failure responding to request") + return + } + + return +} + +// ListNetworkManagerEffectiveSecurityAdminRulesPreparer prepares the ListNetworkManagerEffectiveSecurityAdminRules request. +func (client BaseClient) ListNetworkManagerEffectiveSecurityAdminRulesPreparer(ctx context.Context, parameters QueryRequestOptions, resourceGroupName string, virtualNetworkName string, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualNetworkName": autorest.Encode("path", virtualNetworkName), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/listNetworkManagerEffectiveSecurityAdminRules", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListNetworkManagerEffectiveSecurityAdminRulesSender sends the ListNetworkManagerEffectiveSecurityAdminRules request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ListNetworkManagerEffectiveSecurityAdminRulesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListNetworkManagerEffectiveSecurityAdminRulesResponder handles the response to the ListNetworkManagerEffectiveSecurityAdminRules request. The method always +// closes the http.Response Body. +func (client BaseClient) ListNetworkManagerEffectiveSecurityAdminRulesResponder(resp *http.Response) (result ManagerEffectiveSecurityAdminRulesListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // PutBastionShareableLink creates a Bastion Shareable Links for all the VMs specified in the request. // Parameters: // resourceGroupName - the name of the resource group. @@ -688,7 +1136,7 @@ func (client BaseClient) PutBastionShareableLinkPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -817,7 +1265,7 @@ func (client BaseClient) SupportedSecurityProvidersPreparer(ctx context.Context, "virtualWANName": autorest.Encode("path", virtualWANName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/configurationpolicygroups.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/configurationpolicygroups.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/configurationpolicygroups.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/configurationpolicygroups.go index ee4daf6dba50..79c24fee950a 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/configurationpolicygroups.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/configurationpolicygroups.go @@ -73,7 +73,7 @@ func (client ConfigurationPolicyGroupsClient) CreateOrUpdatePreparer(ctx context "vpnServerConfigurationName": autorest.Encode("path", vpnServerConfigurationName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -158,7 +158,7 @@ func (client ConfigurationPolicyGroupsClient) DeletePreparer(ctx context.Context "vpnServerConfigurationName": autorest.Encode("path", vpnServerConfigurationName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -245,7 +245,7 @@ func (client ConfigurationPolicyGroupsClient) GetPreparer(ctx context.Context, r "vpnServerConfigurationName": autorest.Encode("path", vpnServerConfigurationName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -327,7 +327,7 @@ func (client ConfigurationPolicyGroupsClient) ListByVpnServerConfigurationPrepar "vpnServerConfigurationName": autorest.Encode("path", vpnServerConfigurationName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/connectionmonitors.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/connectionmonitors.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/connectionmonitors.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/connectionmonitors.go index 9c7ea471a494..bdd5308976e5 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/connectionmonitors.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/connectionmonitors.go @@ -98,7 +98,7 @@ func (client ConnectionMonitorsClient) CreateOrUpdatePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -184,7 +184,7 @@ func (client ConnectionMonitorsClient) DeletePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -271,7 +271,7 @@ func (client ConnectionMonitorsClient) GetPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -347,7 +347,7 @@ func (client ConnectionMonitorsClient) ListPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -418,7 +418,7 @@ func (client ConnectionMonitorsClient) QueryPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -499,7 +499,7 @@ func (client ConnectionMonitorsClient) StartPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -579,7 +579,7 @@ func (client ConnectionMonitorsClient) StopPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -667,7 +667,7 @@ func (client ConnectionMonitorsClient) UpdateTagsPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/connectivityconfigurations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/connectivityconfigurations.go new file mode 100644 index 000000000000..c5243c646bf9 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/connectivityconfigurations.go @@ -0,0 +1,426 @@ +package network + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ConnectivityConfigurationsClient is the network Client +type ConnectivityConfigurationsClient struct { + BaseClient +} + +// NewConnectivityConfigurationsClient creates an instance of the ConnectivityConfigurationsClient client. +func NewConnectivityConfigurationsClient(subscriptionID string) ConnectivityConfigurationsClient { + return NewConnectivityConfigurationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewConnectivityConfigurationsClientWithBaseURI creates an instance of the ConnectivityConfigurationsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewConnectivityConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) ConnectivityConfigurationsClient { + return ConnectivityConfigurationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates/Updates a new network manager connectivity configuration +// Parameters: +// connectivityConfiguration - parameters supplied to create/update a network manager connectivity +// configuration +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +// configurationName - the name of the network manager connectivity configuration. +func (client ConnectivityConfigurationsClient) CreateOrUpdate(ctx context.Context, connectivityConfiguration ConnectivityConfiguration, resourceGroupName string, networkManagerName string, configurationName string) (result ConnectivityConfiguration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectivityConfigurationsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: connectivityConfiguration, + Constraints: []validation.Constraint{{Target: "connectivityConfiguration.ConnectivityConfigurationProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "connectivityConfiguration.ConnectivityConfigurationProperties.AppliesToGroups", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("network.ConnectivityConfigurationsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, connectivityConfiguration, resourceGroupName, networkManagerName, configurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ConnectivityConfigurationsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.ConnectivityConfigurationsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ConnectivityConfigurationsClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ConnectivityConfigurationsClient) CreateOrUpdatePreparer(ctx context.Context, connectivityConfiguration ConnectivityConfiguration, resourceGroupName string, networkManagerName string, configurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "configurationName": autorest.Encode("path", configurationName), + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + connectivityConfiguration.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations/{configurationName}", pathParameters), + autorest.WithJSON(connectivityConfiguration), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectivityConfigurationsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ConnectivityConfigurationsClient) CreateOrUpdateResponder(resp *http.Response) (result ConnectivityConfiguration, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a network manager connectivity configuration, specified by the resource group, network manager name, +// and connectivity configuration name +// Parameters: +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +// configurationName - the name of the network manager connectivity configuration. +// force - deletes the resource even if it is part of a deployed configuration. If the configuration has been +// deployed, the service will do a cleanup deployment in the background, prior to the delete. +func (client ConnectivityConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, force *bool) (result ConnectivityConfigurationsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectivityConfigurationsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, networkManagerName, configurationName, force) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ConnectivityConfigurationsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ConnectivityConfigurationsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ConnectivityConfigurationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, force *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "configurationName": autorest.Encode("path", configurationName), + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if force != nil { + queryParameters["force"] = autorest.Encode("query", *force) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations/{configurationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectivityConfigurationsClient) DeleteSender(req *http.Request) (future ConnectivityConfigurationsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ConnectivityConfigurationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a Network Connectivity Configuration, specified by the resource group, network manager name, and +// connectivity Configuration name +// Parameters: +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +// configurationName - the name of the network manager connectivity configuration. +func (client ConnectivityConfigurationsClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string) (result ConnectivityConfiguration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectivityConfigurationsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, networkManagerName, configurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ConnectivityConfigurationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.ConnectivityConfigurationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ConnectivityConfigurationsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ConnectivityConfigurationsClient) GetPreparer(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "configurationName": autorest.Encode("path", configurationName), + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations/{configurationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectivityConfigurationsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ConnectivityConfigurationsClient) GetResponder(resp *http.Response) (result ConnectivityConfiguration, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all the network manager connectivity configuration in a specified network manager. +// Parameters: +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +// top - an optional query parameter which specifies the maximum number of records to be returned by the +// server. +// skipToken - skipToken is only used if a previous operation returned a partial result. If a previous response +// contains a nextLink element, the value of the nextLink element will include a skipToken parameter that +// specifies a starting point to use for subsequent calls. +func (client ConnectivityConfigurationsClient) List(ctx context.Context, resourceGroupName string, networkManagerName string, top *int32, skipToken string) (result ConnectivityConfigurationListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectivityConfigurationsClient.List") + defer func() { + sc := -1 + if result.cclr.Response.Response != nil { + sc = result.cclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, + {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("network.ConnectivityConfigurationsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, networkManagerName, top, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ConnectivityConfigurationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.cclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.ConnectivityConfigurationsClient", "List", resp, "Failure sending request") + return + } + + result.cclr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ConnectivityConfigurationsClient", "List", resp, "Failure responding to request") + return + } + if result.cclr.hasNextLink() && result.cclr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ConnectivityConfigurationsClient) ListPreparer(ctx context.Context, resourceGroupName string, networkManagerName string, top *int32, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/connectivityConfigurations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ConnectivityConfigurationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ConnectivityConfigurationsClient) ListResponder(resp *http.Response) (result ConnectivityConfigurationListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ConnectivityConfigurationsClient) listNextResults(ctx context.Context, lastResults ConnectivityConfigurationListResult) (result ConnectivityConfigurationListResult, err error) { + req, err := lastResults.connectivityConfigurationListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "network.ConnectivityConfigurationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.ConnectivityConfigurationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ConnectivityConfigurationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ConnectivityConfigurationsClient) ListComplete(ctx context.Context, resourceGroupName string, networkManagerName string, top *int32, skipToken string) (result ConnectivityConfigurationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectivityConfigurationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, networkManagerName, top, skipToken) + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/customipprefixes.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/customipprefixes.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/customipprefixes.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/customipprefixes.go index 4cccfbc1611b..9667eff63548 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/customipprefixes.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/customipprefixes.go @@ -70,7 +70,7 @@ func (client CustomIPPrefixesClient) CreateOrUpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -152,7 +152,7 @@ func (client CustomIPPrefixesClient) DeletePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -238,7 +238,7 @@ func (client CustomIPPrefixesClient) GetPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -320,7 +320,7 @@ func (client CustomIPPrefixesClient) ListPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -433,7 +433,7 @@ func (client CustomIPPrefixesClient) ListAllPreparer(ctx context.Context) (*http "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -547,7 +547,7 @@ func (client CustomIPPrefixesClient) UpdateTagsPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/ddoscustompolicies.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/ddoscustompolicies.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/ddoscustompolicies.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/ddoscustompolicies.go index 57341307e42d..e253f8e979e9 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/ddoscustompolicies.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/ddoscustompolicies.go @@ -70,7 +70,7 @@ func (client DdosCustomPoliciesClient) CreateOrUpdatePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -152,7 +152,7 @@ func (client DdosCustomPoliciesClient) DeletePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -237,7 +237,7 @@ func (client DdosCustomPoliciesClient) GetPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -314,7 +314,7 @@ func (client DdosCustomPoliciesClient) UpdateTagsPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/ddosprotectionplans.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/ddosprotectionplans.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/ddosprotectionplans.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/ddosprotectionplans.go index 84dd6888cf26..a73299aebf3b 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/ddosprotectionplans.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/ddosprotectionplans.go @@ -70,7 +70,7 @@ func (client DdosProtectionPlansClient) CreateOrUpdatePreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -155,7 +155,7 @@ func (client DdosProtectionPlansClient) DeletePreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -240,7 +240,7 @@ func (client DdosProtectionPlansClient) GetPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -316,7 +316,7 @@ func (client DdosProtectionPlansClient) ListPreparer(ctx context.Context) (*http "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -432,7 +432,7 @@ func (client DdosProtectionPlansClient) ListByResourceGroupPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -546,7 +546,7 @@ func (client DdosProtectionPlansClient) UpdateTagsPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/defaultsecurityrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/defaultsecurityrules.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/defaultsecurityrules.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/defaultsecurityrules.go index 43a559531ba5..fa15bacf8df1 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/defaultsecurityrules.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/defaultsecurityrules.go @@ -78,7 +78,7 @@ func (client DefaultSecurityRulesClient) GetPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -159,7 +159,7 @@ func (client DefaultSecurityRulesClient) ListPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/dscpconfiguration.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/dscpconfiguration.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/dscpconfiguration.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/dscpconfiguration.go index 1721a2d088f0..e0c2f52fe98d 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/dscpconfiguration.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/dscpconfiguration.go @@ -70,7 +70,7 @@ func (client DscpConfigurationClient) CreateOrUpdatePreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -152,7 +152,7 @@ func (client DscpConfigurationClient) DeletePreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -237,7 +237,7 @@ func (client DscpConfigurationClient) GetPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -316,7 +316,7 @@ func (client DscpConfigurationClient) ListPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -429,7 +429,7 @@ func (client DscpConfigurationClient) ListAllPreparer(ctx context.Context) (*htt "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/enums.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/enums.go similarity index 69% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/enums.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/enums.go index 5c9c1b81969e..f4ea93ba33ac 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/enums.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/enums.go @@ -10,15 +10,49 @@ package network type Access string const ( - // AccessAllow ... - AccessAllow Access = "Allow" - // AccessDeny ... - AccessDeny Access = "Deny" + // Allow ... + Allow Access = "Allow" + // Deny ... + Deny Access = "Deny" ) // PossibleAccessValues returns an array of possible values for the Access const type. func PossibleAccessValues() []Access { - return []Access{AccessAllow, AccessDeny} + return []Access{Allow, Deny} +} + +// ActionType enumerates the values for action type. +type ActionType string + +const ( + // ActionTypeAllow ... + ActionTypeAllow ActionType = "Allow" + // ActionTypeAnomalyScoring ... + ActionTypeAnomalyScoring ActionType = "AnomalyScoring" + // ActionTypeBlock ... + ActionTypeBlock ActionType = "Block" + // ActionTypeLog ... + ActionTypeLog ActionType = "Log" +) + +// PossibleActionTypeValues returns an array of possible values for the ActionType const type. +func PossibleActionTypeValues() []ActionType { + return []ActionType{ActionTypeAllow, ActionTypeAnomalyScoring, ActionTypeBlock, ActionTypeLog} +} + +// AddressPrefixType enumerates the values for address prefix type. +type AddressPrefixType string + +const ( + // IPPrefix ... + IPPrefix AddressPrefixType = "IPPrefix" + // ServiceTag ... + ServiceTag AddressPrefixType = "ServiceTag" +) + +// PossibleAddressPrefixTypeValues returns an array of possible values for the AddressPrefixType const type. +func PossibleAddressPrefixTypeValues() []AddressPrefixType { + return []AddressPrefixType{IPPrefix, ServiceTag} } // ApplicationGatewayBackendHealthServerHealth enumerates the values for application gateway backend health @@ -26,36 +60,52 @@ func PossibleAccessValues() []Access { type ApplicationGatewayBackendHealthServerHealth string const ( - // ApplicationGatewayBackendHealthServerHealthDown ... - ApplicationGatewayBackendHealthServerHealthDown ApplicationGatewayBackendHealthServerHealth = "Down" - // ApplicationGatewayBackendHealthServerHealthDraining ... - ApplicationGatewayBackendHealthServerHealthDraining ApplicationGatewayBackendHealthServerHealth = "Draining" - // ApplicationGatewayBackendHealthServerHealthPartial ... - ApplicationGatewayBackendHealthServerHealthPartial ApplicationGatewayBackendHealthServerHealth = "Partial" - // ApplicationGatewayBackendHealthServerHealthUnknown ... - ApplicationGatewayBackendHealthServerHealthUnknown ApplicationGatewayBackendHealthServerHealth = "Unknown" - // ApplicationGatewayBackendHealthServerHealthUp ... - ApplicationGatewayBackendHealthServerHealthUp ApplicationGatewayBackendHealthServerHealth = "Up" + // Down ... + Down ApplicationGatewayBackendHealthServerHealth = "Down" + // Draining ... + Draining ApplicationGatewayBackendHealthServerHealth = "Draining" + // Partial ... + Partial ApplicationGatewayBackendHealthServerHealth = "Partial" + // Unknown ... + Unknown ApplicationGatewayBackendHealthServerHealth = "Unknown" + // Up ... + Up ApplicationGatewayBackendHealthServerHealth = "Up" ) // PossibleApplicationGatewayBackendHealthServerHealthValues returns an array of possible values for the ApplicationGatewayBackendHealthServerHealth const type. func PossibleApplicationGatewayBackendHealthServerHealthValues() []ApplicationGatewayBackendHealthServerHealth { - return []ApplicationGatewayBackendHealthServerHealth{ApplicationGatewayBackendHealthServerHealthDown, ApplicationGatewayBackendHealthServerHealthDraining, ApplicationGatewayBackendHealthServerHealthPartial, ApplicationGatewayBackendHealthServerHealthUnknown, ApplicationGatewayBackendHealthServerHealthUp} + return []ApplicationGatewayBackendHealthServerHealth{Down, Draining, Partial, Unknown, Up} +} + +// ApplicationGatewayClientRevocationOptions enumerates the values for application gateway client revocation +// options. +type ApplicationGatewayClientRevocationOptions string + +const ( + // None ... + None ApplicationGatewayClientRevocationOptions = "None" + // OCSP ... + OCSP ApplicationGatewayClientRevocationOptions = "OCSP" +) + +// PossibleApplicationGatewayClientRevocationOptionsValues returns an array of possible values for the ApplicationGatewayClientRevocationOptions const type. +func PossibleApplicationGatewayClientRevocationOptionsValues() []ApplicationGatewayClientRevocationOptions { + return []ApplicationGatewayClientRevocationOptions{None, OCSP} } // ApplicationGatewayCookieBasedAffinity enumerates the values for application gateway cookie based affinity. type ApplicationGatewayCookieBasedAffinity string const ( - // ApplicationGatewayCookieBasedAffinityDisabled ... - ApplicationGatewayCookieBasedAffinityDisabled ApplicationGatewayCookieBasedAffinity = "Disabled" - // ApplicationGatewayCookieBasedAffinityEnabled ... - ApplicationGatewayCookieBasedAffinityEnabled ApplicationGatewayCookieBasedAffinity = "Enabled" + // Disabled ... + Disabled ApplicationGatewayCookieBasedAffinity = "Disabled" + // Enabled ... + Enabled ApplicationGatewayCookieBasedAffinity = "Enabled" ) // PossibleApplicationGatewayCookieBasedAffinityValues returns an array of possible values for the ApplicationGatewayCookieBasedAffinity const type. func PossibleApplicationGatewayCookieBasedAffinityValues() []ApplicationGatewayCookieBasedAffinity { - return []ApplicationGatewayCookieBasedAffinity{ApplicationGatewayCookieBasedAffinityDisabled, ApplicationGatewayCookieBasedAffinityEnabled} + return []ApplicationGatewayCookieBasedAffinity{Disabled, Enabled} } // ApplicationGatewayCustomErrorStatusCode enumerates the values for application gateway custom error status @@ -63,30 +113,30 @@ func PossibleApplicationGatewayCookieBasedAffinityValues() []ApplicationGatewayC type ApplicationGatewayCustomErrorStatusCode string const ( - // ApplicationGatewayCustomErrorStatusCodeHTTPStatus403 ... - ApplicationGatewayCustomErrorStatusCodeHTTPStatus403 ApplicationGatewayCustomErrorStatusCode = "HttpStatus403" - // ApplicationGatewayCustomErrorStatusCodeHTTPStatus502 ... - ApplicationGatewayCustomErrorStatusCodeHTTPStatus502 ApplicationGatewayCustomErrorStatusCode = "HttpStatus502" + // HTTPStatus403 ... + HTTPStatus403 ApplicationGatewayCustomErrorStatusCode = "HttpStatus403" + // HTTPStatus502 ... + HTTPStatus502 ApplicationGatewayCustomErrorStatusCode = "HttpStatus502" ) // PossibleApplicationGatewayCustomErrorStatusCodeValues returns an array of possible values for the ApplicationGatewayCustomErrorStatusCode const type. func PossibleApplicationGatewayCustomErrorStatusCodeValues() []ApplicationGatewayCustomErrorStatusCode { - return []ApplicationGatewayCustomErrorStatusCode{ApplicationGatewayCustomErrorStatusCodeHTTPStatus403, ApplicationGatewayCustomErrorStatusCodeHTTPStatus502} + return []ApplicationGatewayCustomErrorStatusCode{HTTPStatus403, HTTPStatus502} } // ApplicationGatewayFirewallMode enumerates the values for application gateway firewall mode. type ApplicationGatewayFirewallMode string const ( - // ApplicationGatewayFirewallModeDetection ... - ApplicationGatewayFirewallModeDetection ApplicationGatewayFirewallMode = "Detection" - // ApplicationGatewayFirewallModePrevention ... - ApplicationGatewayFirewallModePrevention ApplicationGatewayFirewallMode = "Prevention" + // Detection ... + Detection ApplicationGatewayFirewallMode = "Detection" + // Prevention ... + Prevention ApplicationGatewayFirewallMode = "Prevention" ) // PossibleApplicationGatewayFirewallModeValues returns an array of possible values for the ApplicationGatewayFirewallMode const type. func PossibleApplicationGatewayFirewallModeValues() []ApplicationGatewayFirewallMode { - return []ApplicationGatewayFirewallMode{ApplicationGatewayFirewallModeDetection, ApplicationGatewayFirewallModePrevention} + return []ApplicationGatewayFirewallMode{Detection, Prevention} } // ApplicationGatewayLoadDistributionAlgorithm enumerates the values for application gateway load distribution @@ -94,74 +144,74 @@ func PossibleApplicationGatewayFirewallModeValues() []ApplicationGatewayFirewall type ApplicationGatewayLoadDistributionAlgorithm string const ( - // ApplicationGatewayLoadDistributionAlgorithmIPHash ... - ApplicationGatewayLoadDistributionAlgorithmIPHash ApplicationGatewayLoadDistributionAlgorithm = "IpHash" - // ApplicationGatewayLoadDistributionAlgorithmLeastConnections ... - ApplicationGatewayLoadDistributionAlgorithmLeastConnections ApplicationGatewayLoadDistributionAlgorithm = "LeastConnections" - // ApplicationGatewayLoadDistributionAlgorithmRoundRobin ... - ApplicationGatewayLoadDistributionAlgorithmRoundRobin ApplicationGatewayLoadDistributionAlgorithm = "RoundRobin" + // IPHash ... + IPHash ApplicationGatewayLoadDistributionAlgorithm = "IpHash" + // LeastConnections ... + LeastConnections ApplicationGatewayLoadDistributionAlgorithm = "LeastConnections" + // RoundRobin ... + RoundRobin ApplicationGatewayLoadDistributionAlgorithm = "RoundRobin" ) // PossibleApplicationGatewayLoadDistributionAlgorithmValues returns an array of possible values for the ApplicationGatewayLoadDistributionAlgorithm const type. func PossibleApplicationGatewayLoadDistributionAlgorithmValues() []ApplicationGatewayLoadDistributionAlgorithm { - return []ApplicationGatewayLoadDistributionAlgorithm{ApplicationGatewayLoadDistributionAlgorithmIPHash, ApplicationGatewayLoadDistributionAlgorithmLeastConnections, ApplicationGatewayLoadDistributionAlgorithmRoundRobin} + return []ApplicationGatewayLoadDistributionAlgorithm{IPHash, LeastConnections, RoundRobin} } // ApplicationGatewayOperationalState enumerates the values for application gateway operational state. type ApplicationGatewayOperationalState string const ( - // ApplicationGatewayOperationalStateRunning ... - ApplicationGatewayOperationalStateRunning ApplicationGatewayOperationalState = "Running" - // ApplicationGatewayOperationalStateStarting ... - ApplicationGatewayOperationalStateStarting ApplicationGatewayOperationalState = "Starting" - // ApplicationGatewayOperationalStateStopped ... - ApplicationGatewayOperationalStateStopped ApplicationGatewayOperationalState = "Stopped" - // ApplicationGatewayOperationalStateStopping ... - ApplicationGatewayOperationalStateStopping ApplicationGatewayOperationalState = "Stopping" + // Running ... + Running ApplicationGatewayOperationalState = "Running" + // Starting ... + Starting ApplicationGatewayOperationalState = "Starting" + // Stopped ... + Stopped ApplicationGatewayOperationalState = "Stopped" + // Stopping ... + Stopping ApplicationGatewayOperationalState = "Stopping" ) // PossibleApplicationGatewayOperationalStateValues returns an array of possible values for the ApplicationGatewayOperationalState const type. func PossibleApplicationGatewayOperationalStateValues() []ApplicationGatewayOperationalState { - return []ApplicationGatewayOperationalState{ApplicationGatewayOperationalStateRunning, ApplicationGatewayOperationalStateStarting, ApplicationGatewayOperationalStateStopped, ApplicationGatewayOperationalStateStopping} + return []ApplicationGatewayOperationalState{Running, Starting, Stopped, Stopping} } // ApplicationGatewayProtocol enumerates the values for application gateway protocol. type ApplicationGatewayProtocol string const ( - // ApplicationGatewayProtocolHTTP ... - ApplicationGatewayProtocolHTTP ApplicationGatewayProtocol = "Http" - // ApplicationGatewayProtocolHTTPS ... - ApplicationGatewayProtocolHTTPS ApplicationGatewayProtocol = "Https" - // ApplicationGatewayProtocolTCP ... - ApplicationGatewayProtocolTCP ApplicationGatewayProtocol = "Tcp" - // ApplicationGatewayProtocolTLS ... - ApplicationGatewayProtocolTLS ApplicationGatewayProtocol = "Tls" + // HTTP ... + HTTP ApplicationGatewayProtocol = "Http" + // HTTPS ... + HTTPS ApplicationGatewayProtocol = "Https" + // TCP ... + TCP ApplicationGatewayProtocol = "Tcp" + // TLS ... + TLS ApplicationGatewayProtocol = "Tls" ) // PossibleApplicationGatewayProtocolValues returns an array of possible values for the ApplicationGatewayProtocol const type. func PossibleApplicationGatewayProtocolValues() []ApplicationGatewayProtocol { - return []ApplicationGatewayProtocol{ApplicationGatewayProtocolHTTP, ApplicationGatewayProtocolHTTPS, ApplicationGatewayProtocolTCP, ApplicationGatewayProtocolTLS} + return []ApplicationGatewayProtocol{HTTP, HTTPS, TCP, TLS} } // ApplicationGatewayRedirectType enumerates the values for application gateway redirect type. type ApplicationGatewayRedirectType string const ( - // ApplicationGatewayRedirectTypeFound ... - ApplicationGatewayRedirectTypeFound ApplicationGatewayRedirectType = "Found" - // ApplicationGatewayRedirectTypePermanent ... - ApplicationGatewayRedirectTypePermanent ApplicationGatewayRedirectType = "Permanent" - // ApplicationGatewayRedirectTypeSeeOther ... - ApplicationGatewayRedirectTypeSeeOther ApplicationGatewayRedirectType = "SeeOther" - // ApplicationGatewayRedirectTypeTemporary ... - ApplicationGatewayRedirectTypeTemporary ApplicationGatewayRedirectType = "Temporary" + // Found ... + Found ApplicationGatewayRedirectType = "Found" + // Permanent ... + Permanent ApplicationGatewayRedirectType = "Permanent" + // SeeOther ... + SeeOther ApplicationGatewayRedirectType = "SeeOther" + // Temporary ... + Temporary ApplicationGatewayRedirectType = "Temporary" ) // PossibleApplicationGatewayRedirectTypeValues returns an array of possible values for the ApplicationGatewayRedirectType const type. func PossibleApplicationGatewayRedirectTypeValues() []ApplicationGatewayRedirectType { - return []ApplicationGatewayRedirectType{ApplicationGatewayRedirectTypeFound, ApplicationGatewayRedirectTypePermanent, ApplicationGatewayRedirectTypeSeeOther, ApplicationGatewayRedirectTypeTemporary} + return []ApplicationGatewayRedirectType{Found, Permanent, SeeOther, Temporary} } // ApplicationGatewayRequestRoutingRuleType enumerates the values for application gateway request routing rule @@ -169,156 +219,186 @@ func PossibleApplicationGatewayRedirectTypeValues() []ApplicationGatewayRedirect type ApplicationGatewayRequestRoutingRuleType string const ( - // ApplicationGatewayRequestRoutingRuleTypeBasic ... - ApplicationGatewayRequestRoutingRuleTypeBasic ApplicationGatewayRequestRoutingRuleType = "Basic" - // ApplicationGatewayRequestRoutingRuleTypePathBasedRouting ... - ApplicationGatewayRequestRoutingRuleTypePathBasedRouting ApplicationGatewayRequestRoutingRuleType = "PathBasedRouting" + // Basic ... + Basic ApplicationGatewayRequestRoutingRuleType = "Basic" + // PathBasedRouting ... + PathBasedRouting ApplicationGatewayRequestRoutingRuleType = "PathBasedRouting" ) // PossibleApplicationGatewayRequestRoutingRuleTypeValues returns an array of possible values for the ApplicationGatewayRequestRoutingRuleType const type. func PossibleApplicationGatewayRequestRoutingRuleTypeValues() []ApplicationGatewayRequestRoutingRuleType { - return []ApplicationGatewayRequestRoutingRuleType{ApplicationGatewayRequestRoutingRuleTypeBasic, ApplicationGatewayRequestRoutingRuleTypePathBasedRouting} + return []ApplicationGatewayRequestRoutingRuleType{Basic, PathBasedRouting} +} + +// ApplicationGatewayRuleSetStatusOptions enumerates the values for application gateway rule set status +// options. +type ApplicationGatewayRuleSetStatusOptions string + +const ( + // Deprecated ... + Deprecated ApplicationGatewayRuleSetStatusOptions = "Deprecated" + // GA ... + GA ApplicationGatewayRuleSetStatusOptions = "GA" + // Preview ... + Preview ApplicationGatewayRuleSetStatusOptions = "Preview" + // Supported ... + Supported ApplicationGatewayRuleSetStatusOptions = "Supported" +) + +// PossibleApplicationGatewayRuleSetStatusOptionsValues returns an array of possible values for the ApplicationGatewayRuleSetStatusOptions const type. +func PossibleApplicationGatewayRuleSetStatusOptionsValues() []ApplicationGatewayRuleSetStatusOptions { + return []ApplicationGatewayRuleSetStatusOptions{Deprecated, GA, Preview, Supported} } // ApplicationGatewaySkuName enumerates the values for application gateway sku name. type ApplicationGatewaySkuName string const ( - // ApplicationGatewaySkuNameStandardLarge ... - ApplicationGatewaySkuNameStandardLarge ApplicationGatewaySkuName = "Standard_Large" - // ApplicationGatewaySkuNameStandardMedium ... - ApplicationGatewaySkuNameStandardMedium ApplicationGatewaySkuName = "Standard_Medium" - // ApplicationGatewaySkuNameStandardSmall ... - ApplicationGatewaySkuNameStandardSmall ApplicationGatewaySkuName = "Standard_Small" - // ApplicationGatewaySkuNameStandardV2 ... - ApplicationGatewaySkuNameStandardV2 ApplicationGatewaySkuName = "Standard_v2" - // ApplicationGatewaySkuNameWAFLarge ... - ApplicationGatewaySkuNameWAFLarge ApplicationGatewaySkuName = "WAF_Large" - // ApplicationGatewaySkuNameWAFMedium ... - ApplicationGatewaySkuNameWAFMedium ApplicationGatewaySkuName = "WAF_Medium" - // ApplicationGatewaySkuNameWAFV2 ... - ApplicationGatewaySkuNameWAFV2 ApplicationGatewaySkuName = "WAF_v2" + // StandardBasic ... + StandardBasic ApplicationGatewaySkuName = "Standard_Basic" + // StandardLarge ... + StandardLarge ApplicationGatewaySkuName = "Standard_Large" + // StandardMedium ... + StandardMedium ApplicationGatewaySkuName = "Standard_Medium" + // StandardSmall ... + StandardSmall ApplicationGatewaySkuName = "Standard_Small" + // StandardV2 ... + StandardV2 ApplicationGatewaySkuName = "Standard_v2" + // WAFLarge ... + WAFLarge ApplicationGatewaySkuName = "WAF_Large" + // WAFMedium ... + WAFMedium ApplicationGatewaySkuName = "WAF_Medium" + // WAFV2 ... + WAFV2 ApplicationGatewaySkuName = "WAF_v2" ) // PossibleApplicationGatewaySkuNameValues returns an array of possible values for the ApplicationGatewaySkuName const type. func PossibleApplicationGatewaySkuNameValues() []ApplicationGatewaySkuName { - return []ApplicationGatewaySkuName{ApplicationGatewaySkuNameStandardLarge, ApplicationGatewaySkuNameStandardMedium, ApplicationGatewaySkuNameStandardSmall, ApplicationGatewaySkuNameStandardV2, ApplicationGatewaySkuNameWAFLarge, ApplicationGatewaySkuNameWAFMedium, ApplicationGatewaySkuNameWAFV2} + return []ApplicationGatewaySkuName{StandardBasic, StandardLarge, StandardMedium, StandardSmall, StandardV2, WAFLarge, WAFMedium, WAFV2} } // ApplicationGatewaySslCipherSuite enumerates the values for application gateway ssl cipher suite. type ApplicationGatewaySslCipherSuite string const ( - // ApplicationGatewaySslCipherSuiteTLSDHEDSSWITH3DESEDECBCSHA ... - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITH3DESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA" - // ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAES128CBCSHA ... - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA" - // ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAES128CBCSHA256 ... - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256" - // ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAES256CBCSHA ... - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA" - // ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAES256CBCSHA256 ... - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAES256CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256" - // ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAES128CBCSHA ... - ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_CBC_SHA" - // ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAES128GCMSHA256 ... - ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256" - // ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAES256CBCSHA ... - ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA" - // ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAES256GCMSHA384 ... - ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384" - // ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA ... - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" - // ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA256 ... - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" - // ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES128GCMSHA256 ... - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" - // ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA ... - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" - // ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA384 ... - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" - // ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES256GCMSHA384 ... - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" - // ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES128CBCSHA ... - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" - // ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES128CBCSHA256 ... - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" - // ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES128GCMSHA256 ... - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" - // ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES256CBCSHA ... - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" - // ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES256CBCSHA384 ... - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES256CBCSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" - // ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES256GCMSHA384 ... - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" - // ApplicationGatewaySslCipherSuiteTLSRSAWITH3DESEDECBCSHA ... - ApplicationGatewaySslCipherSuiteTLSRSAWITH3DESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" - // ApplicationGatewaySslCipherSuiteTLSRSAWITHAES128CBCSHA ... - ApplicationGatewaySslCipherSuiteTLSRSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA" - // ApplicationGatewaySslCipherSuiteTLSRSAWITHAES128CBCSHA256 ... - ApplicationGatewaySslCipherSuiteTLSRSAWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA256" - // ApplicationGatewaySslCipherSuiteTLSRSAWITHAES128GCMSHA256 ... - ApplicationGatewaySslCipherSuiteTLSRSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_GCM_SHA256" - // ApplicationGatewaySslCipherSuiteTLSRSAWITHAES256CBCSHA ... - ApplicationGatewaySslCipherSuiteTLSRSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA" - // ApplicationGatewaySslCipherSuiteTLSRSAWITHAES256CBCSHA256 ... - ApplicationGatewaySslCipherSuiteTLSRSAWITHAES256CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA256" - // ApplicationGatewaySslCipherSuiteTLSRSAWITHAES256GCMSHA384 ... - ApplicationGatewaySslCipherSuiteTLSRSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_GCM_SHA384" + // TLSDHEDSSWITH3DESEDECBCSHA ... + TLSDHEDSSWITH3DESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA" + // TLSDHEDSSWITHAES128CBCSHA ... + TLSDHEDSSWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA" + // TLSDHEDSSWITHAES128CBCSHA256 ... + TLSDHEDSSWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256" + // TLSDHEDSSWITHAES256CBCSHA ... + TLSDHEDSSWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA" + // TLSDHEDSSWITHAES256CBCSHA256 ... + TLSDHEDSSWITHAES256CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256" + // TLSDHERSAWITHAES128CBCSHA ... + TLSDHERSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_CBC_SHA" + // TLSDHERSAWITHAES128GCMSHA256 ... + TLSDHERSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256" + // TLSDHERSAWITHAES256CBCSHA ... + TLSDHERSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA" + // TLSDHERSAWITHAES256GCMSHA384 ... + TLSDHERSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384" + // TLSECDHEECDSAWITHAES128CBCSHA ... + TLSECDHEECDSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" + // TLSECDHEECDSAWITHAES128CBCSHA256 ... + TLSECDHEECDSAWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" + // TLSECDHEECDSAWITHAES128GCMSHA256 ... + TLSECDHEECDSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" + // TLSECDHEECDSAWITHAES256CBCSHA ... + TLSECDHEECDSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" + // TLSECDHEECDSAWITHAES256CBCSHA384 ... + TLSECDHEECDSAWITHAES256CBCSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" + // TLSECDHEECDSAWITHAES256GCMSHA384 ... + TLSECDHEECDSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" + // TLSECDHERSAWITHAES128CBCSHA ... + TLSECDHERSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" + // TLSECDHERSAWITHAES128CBCSHA256 ... + TLSECDHERSAWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" + // TLSECDHERSAWITHAES128GCMSHA256 ... + TLSECDHERSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" + // TLSECDHERSAWITHAES256CBCSHA ... + TLSECDHERSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" + // TLSECDHERSAWITHAES256CBCSHA384 ... + TLSECDHERSAWITHAES256CBCSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" + // TLSECDHERSAWITHAES256GCMSHA384 ... + TLSECDHERSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" + // TLSRSAWITH3DESEDECBCSHA ... + TLSRSAWITH3DESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" + // TLSRSAWITHAES128CBCSHA ... + TLSRSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA" + // TLSRSAWITHAES128CBCSHA256 ... + TLSRSAWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA256" + // TLSRSAWITHAES128GCMSHA256 ... + TLSRSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_GCM_SHA256" + // TLSRSAWITHAES256CBCSHA ... + TLSRSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA" + // TLSRSAWITHAES256CBCSHA256 ... + TLSRSAWITHAES256CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA256" + // TLSRSAWITHAES256GCMSHA384 ... + TLSRSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_GCM_SHA384" ) // PossibleApplicationGatewaySslCipherSuiteValues returns an array of possible values for the ApplicationGatewaySslCipherSuite const type. func PossibleApplicationGatewaySslCipherSuiteValues() []ApplicationGatewaySslCipherSuite { - return []ApplicationGatewaySslCipherSuite{ApplicationGatewaySslCipherSuiteTLSDHEDSSWITH3DESEDECBCSHA, ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAES128CBCSHA, ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAES128CBCSHA256, ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAES256CBCSHA, ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAES256CBCSHA256, ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAES128CBCSHA, ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAES128GCMSHA256, ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAES256CBCSHA, ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAES256GCMSHA384, ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA, ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES128CBCSHA256, ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES128GCMSHA256, ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA, ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES256CBCSHA384, ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAES256GCMSHA384, ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES128CBCSHA, ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES128CBCSHA256, ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES128GCMSHA256, ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES256CBCSHA, ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES256CBCSHA384, ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAES256GCMSHA384, ApplicationGatewaySslCipherSuiteTLSRSAWITH3DESEDECBCSHA, ApplicationGatewaySslCipherSuiteTLSRSAWITHAES128CBCSHA, ApplicationGatewaySslCipherSuiteTLSRSAWITHAES128CBCSHA256, ApplicationGatewaySslCipherSuiteTLSRSAWITHAES128GCMSHA256, ApplicationGatewaySslCipherSuiteTLSRSAWITHAES256CBCSHA, ApplicationGatewaySslCipherSuiteTLSRSAWITHAES256CBCSHA256, ApplicationGatewaySslCipherSuiteTLSRSAWITHAES256GCMSHA384} + return []ApplicationGatewaySslCipherSuite{TLSDHEDSSWITH3DESEDECBCSHA, TLSDHEDSSWITHAES128CBCSHA, TLSDHEDSSWITHAES128CBCSHA256, TLSDHEDSSWITHAES256CBCSHA, TLSDHEDSSWITHAES256CBCSHA256, TLSDHERSAWITHAES128CBCSHA, TLSDHERSAWITHAES128GCMSHA256, TLSDHERSAWITHAES256CBCSHA, TLSDHERSAWITHAES256GCMSHA384, TLSECDHEECDSAWITHAES128CBCSHA, TLSECDHEECDSAWITHAES128CBCSHA256, TLSECDHEECDSAWITHAES128GCMSHA256, TLSECDHEECDSAWITHAES256CBCSHA, TLSECDHEECDSAWITHAES256CBCSHA384, TLSECDHEECDSAWITHAES256GCMSHA384, TLSECDHERSAWITHAES128CBCSHA, TLSECDHERSAWITHAES128CBCSHA256, TLSECDHERSAWITHAES128GCMSHA256, TLSECDHERSAWITHAES256CBCSHA, TLSECDHERSAWITHAES256CBCSHA384, TLSECDHERSAWITHAES256GCMSHA384, TLSRSAWITH3DESEDECBCSHA, TLSRSAWITHAES128CBCSHA, TLSRSAWITHAES128CBCSHA256, TLSRSAWITHAES128GCMSHA256, TLSRSAWITHAES256CBCSHA, TLSRSAWITHAES256CBCSHA256, TLSRSAWITHAES256GCMSHA384} } // ApplicationGatewaySslPolicyName enumerates the values for application gateway ssl policy name. type ApplicationGatewaySslPolicyName string const ( - // ApplicationGatewaySslPolicyNameAppGwSslPolicy20150501 ... - ApplicationGatewaySslPolicyNameAppGwSslPolicy20150501 ApplicationGatewaySslPolicyName = "AppGwSslPolicy20150501" - // ApplicationGatewaySslPolicyNameAppGwSslPolicy20170401 ... - ApplicationGatewaySslPolicyNameAppGwSslPolicy20170401 ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401" - // ApplicationGatewaySslPolicyNameAppGwSslPolicy20170401S ... - ApplicationGatewaySslPolicyNameAppGwSslPolicy20170401S ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401S" + // AppGwSslPolicy20150501 ... + AppGwSslPolicy20150501 ApplicationGatewaySslPolicyName = "AppGwSslPolicy20150501" + // AppGwSslPolicy20170401 ... + AppGwSslPolicy20170401 ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401" + // AppGwSslPolicy20170401S ... + AppGwSslPolicy20170401S ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401S" + // AppGwSslPolicy20220101 ... + AppGwSslPolicy20220101 ApplicationGatewaySslPolicyName = "AppGwSslPolicy20220101" + // AppGwSslPolicy20220101S ... + AppGwSslPolicy20220101S ApplicationGatewaySslPolicyName = "AppGwSslPolicy20220101S" ) // PossibleApplicationGatewaySslPolicyNameValues returns an array of possible values for the ApplicationGatewaySslPolicyName const type. func PossibleApplicationGatewaySslPolicyNameValues() []ApplicationGatewaySslPolicyName { - return []ApplicationGatewaySslPolicyName{ApplicationGatewaySslPolicyNameAppGwSslPolicy20150501, ApplicationGatewaySslPolicyNameAppGwSslPolicy20170401, ApplicationGatewaySslPolicyNameAppGwSslPolicy20170401S} + return []ApplicationGatewaySslPolicyName{AppGwSslPolicy20150501, AppGwSslPolicy20170401, AppGwSslPolicy20170401S, AppGwSslPolicy20220101, AppGwSslPolicy20220101S} } // ApplicationGatewaySslPolicyType enumerates the values for application gateway ssl policy type. type ApplicationGatewaySslPolicyType string const ( - // ApplicationGatewaySslPolicyTypeCustom ... - ApplicationGatewaySslPolicyTypeCustom ApplicationGatewaySslPolicyType = "Custom" - // ApplicationGatewaySslPolicyTypePredefined ... - ApplicationGatewaySslPolicyTypePredefined ApplicationGatewaySslPolicyType = "Predefined" + // Custom ... + Custom ApplicationGatewaySslPolicyType = "Custom" + // CustomV2 ... + CustomV2 ApplicationGatewaySslPolicyType = "CustomV2" + // Predefined ... + Predefined ApplicationGatewaySslPolicyType = "Predefined" ) // PossibleApplicationGatewaySslPolicyTypeValues returns an array of possible values for the ApplicationGatewaySslPolicyType const type. func PossibleApplicationGatewaySslPolicyTypeValues() []ApplicationGatewaySslPolicyType { - return []ApplicationGatewaySslPolicyType{ApplicationGatewaySslPolicyTypeCustom, ApplicationGatewaySslPolicyTypePredefined} + return []ApplicationGatewaySslPolicyType{Custom, CustomV2, Predefined} } // ApplicationGatewaySslProtocol enumerates the values for application gateway ssl protocol. type ApplicationGatewaySslProtocol string const ( - // ApplicationGatewaySslProtocolTLSv10 ... - ApplicationGatewaySslProtocolTLSv10 ApplicationGatewaySslProtocol = "TLSv1_0" - // ApplicationGatewaySslProtocolTLSv11 ... - ApplicationGatewaySslProtocolTLSv11 ApplicationGatewaySslProtocol = "TLSv1_1" - // ApplicationGatewaySslProtocolTLSv12 ... - ApplicationGatewaySslProtocolTLSv12 ApplicationGatewaySslProtocol = "TLSv1_2" + // TLSv10 ... + TLSv10 ApplicationGatewaySslProtocol = "TLSv1_0" + // TLSv11 ... + TLSv11 ApplicationGatewaySslProtocol = "TLSv1_1" + // TLSv12 ... + TLSv12 ApplicationGatewaySslProtocol = "TLSv1_2" + // TLSv13 ... + TLSv13 ApplicationGatewaySslProtocol = "TLSv1_3" ) // PossibleApplicationGatewaySslProtocolValues returns an array of possible values for the ApplicationGatewaySslProtocol const type. func PossibleApplicationGatewaySslProtocolValues() []ApplicationGatewaySslProtocol { - return []ApplicationGatewaySslProtocol{ApplicationGatewaySslProtocolTLSv10, ApplicationGatewaySslProtocolTLSv11, ApplicationGatewaySslProtocolTLSv12} + return []ApplicationGatewaySslProtocol{TLSv10, TLSv11, TLSv12, TLSv13} } // ApplicationGatewayTier enumerates the values for application gateway tier. @@ -327,6 +407,8 @@ type ApplicationGatewayTier string const ( // ApplicationGatewayTierStandard ... ApplicationGatewayTierStandard ApplicationGatewayTier = "Standard" + // ApplicationGatewayTierStandardBasic ... + ApplicationGatewayTierStandardBasic ApplicationGatewayTier = "Standard_Basic" // ApplicationGatewayTierStandardV2 ... ApplicationGatewayTierStandardV2 ApplicationGatewayTier = "Standard_v2" // ApplicationGatewayTierWAF ... @@ -337,52 +419,122 @@ const ( // PossibleApplicationGatewayTierValues returns an array of possible values for the ApplicationGatewayTier const type. func PossibleApplicationGatewayTierValues() []ApplicationGatewayTier { - return []ApplicationGatewayTier{ApplicationGatewayTierStandard, ApplicationGatewayTierStandardV2, ApplicationGatewayTierWAF, ApplicationGatewayTierWAFV2} + return []ApplicationGatewayTier{ApplicationGatewayTierStandard, ApplicationGatewayTierStandardBasic, ApplicationGatewayTierStandardV2, ApplicationGatewayTierWAF, ApplicationGatewayTierWAFV2} +} + +// ApplicationGatewayTierTypes enumerates the values for application gateway tier types. +type ApplicationGatewayTierTypes string + +const ( + // ApplicationGatewayTierTypesStandard ... + ApplicationGatewayTierTypesStandard ApplicationGatewayTierTypes = "Standard" + // ApplicationGatewayTierTypesStandardV2 ... + ApplicationGatewayTierTypesStandardV2 ApplicationGatewayTierTypes = "Standard_v2" + // ApplicationGatewayTierTypesWAF ... + ApplicationGatewayTierTypesWAF ApplicationGatewayTierTypes = "WAF" + // ApplicationGatewayTierTypesWAFV2 ... + ApplicationGatewayTierTypesWAFV2 ApplicationGatewayTierTypes = "WAF_v2" +) + +// PossibleApplicationGatewayTierTypesValues returns an array of possible values for the ApplicationGatewayTierTypes const type. +func PossibleApplicationGatewayTierTypesValues() []ApplicationGatewayTierTypes { + return []ApplicationGatewayTierTypes{ApplicationGatewayTierTypesStandard, ApplicationGatewayTierTypesStandardV2, ApplicationGatewayTierTypesWAF, ApplicationGatewayTierTypesWAFV2} +} + +// ApplicationGatewayWafRuleActionTypes enumerates the values for application gateway waf rule action types. +type ApplicationGatewayWafRuleActionTypes string + +const ( + // ApplicationGatewayWafRuleActionTypesAllow ... + ApplicationGatewayWafRuleActionTypesAllow ApplicationGatewayWafRuleActionTypes = "Allow" + // ApplicationGatewayWafRuleActionTypesAnomalyScoring ... + ApplicationGatewayWafRuleActionTypesAnomalyScoring ApplicationGatewayWafRuleActionTypes = "AnomalyScoring" + // ApplicationGatewayWafRuleActionTypesBlock ... + ApplicationGatewayWafRuleActionTypesBlock ApplicationGatewayWafRuleActionTypes = "Block" + // ApplicationGatewayWafRuleActionTypesLog ... + ApplicationGatewayWafRuleActionTypesLog ApplicationGatewayWafRuleActionTypes = "Log" + // ApplicationGatewayWafRuleActionTypesNone ... + ApplicationGatewayWafRuleActionTypesNone ApplicationGatewayWafRuleActionTypes = "None" +) + +// PossibleApplicationGatewayWafRuleActionTypesValues returns an array of possible values for the ApplicationGatewayWafRuleActionTypes const type. +func PossibleApplicationGatewayWafRuleActionTypesValues() []ApplicationGatewayWafRuleActionTypes { + return []ApplicationGatewayWafRuleActionTypes{ApplicationGatewayWafRuleActionTypesAllow, ApplicationGatewayWafRuleActionTypesAnomalyScoring, ApplicationGatewayWafRuleActionTypesBlock, ApplicationGatewayWafRuleActionTypesLog, ApplicationGatewayWafRuleActionTypesNone} +} + +// ApplicationGatewayWafRuleStateTypes enumerates the values for application gateway waf rule state types. +type ApplicationGatewayWafRuleStateTypes string + +const ( + // ApplicationGatewayWafRuleStateTypesDisabled ... + ApplicationGatewayWafRuleStateTypesDisabled ApplicationGatewayWafRuleStateTypes = "Disabled" + // ApplicationGatewayWafRuleStateTypesEnabled ... + ApplicationGatewayWafRuleStateTypesEnabled ApplicationGatewayWafRuleStateTypes = "Enabled" +) + +// PossibleApplicationGatewayWafRuleStateTypesValues returns an array of possible values for the ApplicationGatewayWafRuleStateTypes const type. +func PossibleApplicationGatewayWafRuleStateTypesValues() []ApplicationGatewayWafRuleStateTypes { + return []ApplicationGatewayWafRuleStateTypes{ApplicationGatewayWafRuleStateTypesDisabled, ApplicationGatewayWafRuleStateTypesEnabled} } // AssociationType enumerates the values for association type. type AssociationType string const ( - // AssociationTypeAssociated ... - AssociationTypeAssociated AssociationType = "Associated" - // AssociationTypeContains ... - AssociationTypeContains AssociationType = "Contains" + // Associated ... + Associated AssociationType = "Associated" + // Contains ... + Contains AssociationType = "Contains" ) // PossibleAssociationTypeValues returns an array of possible values for the AssociationType const type. func PossibleAssociationTypeValues() []AssociationType { - return []AssociationType{AssociationTypeAssociated, AssociationTypeContains} + return []AssociationType{Associated, Contains} } // AuthenticationMethod enumerates the values for authentication method. type AuthenticationMethod string const ( - // AuthenticationMethodEAPMSCHAPv2 ... - AuthenticationMethodEAPMSCHAPv2 AuthenticationMethod = "EAPMSCHAPv2" - // AuthenticationMethodEAPTLS ... - AuthenticationMethodEAPTLS AuthenticationMethod = "EAPTLS" + // EAPMSCHAPv2 ... + EAPMSCHAPv2 AuthenticationMethod = "EAPMSCHAPv2" + // EAPTLS ... + EAPTLS AuthenticationMethod = "EAPTLS" ) // PossibleAuthenticationMethodValues returns an array of possible values for the AuthenticationMethod const type. func PossibleAuthenticationMethodValues() []AuthenticationMethod { - return []AuthenticationMethod{AuthenticationMethodEAPMSCHAPv2, AuthenticationMethodEAPTLS} + return []AuthenticationMethod{EAPMSCHAPv2, EAPTLS} } // AuthorizationUseStatus enumerates the values for authorization use status. type AuthorizationUseStatus string const ( - // AuthorizationUseStatusAvailable ... - AuthorizationUseStatusAvailable AuthorizationUseStatus = "Available" - // AuthorizationUseStatusInUse ... - AuthorizationUseStatusInUse AuthorizationUseStatus = "InUse" + // Available ... + Available AuthorizationUseStatus = "Available" + // InUse ... + InUse AuthorizationUseStatus = "InUse" ) // PossibleAuthorizationUseStatusValues returns an array of possible values for the AuthorizationUseStatus const type. func PossibleAuthorizationUseStatusValues() []AuthorizationUseStatus { - return []AuthorizationUseStatus{AuthorizationUseStatusAvailable, AuthorizationUseStatusInUse} + return []AuthorizationUseStatus{Available, InUse} +} + +// AutoLearnPrivateRangesMode enumerates the values for auto learn private ranges mode. +type AutoLearnPrivateRangesMode string + +const ( + // AutoLearnPrivateRangesModeDisabled ... + AutoLearnPrivateRangesModeDisabled AutoLearnPrivateRangesMode = "Disabled" + // AutoLearnPrivateRangesModeEnabled ... + AutoLearnPrivateRangesModeEnabled AutoLearnPrivateRangesMode = "Enabled" +) + +// PossibleAutoLearnPrivateRangesModeValues returns an array of possible values for the AutoLearnPrivateRangesMode const type. +func PossibleAutoLearnPrivateRangesModeValues() []AutoLearnPrivateRangesMode { + return []AutoLearnPrivateRangesMode{AutoLearnPrivateRangesModeDisabled, AutoLearnPrivateRangesModeEnabled} } // AzureFirewallApplicationRuleProtocolType enumerates the values for azure firewall application rule protocol @@ -407,15 +559,15 @@ func PossibleAzureFirewallApplicationRuleProtocolTypeValues() []AzureFirewallApp type AzureFirewallNatRCActionType string const ( - // AzureFirewallNatRCActionTypeDnat ... - AzureFirewallNatRCActionTypeDnat AzureFirewallNatRCActionType = "Dnat" - // AzureFirewallNatRCActionTypeSnat ... - AzureFirewallNatRCActionTypeSnat AzureFirewallNatRCActionType = "Snat" + // Dnat ... + Dnat AzureFirewallNatRCActionType = "Dnat" + // Snat ... + Snat AzureFirewallNatRCActionType = "Snat" ) // PossibleAzureFirewallNatRCActionTypeValues returns an array of possible values for the AzureFirewallNatRCActionType const type. func PossibleAzureFirewallNatRCActionTypeValues() []AzureFirewallNatRCActionType { - return []AzureFirewallNatRCActionType{AzureFirewallNatRCActionTypeDnat, AzureFirewallNatRCActionTypeSnat} + return []AzureFirewallNatRCActionType{Dnat, Snat} } // AzureFirewallNetworkRuleProtocol enumerates the values for azure firewall network rule protocol. @@ -456,15 +608,15 @@ func PossibleAzureFirewallRCActionTypeValues() []AzureFirewallRCActionType { type AzureFirewallSkuName string const ( - // AzureFirewallSkuNameAZFWHub ... - AzureFirewallSkuNameAZFWHub AzureFirewallSkuName = "AZFW_Hub" - // AzureFirewallSkuNameAZFWVNet ... - AzureFirewallSkuNameAZFWVNet AzureFirewallSkuName = "AZFW_VNet" + // AZFWHub ... + AZFWHub AzureFirewallSkuName = "AZFW_Hub" + // AZFWVNet ... + AZFWVNet AzureFirewallSkuName = "AZFW_VNet" ) // PossibleAzureFirewallSkuNameValues returns an array of possible values for the AzureFirewallSkuName const type. func PossibleAzureFirewallSkuNameValues() []AzureFirewallSkuName { - return []AzureFirewallSkuName{AzureFirewallSkuNameAZFWHub, AzureFirewallSkuNameAZFWVNet} + return []AzureFirewallSkuName{AZFWHub, AZFWVNet} } // AzureFirewallSkuTier enumerates the values for azure firewall sku tier. @@ -505,15 +657,15 @@ func PossibleAzureFirewallThreatIntelModeValues() []AzureFirewallThreatIntelMode type BastionConnectProtocol string const ( - // BastionConnectProtocolRDP ... - BastionConnectProtocolRDP BastionConnectProtocol = "RDP" - // BastionConnectProtocolSSH ... - BastionConnectProtocolSSH BastionConnectProtocol = "SSH" + // RDP ... + RDP BastionConnectProtocol = "RDP" + // SSH ... + SSH BastionConnectProtocol = "SSH" ) // PossibleBastionConnectProtocolValues returns an array of possible values for the BastionConnectProtocol const type. func PossibleBastionConnectProtocolValues() []BastionConnectProtocol { - return []BastionConnectProtocol{BastionConnectProtocolRDP, BastionConnectProtocolSSH} + return []BastionConnectProtocol{RDP, SSH} } // BastionHostSkuName enumerates the values for bastion host sku name. @@ -556,40 +708,59 @@ func PossibleBgpPeerStateValues() []BgpPeerState { type CircuitConnectionStatus string const ( - // CircuitConnectionStatusConnected ... - CircuitConnectionStatusConnected CircuitConnectionStatus = "Connected" - // CircuitConnectionStatusConnecting ... - CircuitConnectionStatusConnecting CircuitConnectionStatus = "Connecting" - // CircuitConnectionStatusDisconnected ... - CircuitConnectionStatusDisconnected CircuitConnectionStatus = "Disconnected" + // Connected ... + Connected CircuitConnectionStatus = "Connected" + // Connecting ... + Connecting CircuitConnectionStatus = "Connecting" + // Disconnected ... + Disconnected CircuitConnectionStatus = "Disconnected" ) // PossibleCircuitConnectionStatusValues returns an array of possible values for the CircuitConnectionStatus const type. func PossibleCircuitConnectionStatusValues() []CircuitConnectionStatus { - return []CircuitConnectionStatus{CircuitConnectionStatusConnected, CircuitConnectionStatusConnecting, CircuitConnectionStatusDisconnected} + return []CircuitConnectionStatus{Connected, Connecting, Disconnected} } // CommissionedState enumerates the values for commissioned state. type CommissionedState string const ( - // CommissionedStateCommissioned ... - CommissionedStateCommissioned CommissionedState = "Commissioned" - // CommissionedStateCommissioning ... - CommissionedStateCommissioning CommissionedState = "Commissioning" - // CommissionedStateDecommissioning ... - CommissionedStateDecommissioning CommissionedState = "Decommissioning" - // CommissionedStateDeprovisioning ... - CommissionedStateDeprovisioning CommissionedState = "Deprovisioning" - // CommissionedStateProvisioned ... - CommissionedStateProvisioned CommissionedState = "Provisioned" - // CommissionedStateProvisioning ... - CommissionedStateProvisioning CommissionedState = "Provisioning" + // Commissioned ... + Commissioned CommissionedState = "Commissioned" + // CommissionedNoInternetAdvertise ... + CommissionedNoInternetAdvertise CommissionedState = "CommissionedNoInternetAdvertise" + // Commissioning ... + Commissioning CommissionedState = "Commissioning" + // Decommissioning ... + Decommissioning CommissionedState = "Decommissioning" + // Deprovisioned ... + Deprovisioned CommissionedState = "Deprovisioned" + // Deprovisioning ... + Deprovisioning CommissionedState = "Deprovisioning" + // Provisioned ... + Provisioned CommissionedState = "Provisioned" + // Provisioning ... + Provisioning CommissionedState = "Provisioning" ) // PossibleCommissionedStateValues returns an array of possible values for the CommissionedState const type. func PossibleCommissionedStateValues() []CommissionedState { - return []CommissionedState{CommissionedStateCommissioned, CommissionedStateCommissioning, CommissionedStateDecommissioning, CommissionedStateDeprovisioning, CommissionedStateProvisioned, CommissionedStateProvisioning} + return []CommissionedState{Commissioned, CommissionedNoInternetAdvertise, Commissioning, Decommissioning, Deprovisioned, Deprovisioning, Provisioned, Provisioning} +} + +// ConfigurationType enumerates the values for configuration type. +type ConfigurationType string + +const ( + // Connectivity ... + Connectivity ConfigurationType = "Connectivity" + // SecurityAdmin ... + SecurityAdmin ConfigurationType = "SecurityAdmin" +) + +// PossibleConfigurationTypeValues returns an array of possible values for the ConfigurationType const type. +func PossibleConfigurationTypeValues() []ConfigurationType { + return []ConfigurationType{Connectivity, SecurityAdmin} } // ConnectionMonitorEndpointFilterItemType enumerates the values for connection monitor endpoint filter item @@ -597,26 +768,26 @@ func PossibleCommissionedStateValues() []CommissionedState { type ConnectionMonitorEndpointFilterItemType string const ( - // ConnectionMonitorEndpointFilterItemTypeAgentAddress ... - ConnectionMonitorEndpointFilterItemTypeAgentAddress ConnectionMonitorEndpointFilterItemType = "AgentAddress" + // AgentAddress ... + AgentAddress ConnectionMonitorEndpointFilterItemType = "AgentAddress" ) // PossibleConnectionMonitorEndpointFilterItemTypeValues returns an array of possible values for the ConnectionMonitorEndpointFilterItemType const type. func PossibleConnectionMonitorEndpointFilterItemTypeValues() []ConnectionMonitorEndpointFilterItemType { - return []ConnectionMonitorEndpointFilterItemType{ConnectionMonitorEndpointFilterItemTypeAgentAddress} + return []ConnectionMonitorEndpointFilterItemType{AgentAddress} } // ConnectionMonitorEndpointFilterType enumerates the values for connection monitor endpoint filter type. type ConnectionMonitorEndpointFilterType string const ( - // ConnectionMonitorEndpointFilterTypeInclude ... - ConnectionMonitorEndpointFilterTypeInclude ConnectionMonitorEndpointFilterType = "Include" + // Include ... + Include ConnectionMonitorEndpointFilterType = "Include" ) // PossibleConnectionMonitorEndpointFilterTypeValues returns an array of possible values for the ConnectionMonitorEndpointFilterType const type. func PossibleConnectionMonitorEndpointFilterTypeValues() []ConnectionMonitorEndpointFilterType { - return []ConnectionMonitorEndpointFilterType{ConnectionMonitorEndpointFilterTypeInclude} + return []ConnectionMonitorEndpointFilterType{Include} } // ConnectionMonitorSourceStatus enumerates the values for connection monitor source status. @@ -658,15 +829,15 @@ func PossibleConnectionMonitorTestConfigurationProtocolValues() []ConnectionMoni type ConnectionMonitorType string const ( - // ConnectionMonitorTypeMultiEndpoint ... - ConnectionMonitorTypeMultiEndpoint ConnectionMonitorType = "MultiEndpoint" - // ConnectionMonitorTypeSingleSourceDestination ... - ConnectionMonitorTypeSingleSourceDestination ConnectionMonitorType = "SingleSourceDestination" + // MultiEndpoint ... + MultiEndpoint ConnectionMonitorType = "MultiEndpoint" + // SingleSourceDestination ... + SingleSourceDestination ConnectionMonitorType = "SingleSourceDestination" ) // PossibleConnectionMonitorTypeValues returns an array of possible values for the ConnectionMonitorType const type. func PossibleConnectionMonitorTypeValues() []ConnectionMonitorType { - return []ConnectionMonitorType{ConnectionMonitorTypeMultiEndpoint, ConnectionMonitorTypeSingleSourceDestination} + return []ConnectionMonitorType{MultiEndpoint, SingleSourceDestination} } // ConnectionState enumerates the values for connection state. @@ -705,94 +876,144 @@ func PossibleConnectionStatusValues() []ConnectionStatus { return []ConnectionStatus{ConnectionStatusConnected, ConnectionStatusDegraded, ConnectionStatusDisconnected, ConnectionStatusUnknown} } +// ConnectivityTopology enumerates the values for connectivity topology. +type ConnectivityTopology string + +const ( + // HubAndSpoke ... + HubAndSpoke ConnectivityTopology = "HubAndSpoke" + // Mesh ... + Mesh ConnectivityTopology = "Mesh" +) + +// PossibleConnectivityTopologyValues returns an array of possible values for the ConnectivityTopology const type. +func PossibleConnectivityTopologyValues() []ConnectivityTopology { + return []ConnectivityTopology{HubAndSpoke, Mesh} +} + // CoverageLevel enumerates the values for coverage level. type CoverageLevel string const ( - // CoverageLevelAboveAverage ... - CoverageLevelAboveAverage CoverageLevel = "AboveAverage" - // CoverageLevelAverage ... - CoverageLevelAverage CoverageLevel = "Average" - // CoverageLevelBelowAverage ... - CoverageLevelBelowAverage CoverageLevel = "BelowAverage" - // CoverageLevelDefault ... - CoverageLevelDefault CoverageLevel = "Default" - // CoverageLevelFull ... - CoverageLevelFull CoverageLevel = "Full" - // CoverageLevelLow ... - CoverageLevelLow CoverageLevel = "Low" + // AboveAverage ... + AboveAverage CoverageLevel = "AboveAverage" + // Average ... + Average CoverageLevel = "Average" + // BelowAverage ... + BelowAverage CoverageLevel = "BelowAverage" + // Default ... + Default CoverageLevel = "Default" + // Full ... + Full CoverageLevel = "Full" + // Low ... + Low CoverageLevel = "Low" ) // PossibleCoverageLevelValues returns an array of possible values for the CoverageLevel const type. func PossibleCoverageLevelValues() []CoverageLevel { - return []CoverageLevel{CoverageLevelAboveAverage, CoverageLevelAverage, CoverageLevelBelowAverage, CoverageLevelDefault, CoverageLevelFull, CoverageLevelLow} + return []CoverageLevel{AboveAverage, Average, BelowAverage, Default, Full, Low} } -// DdosCustomPolicyProtocol enumerates the values for ddos custom policy protocol. -type DdosCustomPolicyProtocol string +// CreatedByType enumerates the values for created by type. +type CreatedByType string const ( - // DdosCustomPolicyProtocolSyn ... - DdosCustomPolicyProtocolSyn DdosCustomPolicyProtocol = "Syn" - // DdosCustomPolicyProtocolTCP ... - DdosCustomPolicyProtocolTCP DdosCustomPolicyProtocol = "Tcp" - // DdosCustomPolicyProtocolUDP ... - DdosCustomPolicyProtocolUDP DdosCustomPolicyProtocol = "Udp" + // Application ... + Application CreatedByType = "Application" + // Key ... + Key CreatedByType = "Key" + // ManagedIdentity ... + ManagedIdentity CreatedByType = "ManagedIdentity" + // User ... + User CreatedByType = "User" ) -// PossibleDdosCustomPolicyProtocolValues returns an array of possible values for the DdosCustomPolicyProtocol const type. -func PossibleDdosCustomPolicyProtocolValues() []DdosCustomPolicyProtocol { - return []DdosCustomPolicyProtocol{DdosCustomPolicyProtocolSyn, DdosCustomPolicyProtocolTCP, DdosCustomPolicyProtocolUDP} +// PossibleCreatedByTypeValues returns an array of possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{Application, Key, ManagedIdentity, User} } -// DdosCustomPolicyTriggerSensitivityOverride enumerates the values for ddos custom policy trigger sensitivity -// override. -type DdosCustomPolicyTriggerSensitivityOverride string +// CustomIPPrefixType enumerates the values for custom ip prefix type. +type CustomIPPrefixType string const ( - // DdosCustomPolicyTriggerSensitivityOverrideDefault ... - DdosCustomPolicyTriggerSensitivityOverrideDefault DdosCustomPolicyTriggerSensitivityOverride = "Default" - // DdosCustomPolicyTriggerSensitivityOverrideHigh ... - DdosCustomPolicyTriggerSensitivityOverrideHigh DdosCustomPolicyTriggerSensitivityOverride = "High" - // DdosCustomPolicyTriggerSensitivityOverrideLow ... - DdosCustomPolicyTriggerSensitivityOverrideLow DdosCustomPolicyTriggerSensitivityOverride = "Low" - // DdosCustomPolicyTriggerSensitivityOverrideRelaxed ... - DdosCustomPolicyTriggerSensitivityOverrideRelaxed DdosCustomPolicyTriggerSensitivityOverride = "Relaxed" + // Child ... + Child CustomIPPrefixType = "Child" + // Parent ... + Parent CustomIPPrefixType = "Parent" + // Singular ... + Singular CustomIPPrefixType = "Singular" ) -// PossibleDdosCustomPolicyTriggerSensitivityOverrideValues returns an array of possible values for the DdosCustomPolicyTriggerSensitivityOverride const type. -func PossibleDdosCustomPolicyTriggerSensitivityOverrideValues() []DdosCustomPolicyTriggerSensitivityOverride { - return []DdosCustomPolicyTriggerSensitivityOverride{DdosCustomPolicyTriggerSensitivityOverrideDefault, DdosCustomPolicyTriggerSensitivityOverrideHigh, DdosCustomPolicyTriggerSensitivityOverrideLow, DdosCustomPolicyTriggerSensitivityOverrideRelaxed} +// PossibleCustomIPPrefixTypeValues returns an array of possible values for the CustomIPPrefixType const type. +func PossibleCustomIPPrefixTypeValues() []CustomIPPrefixType { + return []CustomIPPrefixType{Child, Parent, Singular} } -// DdosSettingsProtectionCoverage enumerates the values for ddos settings protection coverage. -type DdosSettingsProtectionCoverage string +// DdosSettingsProtectionMode enumerates the values for ddos settings protection mode. +type DdosSettingsProtectionMode string const ( - // DdosSettingsProtectionCoverageBasic ... - DdosSettingsProtectionCoverageBasic DdosSettingsProtectionCoverage = "Basic" - // DdosSettingsProtectionCoverageStandard ... - DdosSettingsProtectionCoverageStandard DdosSettingsProtectionCoverage = "Standard" + // DdosSettingsProtectionModeDisabled ... + DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" + // DdosSettingsProtectionModeEnabled ... + DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" + // DdosSettingsProtectionModeVirtualNetworkInherited ... + DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" ) -// PossibleDdosSettingsProtectionCoverageValues returns an array of possible values for the DdosSettingsProtectionCoverage const type. -func PossibleDdosSettingsProtectionCoverageValues() []DdosSettingsProtectionCoverage { - return []DdosSettingsProtectionCoverage{DdosSettingsProtectionCoverageBasic, DdosSettingsProtectionCoverageStandard} +// PossibleDdosSettingsProtectionModeValues returns an array of possible values for the DdosSettingsProtectionMode const type. +func PossibleDdosSettingsProtectionModeValues() []DdosSettingsProtectionMode { + return []DdosSettingsProtectionMode{DdosSettingsProtectionModeDisabled, DdosSettingsProtectionModeEnabled, DdosSettingsProtectionModeVirtualNetworkInherited} +} + +// DeleteExistingPeering enumerates the values for delete existing peering. +type DeleteExistingPeering string + +const ( + // False ... + False DeleteExistingPeering = "False" + // True ... + True DeleteExistingPeering = "True" +) + +// PossibleDeleteExistingPeeringValues returns an array of possible values for the DeleteExistingPeering const type. +func PossibleDeleteExistingPeeringValues() []DeleteExistingPeering { + return []DeleteExistingPeering{False, True} } // DeleteOptions enumerates the values for delete options. type DeleteOptions string const ( - // DeleteOptionsDelete ... - DeleteOptionsDelete DeleteOptions = "Delete" - // DeleteOptionsDetach ... - DeleteOptionsDetach DeleteOptions = "Detach" + // Delete ... + Delete DeleteOptions = "Delete" + // Detach ... + Detach DeleteOptions = "Detach" ) // PossibleDeleteOptionsValues returns an array of possible values for the DeleteOptions const type. func PossibleDeleteOptionsValues() []DeleteOptions { - return []DeleteOptions{DeleteOptionsDelete, DeleteOptionsDetach} + return []DeleteOptions{Delete, Detach} +} + +// DeploymentStatus enumerates the values for deployment status. +type DeploymentStatus string + +const ( + // Deployed ... + Deployed DeploymentStatus = "Deployed" + // Deploying ... + Deploying DeploymentStatus = "Deploying" + // Failed ... + Failed DeploymentStatus = "Failed" + // NotStarted ... + NotStarted DeploymentStatus = "NotStarted" +) + +// PossibleDeploymentStatusValues returns an array of possible values for the DeploymentStatus const type. +func PossibleDeploymentStatusValues() []DeploymentStatus { + return []DeploymentStatus{Deployed, Deploying, Failed, NotStarted} } // DestinationPortBehavior enumerates the values for destination port behavior. @@ -841,15 +1062,15 @@ func PossibleDhGroupValues() []DhGroup { type Direction string const ( - // DirectionInbound ... - DirectionInbound Direction = "Inbound" - // DirectionOutbound ... - DirectionOutbound Direction = "Outbound" + // Inbound ... + Inbound Direction = "Inbound" + // Outbound ... + Outbound Direction = "Outbound" ) // PossibleDirectionValues returns an array of possible values for the Direction const type. func PossibleDirectionValues() []Direction { - return []Direction{DirectionInbound, DirectionOutbound} + return []Direction{Inbound, Outbound} } // EffectiveRouteSource enumerates the values for effective route source. @@ -875,15 +1096,15 @@ func PossibleEffectiveRouteSourceValues() []EffectiveRouteSource { type EffectiveRouteState string const ( - // EffectiveRouteStateActive ... - EffectiveRouteStateActive EffectiveRouteState = "Active" - // EffectiveRouteStateInvalid ... - EffectiveRouteStateInvalid EffectiveRouteState = "Invalid" + // Active ... + Active EffectiveRouteState = "Active" + // Invalid ... + Invalid EffectiveRouteState = "Invalid" ) // PossibleEffectiveRouteStateValues returns an array of possible values for the EffectiveRouteState const type. func PossibleEffectiveRouteStateValues() []EffectiveRouteState { - return []EffectiveRouteState{EffectiveRouteStateActive, EffectiveRouteStateInvalid} + return []EffectiveRouteState{Active, Invalid} } // EffectiveSecurityRuleProtocol enumerates the values for effective security rule protocol. @@ -907,23 +1128,27 @@ func PossibleEffectiveSecurityRuleProtocolValues() []EffectiveSecurityRuleProtoc type EndpointType string const ( - // EndpointTypeAzureSubnet ... - EndpointTypeAzureSubnet EndpointType = "AzureSubnet" - // EndpointTypeAzureVM ... - EndpointTypeAzureVM EndpointType = "AzureVM" - // EndpointTypeAzureVNet ... - EndpointTypeAzureVNet EndpointType = "AzureVNet" - // EndpointTypeExternalAddress ... - EndpointTypeExternalAddress EndpointType = "ExternalAddress" - // EndpointTypeMMAWorkspaceMachine ... - EndpointTypeMMAWorkspaceMachine EndpointType = "MMAWorkspaceMachine" - // EndpointTypeMMAWorkspaceNetwork ... - EndpointTypeMMAWorkspaceNetwork EndpointType = "MMAWorkspaceNetwork" + // AzureArcVM ... + AzureArcVM EndpointType = "AzureArcVM" + // AzureSubnet ... + AzureSubnet EndpointType = "AzureSubnet" + // AzureVM ... + AzureVM EndpointType = "AzureVM" + // AzureVMSS ... + AzureVMSS EndpointType = "AzureVMSS" + // AzureVNet ... + AzureVNet EndpointType = "AzureVNet" + // ExternalAddress ... + ExternalAddress EndpointType = "ExternalAddress" + // MMAWorkspaceMachine ... + MMAWorkspaceMachine EndpointType = "MMAWorkspaceMachine" + // MMAWorkspaceNetwork ... + MMAWorkspaceNetwork EndpointType = "MMAWorkspaceNetwork" ) // PossibleEndpointTypeValues returns an array of possible values for the EndpointType const type. func PossibleEndpointTypeValues() []EndpointType { - return []EndpointType{EndpointTypeAzureSubnet, EndpointTypeAzureVM, EndpointTypeAzureVNet, EndpointTypeExternalAddress, EndpointTypeMMAWorkspaceMachine, EndpointTypeMMAWorkspaceNetwork} + return []EndpointType{AzureArcVM, AzureSubnet, AzureVM, AzureVMSS, AzureVNet, ExternalAddress, MMAWorkspaceMachine, MMAWorkspaceNetwork} } // EvaluationState enumerates the values for evaluation state. @@ -948,19 +1173,19 @@ func PossibleEvaluationStateValues() []EvaluationState { type ExpressRouteCircuitPeeringAdvertisedPublicPrefixState string const ( - // ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured ... - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configured" - // ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring ... - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configuring" - // ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured ... - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "NotConfigured" - // ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded ... - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "ValidationNeeded" + // Configured ... + Configured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configured" + // Configuring ... + Configuring ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configuring" + // NotConfigured ... + NotConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "NotConfigured" + // ValidationNeeded ... + ValidationNeeded ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "ValidationNeeded" ) // PossibleExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValues returns an array of possible values for the ExpressRouteCircuitPeeringAdvertisedPublicPrefixState const type. func PossibleExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValues() []ExpressRouteCircuitPeeringAdvertisedPublicPrefixState { - return []ExpressRouteCircuitPeeringAdvertisedPublicPrefixState{ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured, ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring, ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured, ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded} + return []ExpressRouteCircuitPeeringAdvertisedPublicPrefixState{Configured, Configuring, NotConfigured, ValidationNeeded} } // ExpressRouteCircuitPeeringState enumerates the values for express route circuit peering state. @@ -982,15 +1207,15 @@ func PossibleExpressRouteCircuitPeeringStateValues() []ExpressRouteCircuitPeerin type ExpressRouteCircuitSkuFamily string const ( - // ExpressRouteCircuitSkuFamilyMeteredData ... - ExpressRouteCircuitSkuFamilyMeteredData ExpressRouteCircuitSkuFamily = "MeteredData" - // ExpressRouteCircuitSkuFamilyUnlimitedData ... - ExpressRouteCircuitSkuFamilyUnlimitedData ExpressRouteCircuitSkuFamily = "UnlimitedData" + // MeteredData ... + MeteredData ExpressRouteCircuitSkuFamily = "MeteredData" + // UnlimitedData ... + UnlimitedData ExpressRouteCircuitSkuFamily = "UnlimitedData" ) // PossibleExpressRouteCircuitSkuFamilyValues returns an array of possible values for the ExpressRouteCircuitSkuFamily const type. func PossibleExpressRouteCircuitSkuFamilyValues() []ExpressRouteCircuitSkuFamily { - return []ExpressRouteCircuitSkuFamily{ExpressRouteCircuitSkuFamilyMeteredData, ExpressRouteCircuitSkuFamilyUnlimitedData} + return []ExpressRouteCircuitSkuFamily{MeteredData, UnlimitedData} } // ExpressRouteCircuitSkuTier enumerates the values for express route circuit sku tier. @@ -1031,34 +1256,34 @@ func PossibleExpressRouteLinkAdminStateValues() []ExpressRouteLinkAdminState { type ExpressRouteLinkConnectorType string const ( - // ExpressRouteLinkConnectorTypeLC ... - ExpressRouteLinkConnectorTypeLC ExpressRouteLinkConnectorType = "LC" - // ExpressRouteLinkConnectorTypeSC ... - ExpressRouteLinkConnectorTypeSC ExpressRouteLinkConnectorType = "SC" + // LC ... + LC ExpressRouteLinkConnectorType = "LC" + // SC ... + SC ExpressRouteLinkConnectorType = "SC" ) // PossibleExpressRouteLinkConnectorTypeValues returns an array of possible values for the ExpressRouteLinkConnectorType const type. func PossibleExpressRouteLinkConnectorTypeValues() []ExpressRouteLinkConnectorType { - return []ExpressRouteLinkConnectorType{ExpressRouteLinkConnectorTypeLC, ExpressRouteLinkConnectorTypeSC} + return []ExpressRouteLinkConnectorType{LC, SC} } // ExpressRouteLinkMacSecCipher enumerates the values for express route link mac sec cipher. type ExpressRouteLinkMacSecCipher string const ( - // ExpressRouteLinkMacSecCipherGcmAes128 ... - ExpressRouteLinkMacSecCipherGcmAes128 ExpressRouteLinkMacSecCipher = "GcmAes128" - // ExpressRouteLinkMacSecCipherGcmAes256 ... - ExpressRouteLinkMacSecCipherGcmAes256 ExpressRouteLinkMacSecCipher = "GcmAes256" - // ExpressRouteLinkMacSecCipherGcmAesXpn128 ... - ExpressRouteLinkMacSecCipherGcmAesXpn128 ExpressRouteLinkMacSecCipher = "GcmAesXpn128" - // ExpressRouteLinkMacSecCipherGcmAesXpn256 ... - ExpressRouteLinkMacSecCipherGcmAesXpn256 ExpressRouteLinkMacSecCipher = "GcmAesXpn256" + // GcmAes128 ... + GcmAes128 ExpressRouteLinkMacSecCipher = "GcmAes128" + // GcmAes256 ... + GcmAes256 ExpressRouteLinkMacSecCipher = "GcmAes256" + // GcmAesXpn128 ... + GcmAesXpn128 ExpressRouteLinkMacSecCipher = "GcmAesXpn128" + // GcmAesXpn256 ... + GcmAesXpn256 ExpressRouteLinkMacSecCipher = "GcmAesXpn256" ) // PossibleExpressRouteLinkMacSecCipherValues returns an array of possible values for the ExpressRouteLinkMacSecCipher const type. func PossibleExpressRouteLinkMacSecCipherValues() []ExpressRouteLinkMacSecCipher { - return []ExpressRouteLinkMacSecCipher{ExpressRouteLinkMacSecCipherGcmAes128, ExpressRouteLinkMacSecCipherGcmAes256, ExpressRouteLinkMacSecCipherGcmAesXpn128, ExpressRouteLinkMacSecCipherGcmAesXpn256} + return []ExpressRouteLinkMacSecCipher{GcmAes128, GcmAes256, GcmAesXpn128, GcmAesXpn256} } // ExpressRouteLinkMacSecSciState enumerates the values for express route link mac sec sci state. @@ -1095,17 +1320,17 @@ func PossibleExpressRoutePeeringStateValues() []ExpressRoutePeeringState { type ExpressRoutePeeringType string const ( - // ExpressRoutePeeringTypeAzurePrivatePeering ... - ExpressRoutePeeringTypeAzurePrivatePeering ExpressRoutePeeringType = "AzurePrivatePeering" - // ExpressRoutePeeringTypeAzurePublicPeering ... - ExpressRoutePeeringTypeAzurePublicPeering ExpressRoutePeeringType = "AzurePublicPeering" - // ExpressRoutePeeringTypeMicrosoftPeering ... - ExpressRoutePeeringTypeMicrosoftPeering ExpressRoutePeeringType = "MicrosoftPeering" + // AzurePrivatePeering ... + AzurePrivatePeering ExpressRoutePeeringType = "AzurePrivatePeering" + // AzurePublicPeering ... + AzurePublicPeering ExpressRoutePeeringType = "AzurePublicPeering" + // MicrosoftPeering ... + MicrosoftPeering ExpressRoutePeeringType = "MicrosoftPeering" ) // PossibleExpressRoutePeeringTypeValues returns an array of possible values for the ExpressRoutePeeringType const type. func PossibleExpressRoutePeeringTypeValues() []ExpressRoutePeeringType { - return []ExpressRoutePeeringType{ExpressRoutePeeringTypeAzurePrivatePeering, ExpressRoutePeeringTypeAzurePublicPeering, ExpressRoutePeeringTypeMicrosoftPeering} + return []ExpressRoutePeeringType{AzurePrivatePeering, AzurePublicPeering, MicrosoftPeering} } // ExpressRoutePortAuthorizationUseStatus enumerates the values for express route port authorization use @@ -1124,32 +1349,47 @@ func PossibleExpressRoutePortAuthorizationUseStatusValues() []ExpressRoutePortAu return []ExpressRoutePortAuthorizationUseStatus{ExpressRoutePortAuthorizationUseStatusAvailable, ExpressRoutePortAuthorizationUseStatusInUse} } +// ExpressRoutePortsBillingType enumerates the values for express route ports billing type. +type ExpressRoutePortsBillingType string + +const ( + // ExpressRoutePortsBillingTypeMeteredData ... + ExpressRoutePortsBillingTypeMeteredData ExpressRoutePortsBillingType = "MeteredData" + // ExpressRoutePortsBillingTypeUnlimitedData ... + ExpressRoutePortsBillingTypeUnlimitedData ExpressRoutePortsBillingType = "UnlimitedData" +) + +// PossibleExpressRoutePortsBillingTypeValues returns an array of possible values for the ExpressRoutePortsBillingType const type. +func PossibleExpressRoutePortsBillingTypeValues() []ExpressRoutePortsBillingType { + return []ExpressRoutePortsBillingType{ExpressRoutePortsBillingTypeMeteredData, ExpressRoutePortsBillingTypeUnlimitedData} +} + // ExpressRoutePortsEncapsulation enumerates the values for express route ports encapsulation. type ExpressRoutePortsEncapsulation string const ( - // ExpressRoutePortsEncapsulationDot1Q ... - ExpressRoutePortsEncapsulationDot1Q ExpressRoutePortsEncapsulation = "Dot1Q" - // ExpressRoutePortsEncapsulationQinQ ... - ExpressRoutePortsEncapsulationQinQ ExpressRoutePortsEncapsulation = "QinQ" + // Dot1Q ... + Dot1Q ExpressRoutePortsEncapsulation = "Dot1Q" + // QinQ ... + QinQ ExpressRoutePortsEncapsulation = "QinQ" ) // PossibleExpressRoutePortsEncapsulationValues returns an array of possible values for the ExpressRoutePortsEncapsulation const type. func PossibleExpressRoutePortsEncapsulationValues() []ExpressRoutePortsEncapsulation { - return []ExpressRoutePortsEncapsulation{ExpressRoutePortsEncapsulationDot1Q, ExpressRoutePortsEncapsulationQinQ} + return []ExpressRoutePortsEncapsulation{Dot1Q, QinQ} } // ExtendedLocationTypes enumerates the values for extended location types. type ExtendedLocationTypes string const ( - // ExtendedLocationTypesEdgeZone ... - ExtendedLocationTypesEdgeZone ExtendedLocationTypes = "EdgeZone" + // EdgeZone ... + EdgeZone ExtendedLocationTypes = "EdgeZone" ) // PossibleExtendedLocationTypesValues returns an array of possible values for the ExtendedLocationTypes const type. func PossibleExtendedLocationTypesValues() []ExtendedLocationTypes { - return []ExtendedLocationTypes{ExtendedLocationTypesEdgeZone} + return []ExtendedLocationTypes{EdgeZone} } // FirewallPolicyFilterRuleCollectionActionType enumerates the values for firewall policy filter rule @@ -1172,15 +1412,15 @@ func PossibleFirewallPolicyFilterRuleCollectionActionTypeValues() []FirewallPoli type FirewallPolicyIDPSQuerySortOrder string const ( - // FirewallPolicyIDPSQuerySortOrderAscending ... - FirewallPolicyIDPSQuerySortOrderAscending FirewallPolicyIDPSQuerySortOrder = "Ascending" - // FirewallPolicyIDPSQuerySortOrderDescending ... - FirewallPolicyIDPSQuerySortOrderDescending FirewallPolicyIDPSQuerySortOrder = "Descending" + // Ascending ... + Ascending FirewallPolicyIDPSQuerySortOrder = "Ascending" + // Descending ... + Descending FirewallPolicyIDPSQuerySortOrder = "Descending" ) // PossibleFirewallPolicyIDPSQuerySortOrderValues returns an array of possible values for the FirewallPolicyIDPSQuerySortOrder const type. func PossibleFirewallPolicyIDPSQuerySortOrderValues() []FirewallPolicyIDPSQuerySortOrder { - return []FirewallPolicyIDPSQuerySortOrder{FirewallPolicyIDPSQuerySortOrderAscending, FirewallPolicyIDPSQuerySortOrderDescending} + return []FirewallPolicyIDPSQuerySortOrder{Ascending, Descending} } // FirewallPolicyIntrusionDetectionProtocol enumerates the values for firewall policy intrusion detection @@ -1226,13 +1466,13 @@ func PossibleFirewallPolicyIntrusionDetectionStateTypeValues() []FirewallPolicyI type FirewallPolicyNatRuleCollectionActionType string const ( - // FirewallPolicyNatRuleCollectionActionTypeDNAT ... - FirewallPolicyNatRuleCollectionActionTypeDNAT FirewallPolicyNatRuleCollectionActionType = "DNAT" + // DNAT ... + DNAT FirewallPolicyNatRuleCollectionActionType = "DNAT" ) // PossibleFirewallPolicyNatRuleCollectionActionTypeValues returns an array of possible values for the FirewallPolicyNatRuleCollectionActionType const type. func PossibleFirewallPolicyNatRuleCollectionActionTypeValues() []FirewallPolicyNatRuleCollectionActionType { - return []FirewallPolicyNatRuleCollectionActionType{FirewallPolicyNatRuleCollectionActionTypeDNAT} + return []FirewallPolicyNatRuleCollectionActionType{DNAT} } // FirewallPolicyRuleApplicationProtocolType enumerates the values for firewall policy rule application @@ -1291,13 +1531,13 @@ func PossibleFirewallPolicySkuTierValues() []FirewallPolicySkuTier { type FlowLogFormatType string const ( - // FlowLogFormatTypeJSON ... - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" + // JSON ... + JSON FlowLogFormatType = "JSON" ) // PossibleFlowLogFormatTypeValues returns an array of possible values for the FlowLogFormatType const type. func PossibleFlowLogFormatTypeValues() []FlowLogFormatType { - return []FlowLogFormatType{FlowLogFormatTypeJSON} + return []FlowLogFormatType{JSON} } // GatewayLoadBalancerTunnelInterfaceType enumerates the values for gateway load balancer tunnel interface @@ -1335,19 +1575,63 @@ func PossibleGatewayLoadBalancerTunnelProtocolValues() []GatewayLoadBalancerTunn return []GatewayLoadBalancerTunnelProtocol{GatewayLoadBalancerTunnelProtocolNative, GatewayLoadBalancerTunnelProtocolNone, GatewayLoadBalancerTunnelProtocolVXLAN} } +// Geo enumerates the values for geo. +type Geo string + +const ( + // AFRI ... + AFRI Geo = "AFRI" + // APAC ... + APAC Geo = "APAC" + // AQ ... + AQ Geo = "AQ" + // EURO ... + EURO Geo = "EURO" + // GLOBAL ... + GLOBAL Geo = "GLOBAL" + // LATAM ... + LATAM Geo = "LATAM" + // ME ... + ME Geo = "ME" + // NAM ... + NAM Geo = "NAM" + // OCEANIA ... + OCEANIA Geo = "OCEANIA" +) + +// PossibleGeoValues returns an array of possible values for the Geo const type. +func PossibleGeoValues() []Geo { + return []Geo{AFRI, APAC, AQ, EURO, GLOBAL, LATAM, ME, NAM, OCEANIA} +} + +// GroupConnectivity enumerates the values for group connectivity. +type GroupConnectivity string + +const ( + // GroupConnectivityDirectlyConnected ... + GroupConnectivityDirectlyConnected GroupConnectivity = "DirectlyConnected" + // GroupConnectivityNone ... + GroupConnectivityNone GroupConnectivity = "None" +) + +// PossibleGroupConnectivityValues returns an array of possible values for the GroupConnectivity const type. +func PossibleGroupConnectivityValues() []GroupConnectivity { + return []GroupConnectivity{GroupConnectivityDirectlyConnected, GroupConnectivityNone} +} + // HTTPConfigurationMethod enumerates the values for http configuration method. type HTTPConfigurationMethod string const ( - // HTTPConfigurationMethodGet ... - HTTPConfigurationMethodGet HTTPConfigurationMethod = "Get" - // HTTPConfigurationMethodPost ... - HTTPConfigurationMethodPost HTTPConfigurationMethod = "Post" + // Get ... + Get HTTPConfigurationMethod = "Get" + // Post ... + Post HTTPConfigurationMethod = "Post" ) // PossibleHTTPConfigurationMethodValues returns an array of possible values for the HTTPConfigurationMethod const type. func PossibleHTTPConfigurationMethodValues() []HTTPConfigurationMethod { - return []HTTPConfigurationMethod{HTTPConfigurationMethodGet, HTTPConfigurationMethodPost} + return []HTTPConfigurationMethod{Get, Post} } // HTTPMethod enumerates the values for http method. @@ -1422,25 +1706,25 @@ func PossibleHubVirtualNetworkConnectionStatusValues() []HubVirtualNetworkConnec type IkeEncryption string const ( - // IkeEncryptionAES128 ... - IkeEncryptionAES128 IkeEncryption = "AES128" - // IkeEncryptionAES192 ... - IkeEncryptionAES192 IkeEncryption = "AES192" - // IkeEncryptionAES256 ... - IkeEncryptionAES256 IkeEncryption = "AES256" - // IkeEncryptionDES ... - IkeEncryptionDES IkeEncryption = "DES" - // IkeEncryptionDES3 ... - IkeEncryptionDES3 IkeEncryption = "DES3" - // IkeEncryptionGCMAES128 ... - IkeEncryptionGCMAES128 IkeEncryption = "GCMAES128" - // IkeEncryptionGCMAES256 ... - IkeEncryptionGCMAES256 IkeEncryption = "GCMAES256" + // AES128 ... + AES128 IkeEncryption = "AES128" + // AES192 ... + AES192 IkeEncryption = "AES192" + // AES256 ... + AES256 IkeEncryption = "AES256" + // DES ... + DES IkeEncryption = "DES" + // DES3 ... + DES3 IkeEncryption = "DES3" + // GCMAES128 ... + GCMAES128 IkeEncryption = "GCMAES128" + // GCMAES256 ... + GCMAES256 IkeEncryption = "GCMAES256" ) // PossibleIkeEncryptionValues returns an array of possible values for the IkeEncryption const type. func PossibleIkeEncryptionValues() []IkeEncryption { - return []IkeEncryption{IkeEncryptionAES128, IkeEncryptionAES192, IkeEncryptionAES256, IkeEncryptionDES, IkeEncryptionDES3, IkeEncryptionGCMAES128, IkeEncryptionGCMAES256} + return []IkeEncryption{AES128, AES192, AES256, DES, DES3, GCMAES128, GCMAES256} } // IkeIntegrity enumerates the values for ike integrity. @@ -1481,6 +1765,23 @@ func PossibleInboundSecurityRulesProtocolValues() []InboundSecurityRulesProtocol return []InboundSecurityRulesProtocol{InboundSecurityRulesProtocolTCP, InboundSecurityRulesProtocolUDP} } +// IntentPolicyBasedService enumerates the values for intent policy based service. +type IntentPolicyBasedService string + +const ( + // IntentPolicyBasedServiceAll ... + IntentPolicyBasedServiceAll IntentPolicyBasedService = "All" + // IntentPolicyBasedServiceAllowRulesOnly ... + IntentPolicyBasedServiceAllowRulesOnly IntentPolicyBasedService = "AllowRulesOnly" + // IntentPolicyBasedServiceNone ... + IntentPolicyBasedServiceNone IntentPolicyBasedService = "None" +) + +// PossibleIntentPolicyBasedServiceValues returns an array of possible values for the IntentPolicyBasedService const type. +func PossibleIntentPolicyBasedServiceValues() []IntentPolicyBasedService { + return []IntentPolicyBasedService{IntentPolicyBasedServiceAll, IntentPolicyBasedServiceAllowRulesOnly, IntentPolicyBasedServiceNone} +} + // InterfaceAuxiliaryMode enumerates the values for interface auxiliary mode. type InterfaceAuxiliaryMode string @@ -1523,45 +1824,45 @@ func PossibleInterfaceMigrationPhaseValues() []InterfaceMigrationPhase { type InterfaceNicType string const ( - // InterfaceNicTypeElastic ... - InterfaceNicTypeElastic InterfaceNicType = "Elastic" - // InterfaceNicTypeStandard ... - InterfaceNicTypeStandard InterfaceNicType = "Standard" + // Elastic ... + Elastic InterfaceNicType = "Elastic" + // Standard ... + Standard InterfaceNicType = "Standard" ) // PossibleInterfaceNicTypeValues returns an array of possible values for the InterfaceNicType const type. func PossibleInterfaceNicTypeValues() []InterfaceNicType { - return []InterfaceNicType{InterfaceNicTypeElastic, InterfaceNicTypeStandard} + return []InterfaceNicType{Elastic, Standard} } // IPAllocationMethod enumerates the values for ip allocation method. type IPAllocationMethod string const ( - // IPAllocationMethodDynamic ... - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - // IPAllocationMethodStatic ... - IPAllocationMethodStatic IPAllocationMethod = "Static" + // Dynamic ... + Dynamic IPAllocationMethod = "Dynamic" + // Static ... + Static IPAllocationMethod = "Static" ) // PossibleIPAllocationMethodValues returns an array of possible values for the IPAllocationMethod const type. func PossibleIPAllocationMethodValues() []IPAllocationMethod { - return []IPAllocationMethod{IPAllocationMethodDynamic, IPAllocationMethodStatic} + return []IPAllocationMethod{Dynamic, Static} } // IPAllocationType enumerates the values for ip allocation type. type IPAllocationType string const ( - // IPAllocationTypeHypernet ... - IPAllocationTypeHypernet IPAllocationType = "Hypernet" - // IPAllocationTypeUndefined ... - IPAllocationTypeUndefined IPAllocationType = "Undefined" + // Hypernet ... + Hypernet IPAllocationType = "Hypernet" + // Undefined ... + Undefined IPAllocationType = "Undefined" ) // PossibleIPAllocationTypeValues returns an array of possible values for the IPAllocationType const type. func PossibleIPAllocationTypeValues() []IPAllocationType { - return []IPAllocationType{IPAllocationTypeHypernet, IPAllocationTypeUndefined} + return []IPAllocationType{Hypernet, Undefined} } // IPFlowProtocol enumerates the values for ip flow protocol. @@ -1635,15 +1936,30 @@ func PossibleIpsecIntegrityValues() []IpsecIntegrity { type IPVersion string const ( - // IPVersionIPv4 ... - IPVersionIPv4 IPVersion = "IPv4" - // IPVersionIPv6 ... - IPVersionIPv6 IPVersion = "IPv6" + // IPv4 ... + IPv4 IPVersion = "IPv4" + // IPv6 ... + IPv6 IPVersion = "IPv6" ) // PossibleIPVersionValues returns an array of possible values for the IPVersion const type. func PossibleIPVersionValues() []IPVersion { - return []IPVersion{IPVersionIPv4, IPVersionIPv6} + return []IPVersion{IPv4, IPv6} +} + +// IsGlobal enumerates the values for is global. +type IsGlobal string + +const ( + // IsGlobalFalse ... + IsGlobalFalse IsGlobal = "False" + // IsGlobalTrue ... + IsGlobalTrue IsGlobal = "True" +) + +// PossibleIsGlobalValues returns an array of possible values for the IsGlobal const type. +func PossibleIsGlobalValues() []IsGlobal { + return []IsGlobal{IsGlobalFalse, IsGlobalTrue} } // IssueType enumerates the values for issue type. @@ -1675,6 +1991,73 @@ func PossibleIssueTypeValues() []IssueType { return []IssueType{IssueTypeAgentStopped, IssueTypeDNSResolution, IssueTypeGuestFirewall, IssueTypeNetworkSecurityRule, IssueTypePlatform, IssueTypePortThrottled, IssueTypeSocketBind, IssueTypeUnknown, IssueTypeUserDefinedRoute} } +// IsWorkloadProtected enumerates the values for is workload protected. +type IsWorkloadProtected string + +const ( + // IsWorkloadProtectedFalse ... + IsWorkloadProtectedFalse IsWorkloadProtected = "False" + // IsWorkloadProtectedTrue ... + IsWorkloadProtectedTrue IsWorkloadProtected = "True" +) + +// PossibleIsWorkloadProtectedValues returns an array of possible values for the IsWorkloadProtected const type. +func PossibleIsWorkloadProtectedValues() []IsWorkloadProtected { + return []IsWorkloadProtected{IsWorkloadProtectedFalse, IsWorkloadProtectedTrue} +} + +// Kind enumerates the values for kind. +type Kind string + +const ( + // KindActiveBaseSecurityAdminRule ... + KindActiveBaseSecurityAdminRule Kind = "ActiveBaseSecurityAdminRule" + // KindCustom ... + KindCustom Kind = "Custom" + // KindDefault ... + KindDefault Kind = "Default" +) + +// PossibleKindValues returns an array of possible values for the Kind const type. +func PossibleKindValues() []Kind { + return []Kind{KindActiveBaseSecurityAdminRule, KindCustom, KindDefault} +} + +// KindBasicBaseAdminRule enumerates the values for kind basic base admin rule. +type KindBasicBaseAdminRule string + +const ( + // KindBasicBaseAdminRuleKindBaseAdminRule ... + KindBasicBaseAdminRuleKindBaseAdminRule KindBasicBaseAdminRule = "BaseAdminRule" + // KindBasicBaseAdminRuleKindCustom ... + KindBasicBaseAdminRuleKindCustom KindBasicBaseAdminRule = "Custom" + // KindBasicBaseAdminRuleKindDefault ... + KindBasicBaseAdminRuleKindDefault KindBasicBaseAdminRule = "Default" +) + +// PossibleKindBasicBaseAdminRuleValues returns an array of possible values for the KindBasicBaseAdminRule const type. +func PossibleKindBasicBaseAdminRuleValues() []KindBasicBaseAdminRule { + return []KindBasicBaseAdminRule{KindBasicBaseAdminRuleKindBaseAdminRule, KindBasicBaseAdminRuleKindCustom, KindBasicBaseAdminRuleKindDefault} +} + +// KindBasicEffectiveBaseSecurityAdminRule enumerates the values for kind basic effective base security admin +// rule. +type KindBasicEffectiveBaseSecurityAdminRule string + +const ( + // KindBasicEffectiveBaseSecurityAdminRuleKindCustom ... + KindBasicEffectiveBaseSecurityAdminRuleKindCustom KindBasicEffectiveBaseSecurityAdminRule = "Custom" + // KindBasicEffectiveBaseSecurityAdminRuleKindDefault ... + KindBasicEffectiveBaseSecurityAdminRuleKindDefault KindBasicEffectiveBaseSecurityAdminRule = "Default" + // KindBasicEffectiveBaseSecurityAdminRuleKindEffectiveBaseSecurityAdminRule ... + KindBasicEffectiveBaseSecurityAdminRuleKindEffectiveBaseSecurityAdminRule KindBasicEffectiveBaseSecurityAdminRule = "EffectiveBaseSecurityAdminRule" +) + +// PossibleKindBasicEffectiveBaseSecurityAdminRuleValues returns an array of possible values for the KindBasicEffectiveBaseSecurityAdminRule const type. +func PossibleKindBasicEffectiveBaseSecurityAdminRuleValues() []KindBasicEffectiveBaseSecurityAdminRule { + return []KindBasicEffectiveBaseSecurityAdminRule{KindBasicEffectiveBaseSecurityAdminRuleKindCustom, KindBasicEffectiveBaseSecurityAdminRuleKindDefault, KindBasicEffectiveBaseSecurityAdminRuleKindEffectiveBaseSecurityAdminRule} +} + // LoadBalancerBackendAddressAdminState enumerates the values for load balancer backend address admin state. type LoadBalancerBackendAddressAdminState string @@ -1732,15 +2115,15 @@ func PossibleLoadBalancerSkuNameValues() []LoadBalancerSkuName { type LoadBalancerSkuTier string const ( - // LoadBalancerSkuTierGlobal ... - LoadBalancerSkuTierGlobal LoadBalancerSkuTier = "Global" - // LoadBalancerSkuTierRegional ... - LoadBalancerSkuTierRegional LoadBalancerSkuTier = "Regional" + // Global ... + Global LoadBalancerSkuTier = "Global" + // Regional ... + Regional LoadBalancerSkuTier = "Regional" ) // PossibleLoadBalancerSkuTierValues returns an array of possible values for the LoadBalancerSkuTier const type. func PossibleLoadBalancerSkuTierValues() []LoadBalancerSkuTier { - return []LoadBalancerSkuTier{LoadBalancerSkuTierGlobal, LoadBalancerSkuTierRegional} + return []LoadBalancerSkuTier{Global, Regional} } // LoadDistribution enumerates the values for load distribution. @@ -1766,11 +2149,13 @@ type ManagedRuleEnabledState string const ( // ManagedRuleEnabledStateDisabled ... ManagedRuleEnabledStateDisabled ManagedRuleEnabledState = "Disabled" + // ManagedRuleEnabledStateEnabled ... + ManagedRuleEnabledStateEnabled ManagedRuleEnabledState = "Enabled" ) // PossibleManagedRuleEnabledStateValues returns an array of possible values for the ManagedRuleEnabledState const type. func PossibleManagedRuleEnabledStateValues() []ManagedRuleEnabledState { - return []ManagedRuleEnabledState{ManagedRuleEnabledStateDisabled} + return []ManagedRuleEnabledState{ManagedRuleEnabledStateDisabled, ManagedRuleEnabledStateEnabled} } // NatGatewaySkuName enumerates the values for nat gateway sku name. @@ -1809,6 +2194,23 @@ func PossibleNextHopTypeValues() []NextHopType { return []NextHopType{NextHopTypeHyperNetGateway, NextHopTypeInternet, NextHopTypeNone, NextHopTypeVirtualAppliance, NextHopTypeVirtualNetworkGateway, NextHopTypeVnetLocal} } +// NextStep enumerates the values for next step. +type NextStep string + +const ( + // NextStepContinue ... + NextStepContinue NextStep = "Continue" + // NextStepTerminate ... + NextStepTerminate NextStep = "Terminate" + // NextStepUnknown ... + NextStepUnknown NextStep = "Unknown" +) + +// PossibleNextStepValues returns an array of possible values for the NextStep const type. +func PossibleNextStepValues() []NextStep { + return []NextStep{NextStepContinue, NextStepTerminate, NextStepUnknown} +} + // OfficeTrafficCategory enumerates the values for office traffic category. type OfficeTrafficCategory string @@ -1866,42 +2268,42 @@ func PossibleOriginValues() []Origin { type OutputType string const ( - // OutputTypeWorkspace ... - OutputTypeWorkspace OutputType = "Workspace" + // Workspace ... + Workspace OutputType = "Workspace" ) // PossibleOutputTypeValues returns an array of possible values for the OutputType const type. func PossibleOutputTypeValues() []OutputType { - return []OutputType{OutputTypeWorkspace} + return []OutputType{Workspace} } // OwaspCrsExclusionEntryMatchVariable enumerates the values for owasp crs exclusion entry match variable. type OwaspCrsExclusionEntryMatchVariable string const ( - // OwaspCrsExclusionEntryMatchVariableRequestArgKeys ... - OwaspCrsExclusionEntryMatchVariableRequestArgKeys OwaspCrsExclusionEntryMatchVariable = "RequestArgKeys" - // OwaspCrsExclusionEntryMatchVariableRequestArgNames ... - OwaspCrsExclusionEntryMatchVariableRequestArgNames OwaspCrsExclusionEntryMatchVariable = "RequestArgNames" - // OwaspCrsExclusionEntryMatchVariableRequestArgValues ... - OwaspCrsExclusionEntryMatchVariableRequestArgValues OwaspCrsExclusionEntryMatchVariable = "RequestArgValues" - // OwaspCrsExclusionEntryMatchVariableRequestCookieKeys ... - OwaspCrsExclusionEntryMatchVariableRequestCookieKeys OwaspCrsExclusionEntryMatchVariable = "RequestCookieKeys" - // OwaspCrsExclusionEntryMatchVariableRequestCookieNames ... - OwaspCrsExclusionEntryMatchVariableRequestCookieNames OwaspCrsExclusionEntryMatchVariable = "RequestCookieNames" - // OwaspCrsExclusionEntryMatchVariableRequestCookieValues ... - OwaspCrsExclusionEntryMatchVariableRequestCookieValues OwaspCrsExclusionEntryMatchVariable = "RequestCookieValues" - // OwaspCrsExclusionEntryMatchVariableRequestHeaderKeys ... - OwaspCrsExclusionEntryMatchVariableRequestHeaderKeys OwaspCrsExclusionEntryMatchVariable = "RequestHeaderKeys" - // OwaspCrsExclusionEntryMatchVariableRequestHeaderNames ... - OwaspCrsExclusionEntryMatchVariableRequestHeaderNames OwaspCrsExclusionEntryMatchVariable = "RequestHeaderNames" - // OwaspCrsExclusionEntryMatchVariableRequestHeaderValues ... - OwaspCrsExclusionEntryMatchVariableRequestHeaderValues OwaspCrsExclusionEntryMatchVariable = "RequestHeaderValues" + // RequestArgKeys ... + RequestArgKeys OwaspCrsExclusionEntryMatchVariable = "RequestArgKeys" + // RequestArgNames ... + RequestArgNames OwaspCrsExclusionEntryMatchVariable = "RequestArgNames" + // RequestArgValues ... + RequestArgValues OwaspCrsExclusionEntryMatchVariable = "RequestArgValues" + // RequestCookieKeys ... + RequestCookieKeys OwaspCrsExclusionEntryMatchVariable = "RequestCookieKeys" + // RequestCookieNames ... + RequestCookieNames OwaspCrsExclusionEntryMatchVariable = "RequestCookieNames" + // RequestCookieValues ... + RequestCookieValues OwaspCrsExclusionEntryMatchVariable = "RequestCookieValues" + // RequestHeaderKeys ... + RequestHeaderKeys OwaspCrsExclusionEntryMatchVariable = "RequestHeaderKeys" + // RequestHeaderNames ... + RequestHeaderNames OwaspCrsExclusionEntryMatchVariable = "RequestHeaderNames" + // RequestHeaderValues ... + RequestHeaderValues OwaspCrsExclusionEntryMatchVariable = "RequestHeaderValues" ) // PossibleOwaspCrsExclusionEntryMatchVariableValues returns an array of possible values for the OwaspCrsExclusionEntryMatchVariable const type. func PossibleOwaspCrsExclusionEntryMatchVariableValues() []OwaspCrsExclusionEntryMatchVariable { - return []OwaspCrsExclusionEntryMatchVariable{OwaspCrsExclusionEntryMatchVariableRequestArgKeys, OwaspCrsExclusionEntryMatchVariableRequestArgNames, OwaspCrsExclusionEntryMatchVariableRequestArgValues, OwaspCrsExclusionEntryMatchVariableRequestCookieKeys, OwaspCrsExclusionEntryMatchVariableRequestCookieNames, OwaspCrsExclusionEntryMatchVariableRequestCookieValues, OwaspCrsExclusionEntryMatchVariableRequestHeaderKeys, OwaspCrsExclusionEntryMatchVariableRequestHeaderNames, OwaspCrsExclusionEntryMatchVariableRequestHeaderValues} + return []OwaspCrsExclusionEntryMatchVariable{RequestArgKeys, RequestArgNames, RequestArgValues, RequestCookieKeys, RequestCookieNames, RequestCookieValues, RequestHeaderKeys, RequestHeaderNames, RequestHeaderValues} } // OwaspCrsExclusionEntrySelectorMatchOperator enumerates the values for owasp crs exclusion entry selector @@ -1926,25 +2328,40 @@ func PossibleOwaspCrsExclusionEntrySelectorMatchOperatorValues() []OwaspCrsExclu return []OwaspCrsExclusionEntrySelectorMatchOperator{OwaspCrsExclusionEntrySelectorMatchOperatorContains, OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith, OwaspCrsExclusionEntrySelectorMatchOperatorEquals, OwaspCrsExclusionEntrySelectorMatchOperatorEqualsAny, OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith} } +// PacketCaptureTargetType enumerates the values for packet capture target type. +type PacketCaptureTargetType string + +const ( + // PacketCaptureTargetTypeAzureVM ... + PacketCaptureTargetTypeAzureVM PacketCaptureTargetType = "AzureVM" + // PacketCaptureTargetTypeAzureVMSS ... + PacketCaptureTargetTypeAzureVMSS PacketCaptureTargetType = "AzureVMSS" +) + +// PossiblePacketCaptureTargetTypeValues returns an array of possible values for the PacketCaptureTargetType const type. +func PossiblePacketCaptureTargetTypeValues() []PacketCaptureTargetType { + return []PacketCaptureTargetType{PacketCaptureTargetTypeAzureVM, PacketCaptureTargetTypeAzureVMSS} +} + // PcError enumerates the values for pc error. type PcError string const ( - // PcErrorAgentStopped ... - PcErrorAgentStopped PcError = "AgentStopped" - // PcErrorCaptureFailed ... - PcErrorCaptureFailed PcError = "CaptureFailed" - // PcErrorInternalError ... - PcErrorInternalError PcError = "InternalError" - // PcErrorLocalFileFailed ... - PcErrorLocalFileFailed PcError = "LocalFileFailed" - // PcErrorStorageFailed ... - PcErrorStorageFailed PcError = "StorageFailed" + // AgentStopped ... + AgentStopped PcError = "AgentStopped" + // CaptureFailed ... + CaptureFailed PcError = "CaptureFailed" + // InternalError ... + InternalError PcError = "InternalError" + // LocalFileFailed ... + LocalFileFailed PcError = "LocalFileFailed" + // StorageFailed ... + StorageFailed PcError = "StorageFailed" ) // PossiblePcErrorValues returns an array of possible values for the PcError const type. func PossiblePcErrorValues() []PcError { - return []PcError{PcErrorAgentStopped, PcErrorCaptureFailed, PcErrorInternalError, PcErrorLocalFileFailed, PcErrorStorageFailed} + return []PcError{AgentStopped, CaptureFailed, InternalError, LocalFileFailed, StorageFailed} } // PcProtocol enumerates the values for pc protocol. @@ -2067,15 +2484,15 @@ func PossibleProbeProtocolValues() []ProbeProtocol { type ProcessorArchitecture string const ( - // ProcessorArchitectureAmd64 ... - ProcessorArchitectureAmd64 ProcessorArchitecture = "Amd64" - // ProcessorArchitectureX86 ... - ProcessorArchitectureX86 ProcessorArchitecture = "X86" + // Amd64 ... + Amd64 ProcessorArchitecture = "Amd64" + // X86 ... + X86 ProcessorArchitecture = "X86" ) // PossibleProcessorArchitectureValues returns an array of possible values for the ProcessorArchitecture const type. func PossibleProcessorArchitectureValues() []ProcessorArchitecture { - return []ProcessorArchitecture{ProcessorArchitectureAmd64, ProcessorArchitectureX86} + return []ProcessorArchitecture{Amd64, X86} } // Protocol enumerates the values for protocol. @@ -2243,6 +2660,48 @@ func PossibleResourceIdentityTypeValues() []ResourceIdentityType { return []ResourceIdentityType{ResourceIdentityTypeNone, ResourceIdentityTypeSystemAssigned, ResourceIdentityTypeSystemAssignedUserAssigned, ResourceIdentityTypeUserAssigned} } +// RouteMapActionType enumerates the values for route map action type. +type RouteMapActionType string + +const ( + // RouteMapActionTypeAdd ... + RouteMapActionTypeAdd RouteMapActionType = "Add" + // RouteMapActionTypeDrop ... + RouteMapActionTypeDrop RouteMapActionType = "Drop" + // RouteMapActionTypeRemove ... + RouteMapActionTypeRemove RouteMapActionType = "Remove" + // RouteMapActionTypeReplace ... + RouteMapActionTypeReplace RouteMapActionType = "Replace" + // RouteMapActionTypeUnknown ... + RouteMapActionTypeUnknown RouteMapActionType = "Unknown" +) + +// PossibleRouteMapActionTypeValues returns an array of possible values for the RouteMapActionType const type. +func PossibleRouteMapActionTypeValues() []RouteMapActionType { + return []RouteMapActionType{RouteMapActionTypeAdd, RouteMapActionTypeDrop, RouteMapActionTypeRemove, RouteMapActionTypeReplace, RouteMapActionTypeUnknown} +} + +// RouteMapMatchCondition enumerates the values for route map match condition. +type RouteMapMatchCondition string + +const ( + // RouteMapMatchConditionContains ... + RouteMapMatchConditionContains RouteMapMatchCondition = "Contains" + // RouteMapMatchConditionEquals ... + RouteMapMatchConditionEquals RouteMapMatchCondition = "Equals" + // RouteMapMatchConditionNotContains ... + RouteMapMatchConditionNotContains RouteMapMatchCondition = "NotContains" + // RouteMapMatchConditionNotEquals ... + RouteMapMatchConditionNotEquals RouteMapMatchCondition = "NotEquals" + // RouteMapMatchConditionUnknown ... + RouteMapMatchConditionUnknown RouteMapMatchCondition = "Unknown" +) + +// PossibleRouteMapMatchConditionValues returns an array of possible values for the RouteMapMatchCondition const type. +func PossibleRouteMapMatchConditionValues() []RouteMapMatchCondition { + return []RouteMapMatchCondition{RouteMapMatchConditionContains, RouteMapMatchConditionEquals, RouteMapMatchConditionNotContains, RouteMapMatchConditionNotEquals, RouteMapMatchConditionUnknown} +} + // RouteNextHopType enumerates the values for route next hop type. type RouteNextHopType string @@ -2319,6 +2778,82 @@ func PossibleRuleTypeValues() []RuleType { return []RuleType{RuleTypeApplicationRule, RuleTypeFirewallPolicyRule, RuleTypeNatRule, RuleTypeNetworkRule} } +// ScopeConnectionState enumerates the values for scope connection state. +type ScopeConnectionState string + +const ( + // ScopeConnectionStateConflict ... + ScopeConnectionStateConflict ScopeConnectionState = "Conflict" + // ScopeConnectionStateConnected ... + ScopeConnectionStateConnected ScopeConnectionState = "Connected" + // ScopeConnectionStatePending ... + ScopeConnectionStatePending ScopeConnectionState = "Pending" + // ScopeConnectionStateRejected ... + ScopeConnectionStateRejected ScopeConnectionState = "Rejected" + // ScopeConnectionStateRevoked ... + ScopeConnectionStateRevoked ScopeConnectionState = "Revoked" +) + +// PossibleScopeConnectionStateValues returns an array of possible values for the ScopeConnectionState const type. +func PossibleScopeConnectionStateValues() []ScopeConnectionState { + return []ScopeConnectionState{ScopeConnectionStateConflict, ScopeConnectionStateConnected, ScopeConnectionStatePending, ScopeConnectionStateRejected, ScopeConnectionStateRevoked} +} + +// SecurityConfigurationRuleAccess enumerates the values for security configuration rule access. +type SecurityConfigurationRuleAccess string + +const ( + // SecurityConfigurationRuleAccessAllow ... + SecurityConfigurationRuleAccessAllow SecurityConfigurationRuleAccess = "Allow" + // SecurityConfigurationRuleAccessAlwaysAllow ... + SecurityConfigurationRuleAccessAlwaysAllow SecurityConfigurationRuleAccess = "AlwaysAllow" + // SecurityConfigurationRuleAccessDeny ... + SecurityConfigurationRuleAccessDeny SecurityConfigurationRuleAccess = "Deny" +) + +// PossibleSecurityConfigurationRuleAccessValues returns an array of possible values for the SecurityConfigurationRuleAccess const type. +func PossibleSecurityConfigurationRuleAccessValues() []SecurityConfigurationRuleAccess { + return []SecurityConfigurationRuleAccess{SecurityConfigurationRuleAccessAllow, SecurityConfigurationRuleAccessAlwaysAllow, SecurityConfigurationRuleAccessDeny} +} + +// SecurityConfigurationRuleDirection enumerates the values for security configuration rule direction. +type SecurityConfigurationRuleDirection string + +const ( + // SecurityConfigurationRuleDirectionInbound ... + SecurityConfigurationRuleDirectionInbound SecurityConfigurationRuleDirection = "Inbound" + // SecurityConfigurationRuleDirectionOutbound ... + SecurityConfigurationRuleDirectionOutbound SecurityConfigurationRuleDirection = "Outbound" +) + +// PossibleSecurityConfigurationRuleDirectionValues returns an array of possible values for the SecurityConfigurationRuleDirection const type. +func PossibleSecurityConfigurationRuleDirectionValues() []SecurityConfigurationRuleDirection { + return []SecurityConfigurationRuleDirection{SecurityConfigurationRuleDirectionInbound, SecurityConfigurationRuleDirectionOutbound} +} + +// SecurityConfigurationRuleProtocol enumerates the values for security configuration rule protocol. +type SecurityConfigurationRuleProtocol string + +const ( + // SecurityConfigurationRuleProtocolAh ... + SecurityConfigurationRuleProtocolAh SecurityConfigurationRuleProtocol = "Ah" + // SecurityConfigurationRuleProtocolAny ... + SecurityConfigurationRuleProtocolAny SecurityConfigurationRuleProtocol = "Any" + // SecurityConfigurationRuleProtocolEsp ... + SecurityConfigurationRuleProtocolEsp SecurityConfigurationRuleProtocol = "Esp" + // SecurityConfigurationRuleProtocolIcmp ... + SecurityConfigurationRuleProtocolIcmp SecurityConfigurationRuleProtocol = "Icmp" + // SecurityConfigurationRuleProtocolTCP ... + SecurityConfigurationRuleProtocolTCP SecurityConfigurationRuleProtocol = "Tcp" + // SecurityConfigurationRuleProtocolUDP ... + SecurityConfigurationRuleProtocolUDP SecurityConfigurationRuleProtocol = "Udp" +) + +// PossibleSecurityConfigurationRuleProtocolValues returns an array of possible values for the SecurityConfigurationRuleProtocol const type. +func PossibleSecurityConfigurationRuleProtocolValues() []SecurityConfigurationRuleProtocol { + return []SecurityConfigurationRuleProtocol{SecurityConfigurationRuleProtocolAh, SecurityConfigurationRuleProtocolAny, SecurityConfigurationRuleProtocolEsp, SecurityConfigurationRuleProtocolIcmp, SecurityConfigurationRuleProtocolTCP, SecurityConfigurationRuleProtocolUDP} +} + // SecurityPartnerProviderConnectionStatus enumerates the values for security partner provider connection // status. type SecurityPartnerProviderConnectionStatus string @@ -2343,17 +2878,17 @@ func PossibleSecurityPartnerProviderConnectionStatusValues() []SecurityPartnerPr type SecurityProviderName string const ( - // SecurityProviderNameCheckpoint ... - SecurityProviderNameCheckpoint SecurityProviderName = "Checkpoint" - // SecurityProviderNameIBoss ... - SecurityProviderNameIBoss SecurityProviderName = "IBoss" - // SecurityProviderNameZScaler ... - SecurityProviderNameZScaler SecurityProviderName = "ZScaler" + // Checkpoint ... + Checkpoint SecurityProviderName = "Checkpoint" + // IBoss ... + IBoss SecurityProviderName = "IBoss" + // ZScaler ... + ZScaler SecurityProviderName = "ZScaler" ) // PossibleSecurityProviderNameValues returns an array of possible values for the SecurityProviderName const type. func PossibleSecurityProviderNameValues() []SecurityProviderName { - return []SecurityProviderName{SecurityProviderNameCheckpoint, SecurityProviderNameIBoss, SecurityProviderNameZScaler} + return []SecurityProviderName{Checkpoint, IBoss, ZScaler} } // SecurityRuleAccess enumerates the values for security rule access. @@ -2443,6 +2978,21 @@ func PossibleSeverityValues() []Severity { return []Severity{SeverityError, SeverityWarning} } +// SlotType enumerates the values for slot type. +type SlotType string + +const ( + // Production ... + Production SlotType = "Production" + // Staging ... + Staging SlotType = "Staging" +) + +// PossibleSlotTypeValues returns an array of possible values for the SlotType const type. +func PossibleSlotTypeValues() []SlotType { + return []SlotType{Production, Staging} +} + // SyncRemoteAddressSpace enumerates the values for sync remote address space. type SyncRemoteAddressSpace string @@ -2492,6 +3042,21 @@ func PossibleTunnelConnectionStatusValues() []TunnelConnectionStatus { return []TunnelConnectionStatus{TunnelConnectionStatusConnected, TunnelConnectionStatusConnecting, TunnelConnectionStatusNotConnected, TunnelConnectionStatusUnknown} } +// UseHubGateway enumerates the values for use hub gateway. +type UseHubGateway string + +const ( + // UseHubGatewayFalse ... + UseHubGatewayFalse UseHubGateway = "False" + // UseHubGatewayTrue ... + UseHubGatewayTrue UseHubGateway = "True" +) + +// PossibleUseHubGatewayValues returns an array of possible values for the UseHubGateway const type. +func PossibleUseHubGatewayValues() []UseHubGateway { + return []UseHubGateway{UseHubGatewayFalse, UseHubGatewayTrue} +} + // VerbosityLevel enumerates the values for verbosity level. type VerbosityLevel string @@ -2513,15 +3078,15 @@ func PossibleVerbosityLevelValues() []VerbosityLevel { type VirtualNetworkEncryptionEnforcement string const ( - // VirtualNetworkEncryptionEnforcementAllowUnencrypted ... - VirtualNetworkEncryptionEnforcementAllowUnencrypted VirtualNetworkEncryptionEnforcement = "AllowUnencrypted" - // VirtualNetworkEncryptionEnforcementDropUnencrypted ... - VirtualNetworkEncryptionEnforcementDropUnencrypted VirtualNetworkEncryptionEnforcement = "DropUnencrypted" + // AllowUnencrypted ... + AllowUnencrypted VirtualNetworkEncryptionEnforcement = "AllowUnencrypted" + // DropUnencrypted ... + DropUnencrypted VirtualNetworkEncryptionEnforcement = "DropUnencrypted" ) // PossibleVirtualNetworkEncryptionEnforcementValues returns an array of possible values for the VirtualNetworkEncryptionEnforcement const type. func PossibleVirtualNetworkEncryptionEnforcementValues() []VirtualNetworkEncryptionEnforcement { - return []VirtualNetworkEncryptionEnforcement{VirtualNetworkEncryptionEnforcementAllowUnencrypted, VirtualNetworkEncryptionEnforcementDropUnencrypted} + return []VirtualNetworkEncryptionEnforcement{AllowUnencrypted, DropUnencrypted} } // VirtualNetworkGatewayConnectionMode enumerates the values for virtual network gateway connection mode. @@ -2546,15 +3111,15 @@ func PossibleVirtualNetworkGatewayConnectionModeValues() []VirtualNetworkGateway type VirtualNetworkGatewayConnectionProtocol string const ( - // VirtualNetworkGatewayConnectionProtocolIKEv1 ... - VirtualNetworkGatewayConnectionProtocolIKEv1 VirtualNetworkGatewayConnectionProtocol = "IKEv1" - // VirtualNetworkGatewayConnectionProtocolIKEv2 ... - VirtualNetworkGatewayConnectionProtocolIKEv2 VirtualNetworkGatewayConnectionProtocol = "IKEv2" + // IKEv1 ... + IKEv1 VirtualNetworkGatewayConnectionProtocol = "IKEv1" + // IKEv2 ... + IKEv2 VirtualNetworkGatewayConnectionProtocol = "IKEv2" ) // PossibleVirtualNetworkGatewayConnectionProtocolValues returns an array of possible values for the VirtualNetworkGatewayConnectionProtocol const type. func PossibleVirtualNetworkGatewayConnectionProtocolValues() []VirtualNetworkGatewayConnectionProtocol { - return []VirtualNetworkGatewayConnectionProtocol{VirtualNetworkGatewayConnectionProtocolIKEv1, VirtualNetworkGatewayConnectionProtocolIKEv2} + return []VirtualNetworkGatewayConnectionProtocol{IKEv1, IKEv2} } // VirtualNetworkGatewayConnectionStatus enumerates the values for virtual network gateway connection status. @@ -2580,19 +3145,19 @@ func PossibleVirtualNetworkGatewayConnectionStatusValues() []VirtualNetworkGatew type VirtualNetworkGatewayConnectionType string const ( - // VirtualNetworkGatewayConnectionTypeExpressRoute ... - VirtualNetworkGatewayConnectionTypeExpressRoute VirtualNetworkGatewayConnectionType = "ExpressRoute" - // VirtualNetworkGatewayConnectionTypeIPsec ... - VirtualNetworkGatewayConnectionTypeIPsec VirtualNetworkGatewayConnectionType = "IPsec" - // VirtualNetworkGatewayConnectionTypeVnet2Vnet ... - VirtualNetworkGatewayConnectionTypeVnet2Vnet VirtualNetworkGatewayConnectionType = "Vnet2Vnet" - // VirtualNetworkGatewayConnectionTypeVPNClient ... - VirtualNetworkGatewayConnectionTypeVPNClient VirtualNetworkGatewayConnectionType = "VPNClient" + // ExpressRoute ... + ExpressRoute VirtualNetworkGatewayConnectionType = "ExpressRoute" + // IPsec ... + IPsec VirtualNetworkGatewayConnectionType = "IPsec" + // Vnet2Vnet ... + Vnet2Vnet VirtualNetworkGatewayConnectionType = "Vnet2Vnet" + // VPNClient ... + VPNClient VirtualNetworkGatewayConnectionType = "VPNClient" ) // PossibleVirtualNetworkGatewayConnectionTypeValues returns an array of possible values for the VirtualNetworkGatewayConnectionType const type. func PossibleVirtualNetworkGatewayConnectionTypeValues() []VirtualNetworkGatewayConnectionType { - return []VirtualNetworkGatewayConnectionType{VirtualNetworkGatewayConnectionTypeExpressRoute, VirtualNetworkGatewayConnectionTypeIPsec, VirtualNetworkGatewayConnectionTypeVnet2Vnet, VirtualNetworkGatewayConnectionTypeVPNClient} + return []VirtualNetworkGatewayConnectionType{ExpressRoute, IPsec, Vnet2Vnet, VPNClient} } // VirtualNetworkGatewaySkuName enumerates the values for virtual network gateway sku name. @@ -2706,19 +3271,19 @@ func PossibleVirtualNetworkGatewayTypeValues() []VirtualNetworkGatewayType { type VirtualNetworkPeeringLevel string const ( - // VirtualNetworkPeeringLevelFullyInSync ... - VirtualNetworkPeeringLevelFullyInSync VirtualNetworkPeeringLevel = "FullyInSync" - // VirtualNetworkPeeringLevelLocalAndRemoteNotInSync ... - VirtualNetworkPeeringLevelLocalAndRemoteNotInSync VirtualNetworkPeeringLevel = "LocalAndRemoteNotInSync" - // VirtualNetworkPeeringLevelLocalNotInSync ... - VirtualNetworkPeeringLevelLocalNotInSync VirtualNetworkPeeringLevel = "LocalNotInSync" - // VirtualNetworkPeeringLevelRemoteNotInSync ... - VirtualNetworkPeeringLevelRemoteNotInSync VirtualNetworkPeeringLevel = "RemoteNotInSync" + // FullyInSync ... + FullyInSync VirtualNetworkPeeringLevel = "FullyInSync" + // LocalAndRemoteNotInSync ... + LocalAndRemoteNotInSync VirtualNetworkPeeringLevel = "LocalAndRemoteNotInSync" + // LocalNotInSync ... + LocalNotInSync VirtualNetworkPeeringLevel = "LocalNotInSync" + // RemoteNotInSync ... + RemoteNotInSync VirtualNetworkPeeringLevel = "RemoteNotInSync" ) // PossibleVirtualNetworkPeeringLevelValues returns an array of possible values for the VirtualNetworkPeeringLevel const type. func PossibleVirtualNetworkPeeringLevelValues() []VirtualNetworkPeeringLevel { - return []VirtualNetworkPeeringLevel{VirtualNetworkPeeringLevelFullyInSync, VirtualNetworkPeeringLevelLocalAndRemoteNotInSync, VirtualNetworkPeeringLevelLocalNotInSync, VirtualNetworkPeeringLevelRemoteNotInSync} + return []VirtualNetworkPeeringLevel{FullyInSync, LocalAndRemoteNotInSync, LocalNotInSync, RemoteNotInSync} } // VirtualNetworkPeeringState enumerates the values for virtual network peering state. @@ -2774,49 +3339,64 @@ func PossibleVirtualNetworkPrivateLinkServiceNetworkPoliciesValues() []VirtualNe type VirtualWanSecurityProviderType string const ( - // VirtualWanSecurityProviderTypeExternal ... - VirtualWanSecurityProviderTypeExternal VirtualWanSecurityProviderType = "External" - // VirtualWanSecurityProviderTypeNative ... - VirtualWanSecurityProviderTypeNative VirtualWanSecurityProviderType = "Native" + // External ... + External VirtualWanSecurityProviderType = "External" + // Native ... + Native VirtualWanSecurityProviderType = "Native" ) // PossibleVirtualWanSecurityProviderTypeValues returns an array of possible values for the VirtualWanSecurityProviderType const type. func PossibleVirtualWanSecurityProviderTypeValues() []VirtualWanSecurityProviderType { - return []VirtualWanSecurityProviderType{VirtualWanSecurityProviderTypeExternal, VirtualWanSecurityProviderTypeNative} + return []VirtualWanSecurityProviderType{External, Native} +} + +// VnetLocalRouteOverrideCriteria enumerates the values for vnet local route override criteria. +type VnetLocalRouteOverrideCriteria string + +const ( + // VnetLocalRouteOverrideCriteriaContains ... + VnetLocalRouteOverrideCriteriaContains VnetLocalRouteOverrideCriteria = "Contains" + // VnetLocalRouteOverrideCriteriaEqual ... + VnetLocalRouteOverrideCriteriaEqual VnetLocalRouteOverrideCriteria = "Equal" +) + +// PossibleVnetLocalRouteOverrideCriteriaValues returns an array of possible values for the VnetLocalRouteOverrideCriteria const type. +func PossibleVnetLocalRouteOverrideCriteriaValues() []VnetLocalRouteOverrideCriteria { + return []VnetLocalRouteOverrideCriteria{VnetLocalRouteOverrideCriteriaContains, VnetLocalRouteOverrideCriteriaEqual} } // VpnAuthenticationType enumerates the values for vpn authentication type. type VpnAuthenticationType string const ( - // VpnAuthenticationTypeAAD ... - VpnAuthenticationTypeAAD VpnAuthenticationType = "AAD" - // VpnAuthenticationTypeCertificate ... - VpnAuthenticationTypeCertificate VpnAuthenticationType = "Certificate" - // VpnAuthenticationTypeRadius ... - VpnAuthenticationTypeRadius VpnAuthenticationType = "Radius" + // AAD ... + AAD VpnAuthenticationType = "AAD" + // Certificate ... + Certificate VpnAuthenticationType = "Certificate" + // Radius ... + Radius VpnAuthenticationType = "Radius" ) // PossibleVpnAuthenticationTypeValues returns an array of possible values for the VpnAuthenticationType const type. func PossibleVpnAuthenticationTypeValues() []VpnAuthenticationType { - return []VpnAuthenticationType{VpnAuthenticationTypeAAD, VpnAuthenticationTypeCertificate, VpnAuthenticationTypeRadius} + return []VpnAuthenticationType{AAD, Certificate, Radius} } // VpnClientProtocol enumerates the values for vpn client protocol. type VpnClientProtocol string const ( - // VpnClientProtocolIkeV2 ... - VpnClientProtocolIkeV2 VpnClientProtocol = "IkeV2" - // VpnClientProtocolOpenVPN ... - VpnClientProtocolOpenVPN VpnClientProtocol = "OpenVPN" - // VpnClientProtocolSSTP ... - VpnClientProtocolSSTP VpnClientProtocol = "SSTP" + // IkeV2 ... + IkeV2 VpnClientProtocol = "IkeV2" + // OpenVPN ... + OpenVPN VpnClientProtocol = "OpenVPN" + // SSTP ... + SSTP VpnClientProtocol = "SSTP" ) // PossibleVpnClientProtocolValues returns an array of possible values for the VpnClientProtocol const type. func PossibleVpnClientProtocolValues() []VpnClientProtocol { - return []VpnClientProtocol{VpnClientProtocolIkeV2, VpnClientProtocolOpenVPN, VpnClientProtocolSSTP} + return []VpnClientProtocol{IkeV2, OpenVPN, SSTP} } // VpnConnectionStatus enumerates the values for vpn connection status. @@ -2891,15 +3471,15 @@ func PossibleVpnLinkConnectionModeValues() []VpnLinkConnectionMode { type VpnNatRuleMode string const ( - // VpnNatRuleModeEgressSnat ... - VpnNatRuleModeEgressSnat VpnNatRuleMode = "EgressSnat" - // VpnNatRuleModeIngressSnat ... - VpnNatRuleModeIngressSnat VpnNatRuleMode = "IngressSnat" + // EgressSnat ... + EgressSnat VpnNatRuleMode = "EgressSnat" + // IngressSnat ... + IngressSnat VpnNatRuleMode = "IngressSnat" ) // PossibleVpnNatRuleModeValues returns an array of possible values for the VpnNatRuleMode const type. func PossibleVpnNatRuleModeValues() []VpnNatRuleMode { - return []VpnNatRuleMode{VpnNatRuleModeEgressSnat, VpnNatRuleModeIngressSnat} + return []VpnNatRuleMode{EgressSnat, IngressSnat} } // VpnNatRuleType enumerates the values for vpn nat rule type. @@ -2921,32 +3501,32 @@ func PossibleVpnNatRuleTypeValues() []VpnNatRuleType { type VpnPolicyMemberAttributeType string const ( - // VpnPolicyMemberAttributeTypeAADGroupID ... - VpnPolicyMemberAttributeTypeAADGroupID VpnPolicyMemberAttributeType = "AADGroupId" - // VpnPolicyMemberAttributeTypeCertificateGroupID ... - VpnPolicyMemberAttributeTypeCertificateGroupID VpnPolicyMemberAttributeType = "CertificateGroupId" - // VpnPolicyMemberAttributeTypeRadiusAzureGroupID ... - VpnPolicyMemberAttributeTypeRadiusAzureGroupID VpnPolicyMemberAttributeType = "RadiusAzureGroupId" + // AADGroupID ... + AADGroupID VpnPolicyMemberAttributeType = "AADGroupId" + // CertificateGroupID ... + CertificateGroupID VpnPolicyMemberAttributeType = "CertificateGroupId" + // RadiusAzureGroupID ... + RadiusAzureGroupID VpnPolicyMemberAttributeType = "RadiusAzureGroupId" ) // PossibleVpnPolicyMemberAttributeTypeValues returns an array of possible values for the VpnPolicyMemberAttributeType const type. func PossibleVpnPolicyMemberAttributeTypeValues() []VpnPolicyMemberAttributeType { - return []VpnPolicyMemberAttributeType{VpnPolicyMemberAttributeTypeAADGroupID, VpnPolicyMemberAttributeTypeCertificateGroupID, VpnPolicyMemberAttributeTypeRadiusAzureGroupID} + return []VpnPolicyMemberAttributeType{AADGroupID, CertificateGroupID, RadiusAzureGroupID} } // VpnType enumerates the values for vpn type. type VpnType string const ( - // VpnTypePolicyBased ... - VpnTypePolicyBased VpnType = "PolicyBased" - // VpnTypeRouteBased ... - VpnTypeRouteBased VpnType = "RouteBased" + // PolicyBased ... + PolicyBased VpnType = "PolicyBased" + // RouteBased ... + RouteBased VpnType = "RouteBased" ) // PossibleVpnTypeValues returns an array of possible values for the VpnType const type. func PossibleVpnTypeValues() []VpnType { - return []VpnType{VpnTypePolicyBased, VpnTypeRouteBased} + return []VpnType{PolicyBased, RouteBased} } // WebApplicationFirewallAction enumerates the values for web application firewall action. @@ -2985,27 +3565,27 @@ func PossibleWebApplicationFirewallEnabledStateValues() []WebApplicationFirewall type WebApplicationFirewallMatchVariable string const ( - // WebApplicationFirewallMatchVariablePostArgs ... - WebApplicationFirewallMatchVariablePostArgs WebApplicationFirewallMatchVariable = "PostArgs" - // WebApplicationFirewallMatchVariableQueryString ... - WebApplicationFirewallMatchVariableQueryString WebApplicationFirewallMatchVariable = "QueryString" - // WebApplicationFirewallMatchVariableRemoteAddr ... - WebApplicationFirewallMatchVariableRemoteAddr WebApplicationFirewallMatchVariable = "RemoteAddr" - // WebApplicationFirewallMatchVariableRequestBody ... - WebApplicationFirewallMatchVariableRequestBody WebApplicationFirewallMatchVariable = "RequestBody" - // WebApplicationFirewallMatchVariableRequestCookies ... - WebApplicationFirewallMatchVariableRequestCookies WebApplicationFirewallMatchVariable = "RequestCookies" - // WebApplicationFirewallMatchVariableRequestHeaders ... - WebApplicationFirewallMatchVariableRequestHeaders WebApplicationFirewallMatchVariable = "RequestHeaders" - // WebApplicationFirewallMatchVariableRequestMethod ... - WebApplicationFirewallMatchVariableRequestMethod WebApplicationFirewallMatchVariable = "RequestMethod" - // WebApplicationFirewallMatchVariableRequestURI ... - WebApplicationFirewallMatchVariableRequestURI WebApplicationFirewallMatchVariable = "RequestUri" + // PostArgs ... + PostArgs WebApplicationFirewallMatchVariable = "PostArgs" + // QueryString ... + QueryString WebApplicationFirewallMatchVariable = "QueryString" + // RemoteAddr ... + RemoteAddr WebApplicationFirewallMatchVariable = "RemoteAddr" + // RequestBody ... + RequestBody WebApplicationFirewallMatchVariable = "RequestBody" + // RequestCookies ... + RequestCookies WebApplicationFirewallMatchVariable = "RequestCookies" + // RequestHeaders ... + RequestHeaders WebApplicationFirewallMatchVariable = "RequestHeaders" + // RequestMethod ... + RequestMethod WebApplicationFirewallMatchVariable = "RequestMethod" + // RequestURI ... + RequestURI WebApplicationFirewallMatchVariable = "RequestUri" ) // PossibleWebApplicationFirewallMatchVariableValues returns an array of possible values for the WebApplicationFirewallMatchVariable const type. func PossibleWebApplicationFirewallMatchVariableValues() []WebApplicationFirewallMatchVariable { - return []WebApplicationFirewallMatchVariable{WebApplicationFirewallMatchVariablePostArgs, WebApplicationFirewallMatchVariableQueryString, WebApplicationFirewallMatchVariableRemoteAddr, WebApplicationFirewallMatchVariableRequestBody, WebApplicationFirewallMatchVariableRequestCookies, WebApplicationFirewallMatchVariableRequestHeaders, WebApplicationFirewallMatchVariableRequestMethod, WebApplicationFirewallMatchVariableRequestURI} + return []WebApplicationFirewallMatchVariable{PostArgs, QueryString, RemoteAddr, RequestBody, RequestCookies, RequestHeaders, RequestMethod, RequestURI} } // WebApplicationFirewallMode enumerates the values for web application firewall mode. @@ -3027,6 +3607,8 @@ func PossibleWebApplicationFirewallModeValues() []WebApplicationFirewallMode { type WebApplicationFirewallOperator string const ( + // WebApplicationFirewallOperatorAny ... + WebApplicationFirewallOperatorAny WebApplicationFirewallOperator = "Any" // WebApplicationFirewallOperatorBeginsWith ... WebApplicationFirewallOperatorBeginsWith WebApplicationFirewallOperator = "BeginsWith" // WebApplicationFirewallOperatorContains ... @@ -3053,7 +3635,7 @@ const ( // PossibleWebApplicationFirewallOperatorValues returns an array of possible values for the WebApplicationFirewallOperator const type. func PossibleWebApplicationFirewallOperatorValues() []WebApplicationFirewallOperator { - return []WebApplicationFirewallOperator{WebApplicationFirewallOperatorBeginsWith, WebApplicationFirewallOperatorContains, WebApplicationFirewallOperatorEndsWith, WebApplicationFirewallOperatorEqual, WebApplicationFirewallOperatorGeoMatch, WebApplicationFirewallOperatorGreaterThan, WebApplicationFirewallOperatorGreaterThanOrEqual, WebApplicationFirewallOperatorIPMatch, WebApplicationFirewallOperatorLessThan, WebApplicationFirewallOperatorLessThanOrEqual, WebApplicationFirewallOperatorRegex} + return []WebApplicationFirewallOperator{WebApplicationFirewallOperatorAny, WebApplicationFirewallOperatorBeginsWith, WebApplicationFirewallOperatorContains, WebApplicationFirewallOperatorEndsWith, WebApplicationFirewallOperatorEqual, WebApplicationFirewallOperatorGeoMatch, WebApplicationFirewallOperatorGreaterThan, WebApplicationFirewallOperatorGreaterThanOrEqual, WebApplicationFirewallOperatorIPMatch, WebApplicationFirewallOperatorLessThan, WebApplicationFirewallOperatorLessThanOrEqual, WebApplicationFirewallOperatorRegex} } // WebApplicationFirewallPolicyResourceState enumerates the values for web application firewall policy resource @@ -3099,21 +3681,23 @@ func PossibleWebApplicationFirewallRuleTypeValues() []WebApplicationFirewallRule type WebApplicationFirewallTransform string const ( - // WebApplicationFirewallTransformHTMLEntityDecode ... - WebApplicationFirewallTransformHTMLEntityDecode WebApplicationFirewallTransform = "HtmlEntityDecode" - // WebApplicationFirewallTransformLowercase ... - WebApplicationFirewallTransformLowercase WebApplicationFirewallTransform = "Lowercase" - // WebApplicationFirewallTransformRemoveNulls ... - WebApplicationFirewallTransformRemoveNulls WebApplicationFirewallTransform = "RemoveNulls" - // WebApplicationFirewallTransformTrim ... - WebApplicationFirewallTransformTrim WebApplicationFirewallTransform = "Trim" - // WebApplicationFirewallTransformURLDecode ... - WebApplicationFirewallTransformURLDecode WebApplicationFirewallTransform = "UrlDecode" - // WebApplicationFirewallTransformURLEncode ... - WebApplicationFirewallTransformURLEncode WebApplicationFirewallTransform = "UrlEncode" + // HTMLEntityDecode ... + HTMLEntityDecode WebApplicationFirewallTransform = "HtmlEntityDecode" + // Lowercase ... + Lowercase WebApplicationFirewallTransform = "Lowercase" + // RemoveNulls ... + RemoveNulls WebApplicationFirewallTransform = "RemoveNulls" + // Trim ... + Trim WebApplicationFirewallTransform = "Trim" + // Uppercase ... + Uppercase WebApplicationFirewallTransform = "Uppercase" + // URLDecode ... + URLDecode WebApplicationFirewallTransform = "UrlDecode" + // URLEncode ... + URLEncode WebApplicationFirewallTransform = "UrlEncode" ) // PossibleWebApplicationFirewallTransformValues returns an array of possible values for the WebApplicationFirewallTransform const type. func PossibleWebApplicationFirewallTransformValues() []WebApplicationFirewallTransform { - return []WebApplicationFirewallTransform{WebApplicationFirewallTransformHTMLEntityDecode, WebApplicationFirewallTransformLowercase, WebApplicationFirewallTransformRemoveNulls, WebApplicationFirewallTransformTrim, WebApplicationFirewallTransformURLDecode, WebApplicationFirewallTransformURLEncode} + return []WebApplicationFirewallTransform{HTMLEntityDecode, Lowercase, RemoveNulls, Trim, Uppercase, URLDecode, URLEncode} } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecircuitauthorizations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecircuitauthorizations.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecircuitauthorizations.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecircuitauthorizations.go index b266a6cf1a4d..41fdb499084d 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecircuitauthorizations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecircuitauthorizations.go @@ -74,7 +74,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdatePreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -159,7 +159,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) DeletePreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -246,7 +246,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) GetPreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -327,7 +327,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) ListPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecircuitconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecircuitconnections.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecircuitconnections.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecircuitconnections.go index 83674223397e..e9f8625d96b1 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecircuitconnections.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecircuitconnections.go @@ -75,7 +75,7 @@ func (client ExpressRouteCircuitConnectionsClient) CreateOrUpdatePreparer(ctx co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -162,7 +162,7 @@ func (client ExpressRouteCircuitConnectionsClient) DeletePreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -251,7 +251,7 @@ func (client ExpressRouteCircuitConnectionsClient) GetPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -334,7 +334,7 @@ func (client ExpressRouteCircuitConnectionsClient) ListPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecircuitpeerings.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecircuitpeerings.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecircuitpeerings.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecircuitpeerings.go index f502d7a7ae49..8e3012a16698 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecircuitpeerings.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecircuitpeerings.go @@ -84,7 +84,7 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdatePreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -169,7 +169,7 @@ func (client ExpressRouteCircuitPeeringsClient) DeletePreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -256,7 +256,7 @@ func (client ExpressRouteCircuitPeeringsClient) GetPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -337,7 +337,7 @@ func (client ExpressRouteCircuitPeeringsClient) ListPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecircuits.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecircuits.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecircuits.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecircuits.go index 6e6d664c9edd..6bf7737c2cd5 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecircuits.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecircuits.go @@ -70,7 +70,7 @@ func (client ExpressRouteCircuitsClient) CreateOrUpdatePreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -152,7 +152,7 @@ func (client ExpressRouteCircuitsClient) DeletePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -237,7 +237,7 @@ func (client ExpressRouteCircuitsClient) GetPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -315,7 +315,7 @@ func (client ExpressRouteCircuitsClient) GetPeeringStatsPreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -391,7 +391,7 @@ func (client ExpressRouteCircuitsClient) GetStatsPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -470,7 +470,7 @@ func (client ExpressRouteCircuitsClient) ListPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -583,7 +583,7 @@ func (client ExpressRouteCircuitsClient) ListAllPreparer(ctx context.Context) (* "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -693,7 +693,7 @@ func (client ExpressRouteCircuitsClient) ListArpTablePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -777,7 +777,7 @@ func (client ExpressRouteCircuitsClient) ListRoutesTablePreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -861,7 +861,7 @@ func (client ExpressRouteCircuitsClient) ListRoutesTableSummaryPreparer(ctx cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -948,7 +948,7 @@ func (client ExpressRouteCircuitsClient) UpdateTagsPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressrouteconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteconnections.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressrouteconnections.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteconnections.go index b58cfdf034cb..d033ecb9b85b 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressrouteconnections.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteconnections.go @@ -81,7 +81,7 @@ func (client ExpressRouteConnectionsClient) CreateOrUpdatePreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -164,7 +164,7 @@ func (client ExpressRouteConnectionsClient) DeletePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -251,7 +251,7 @@ func (client ExpressRouteConnectionsClient) GetPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -327,7 +327,7 @@ func (client ExpressRouteConnectionsClient) ListPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecrossconnectionpeerings.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecrossconnectionpeerings.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecrossconnectionpeerings.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecrossconnectionpeerings.go index a4fbcebcd450..ad4b71bd4e6b 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecrossconnectionpeerings.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecrossconnectionpeerings.go @@ -86,7 +86,7 @@ func (client ExpressRouteCrossConnectionPeeringsClient) CreateOrUpdatePreparer(c "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -170,7 +170,7 @@ func (client ExpressRouteCrossConnectionPeeringsClient) DeletePreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -257,7 +257,7 @@ func (client ExpressRouteCrossConnectionPeeringsClient) GetPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -338,7 +338,7 @@ func (client ExpressRouteCrossConnectionPeeringsClient) ListPreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecrossconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecrossconnections.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecrossconnections.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecrossconnections.go index 5f644efbaa72..2db798b88830 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutecrossconnections.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutecrossconnections.go @@ -70,7 +70,7 @@ func (client ExpressRouteCrossConnectionsClient) CreateOrUpdatePreparer(ctx cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -159,7 +159,7 @@ func (client ExpressRouteCrossConnectionsClient) GetPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -235,7 +235,7 @@ func (client ExpressRouteCrossConnectionsClient) ListPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -346,7 +346,7 @@ func (client ExpressRouteCrossConnectionsClient) ListArpTablePreparer(ctx contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -435,7 +435,7 @@ func (client ExpressRouteCrossConnectionsClient) ListByResourceGroupPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -546,7 +546,7 @@ func (client ExpressRouteCrossConnectionsClient) ListRoutesTablePreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -630,7 +630,7 @@ func (client ExpressRouteCrossConnectionsClient) ListRoutesTableSummaryPreparer( "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -717,7 +717,7 @@ func (client ExpressRouteCrossConnectionsClient) UpdateTagsPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutegateways.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutegateways.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutegateways.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutegateways.go index 7073ce13ba27..d321a2940098 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutegateways.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutegateways.go @@ -78,7 +78,7 @@ func (client ExpressRouteGatewaysClient) CreateOrUpdatePreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -161,7 +161,7 @@ func (client ExpressRouteGatewaysClient) DeletePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -246,7 +246,7 @@ func (client ExpressRouteGatewaysClient) GetPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -320,7 +320,7 @@ func (client ExpressRouteGatewaysClient) ListByResourceGroupPreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -391,7 +391,7 @@ func (client ExpressRouteGatewaysClient) ListBySubscriptionPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -461,7 +461,7 @@ func (client ExpressRouteGatewaysClient) UpdateTagsPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutelinks.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutelinks.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutelinks.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutelinks.go index 3f973edf64bf..04657f3a8ea7 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressroutelinks.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressroutelinks.go @@ -78,7 +78,7 @@ func (client ExpressRouteLinksClient) GetPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -159,7 +159,7 @@ func (client ExpressRouteLinksClient) ListPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressrouteportauthorizations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteportauthorizations.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressrouteportauthorizations.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteportauthorizations.go index 43ea09b6d404..401e7cba6922 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressrouteportauthorizations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteportauthorizations.go @@ -73,7 +73,7 @@ func (client ExpressRoutePortAuthorizationsClient) CreateOrUpdatePreparer(ctx co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -158,7 +158,7 @@ func (client ExpressRoutePortAuthorizationsClient) DeletePreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -245,7 +245,7 @@ func (client ExpressRoutePortAuthorizationsClient) GetPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -326,7 +326,7 @@ func (client ExpressRoutePortAuthorizationsClient) ListPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressrouteports.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteports.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressrouteports.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteports.go index bec868899b61..d722d3ad13aa 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressrouteports.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteports.go @@ -71,7 +71,7 @@ func (client ExpressRoutePortsClient) CreateOrUpdatePreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -153,7 +153,7 @@ func (client ExpressRoutePortsClient) DeletePreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -245,7 +245,7 @@ func (client ExpressRoutePortsClient) GenerateLOAPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -323,7 +323,7 @@ func (client ExpressRoutePortsClient) GetPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -399,7 +399,7 @@ func (client ExpressRoutePortsClient) ListPreparer(ctx context.Context) (*http.R "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -515,7 +515,7 @@ func (client ExpressRoutePortsClient) ListByResourceGroupPreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -629,7 +629,7 @@ func (client ExpressRoutePortsClient) UpdateTagsPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressrouteportslocations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteportslocations.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressrouteportslocations.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteportslocations.go index feca9cf4eddc..0fd21f2208c2 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressrouteportslocations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteportslocations.go @@ -75,7 +75,7 @@ func (client ExpressRoutePortsLocationsClient) GetPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -152,7 +152,7 @@ func (client ExpressRoutePortsLocationsClient) ListPreparer(ctx context.Context) "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteproviderportslocation.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteproviderportslocation.go new file mode 100644 index 000000000000..c4671c00ae2b --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteproviderportslocation.go @@ -0,0 +1,109 @@ +package network + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ExpressRouteProviderPortsLocationClient is the network Client +type ExpressRouteProviderPortsLocationClient struct { + BaseClient +} + +// NewExpressRouteProviderPortsLocationClient creates an instance of the ExpressRouteProviderPortsLocationClient +// client. +func NewExpressRouteProviderPortsLocationClient(subscriptionID string) ExpressRouteProviderPortsLocationClient { + return NewExpressRouteProviderPortsLocationClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewExpressRouteProviderPortsLocationClientWithBaseURI creates an instance of the +// ExpressRouteProviderPortsLocationClient client using a custom endpoint. Use this when interacting with an Azure +// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewExpressRouteProviderPortsLocationClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteProviderPortsLocationClient { + return ExpressRouteProviderPortsLocationClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List retrieves all the ExpressRouteProviderPorts in a subscription. +// Parameters: +// filter - the filter to apply on the operation. For example, you can use $filter=location eq '{state}'. +func (client ExpressRouteProviderPortsLocationClient) List(ctx context.Context, filter string) (result ExpressRouteProviderPortListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExpressRouteProviderPortsLocationClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteProviderPortsLocationClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.ExpressRouteProviderPortsLocationClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ExpressRouteProviderPortsLocationClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ExpressRouteProviderPortsLocationClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteProviderPorts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ExpressRouteProviderPortsLocationClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ExpressRouteProviderPortsLocationClient) ListResponder(resp *http.Response) (result ExpressRouteProviderPortListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressrouteserviceproviders.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteserviceproviders.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressrouteserviceproviders.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteserviceproviders.go index c237501b4d03..b76714e641f8 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/expressrouteserviceproviders.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/expressrouteserviceproviders.go @@ -76,7 +76,7 @@ func (client ExpressRouteServiceProvidersClient) ListPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/firewallpolicies.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/firewallpolicies.go similarity index 95% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/firewallpolicies.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/firewallpolicies.go index dddc0c3b11f5..44ec477c20bb 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/firewallpolicies.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/firewallpolicies.go @@ -51,18 +51,18 @@ func (client FirewallPoliciesClient) CreateOrUpdate(ctx context.Context, resourc if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.FirewallPolicyPropertiesFormat", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxySettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxySettings.HTTPPort", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxySettings.HTTPPort", Name: validation.InclusiveMaximum, Rule: int64(64000), Chain: nil}, - {Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxySettings.HTTPPort", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxy", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxy.HTTPPort", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxy.HTTPPort", Name: validation.InclusiveMaximum, Rule: int64(64000), Chain: nil}, + {Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxy.HTTPPort", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, }}, - {Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxySettings.HTTPSPort", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxySettings.HTTPSPort", Name: validation.InclusiveMaximum, Rule: int64(64000), Chain: nil}, - {Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxySettings.HTTPSPort", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, + {Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxy.HTTPSPort", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxy.HTTPSPort", Name: validation.InclusiveMaximum, Rule: int64(64000), Chain: nil}, + {Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxy.HTTPSPort", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, }}, - {Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxySettings.PacFilePort", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxySettings.PacFilePort", Name: validation.InclusiveMaximum, Rule: int64(64000), Chain: nil}, - {Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxySettings.PacFilePort", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, + {Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxy.PacFilePort", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxy.PacFilePort", Name: validation.InclusiveMaximum, Rule: int64(64000), Chain: nil}, + {Target: "parameters.FirewallPolicyPropertiesFormat.ExplicitProxy.PacFilePort", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, }}, }}, }}}}}); err != nil { @@ -92,7 +92,7 @@ func (client FirewallPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -174,7 +174,7 @@ func (client FirewallPoliciesClient) DeletePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -260,7 +260,7 @@ func (client FirewallPoliciesClient) GetPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -342,7 +342,7 @@ func (client FirewallPoliciesClient) ListPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -455,7 +455,7 @@ func (client FirewallPoliciesClient) ListAllPreparer(ctx context.Context) (*http "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -569,7 +569,7 @@ func (client FirewallPoliciesClient) UpdateTagsPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/firewallpolicyidpssignatures.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/firewallpolicyidpssignatures.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/firewallpolicyidpssignatures.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/firewallpolicyidpssignatures.go index c920b64009a5..851178b0d87c 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/firewallpolicyidpssignatures.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/firewallpolicyidpssignatures.go @@ -86,7 +86,7 @@ func (client FirewallPolicyIdpsSignaturesClient) ListPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/firewallpolicyidpssignaturesfiltervalues.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/firewallpolicyidpssignaturesfiltervalues.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/firewallpolicyidpssignaturesfiltervalues.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/firewallpolicyidpssignaturesfiltervalues.go index 576612c8ed27..00a994c89a5f 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/firewallpolicyidpssignaturesfiltervalues.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/firewallpolicyidpssignaturesfiltervalues.go @@ -77,7 +77,7 @@ func (client FirewallPolicyIdpsSignaturesFilterValuesClient) ListPreparer(ctx co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/firewallpolicyidpssignaturesoverrides.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/firewallpolicyidpssignaturesoverrides.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/firewallpolicyidpssignaturesoverrides.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/firewallpolicyidpssignaturesoverrides.go index 6ab55b16199b..b0bc6814f8ed 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/firewallpolicyidpssignaturesoverrides.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/firewallpolicyidpssignaturesoverrides.go @@ -77,7 +77,7 @@ func (client FirewallPolicyIdpsSignaturesOverridesClient) GetPreparer(ctx contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -153,7 +153,7 @@ func (client FirewallPolicyIdpsSignaturesOverridesClient) ListPreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -230,7 +230,7 @@ func (client FirewallPolicyIdpsSignaturesOverridesClient) PatchPreparer(ctx cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -309,7 +309,7 @@ func (client FirewallPolicyIdpsSignaturesOverridesClient) PutPreparer(ctx contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/firewallpolicyrulecollectiongroups.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/firewallpolicyrulecollectiongroups.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/firewallpolicyrulecollectiongroups.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/firewallpolicyrulecollectiongroups.go index 5e93d360c63b..bb71e0b964e2 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/firewallpolicyrulecollectiongroups.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/firewallpolicyrulecollectiongroups.go @@ -85,7 +85,7 @@ func (client FirewallPolicyRuleCollectionGroupsClient) CreateOrUpdatePreparer(ct "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -170,7 +170,7 @@ func (client FirewallPolicyRuleCollectionGroupsClient) DeletePreparer(ctx contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -257,7 +257,7 @@ func (client FirewallPolicyRuleCollectionGroupsClient) GetPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -338,7 +338,7 @@ func (client FirewallPolicyRuleCollectionGroupsClient) ListPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/flowlogs.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/flowlogs.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/flowlogs.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/flowlogs.go index 6437b94c0910..d1567ce5aa3d 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/flowlogs.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/flowlogs.go @@ -81,7 +81,7 @@ func (client FlowLogsClient) CreateOrUpdatePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -165,7 +165,7 @@ func (client FlowLogsClient) DeletePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -252,7 +252,7 @@ func (client FlowLogsClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -333,7 +333,7 @@ func (client FlowLogsClient) ListPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -449,7 +449,7 @@ func (client FlowLogsClient) UpdateTagsPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/groups.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/groups.go new file mode 100644 index 000000000000..4028e1173ef4 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/groups.go @@ -0,0 +1,421 @@ +package network + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// GroupsClient is the network Client +type GroupsClient struct { + BaseClient +} + +// NewGroupsClient creates an instance of the GroupsClient client. +func NewGroupsClient(subscriptionID string) GroupsClient { + return NewGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewGroupsClientWithBaseURI creates an instance of the GroupsClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewGroupsClientWithBaseURI(baseURI string, subscriptionID string) GroupsClient { + return GroupsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a network group. +// Parameters: +// parameters - parameters supplied to the specify which network group need to create +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +// networkGroupName - the name of the network group. +// ifMatch - the ETag of the transformation. Omit this value to always overwrite the current resource. Specify +// the last-seen ETag value to prevent accidentally overwriting concurrent changes. +func (client GroupsClient) CreateOrUpdate(ctx context.Context, parameters Group, resourceGroupName string, networkManagerName string, networkGroupName string, ifMatch string) (result Group, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, parameters, resourceGroupName, networkManagerName, networkGroupName, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "network.GroupsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.GroupsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.GroupsClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client GroupsClient) CreateOrUpdatePreparer(ctx context.Context, parameters Group, resourceGroupName string, networkManagerName string, networkGroupName string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "networkGroupName": autorest.Encode("path", networkGroupName), + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client GroupsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client GroupsClient) CreateOrUpdateResponder(resp *http.Response) (result Group, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a network group. +// Parameters: +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +// networkGroupName - the name of the network group. +// force - deletes the resource even if it is part of a deployed configuration. If the configuration has been +// deployed, the service will do a cleanup deployment in the background, prior to the delete. +func (client GroupsClient) Delete(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, force *bool) (result GroupsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, networkManagerName, networkGroupName, force) + if err != nil { + err = autorest.NewErrorWithError(err, "network.GroupsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.GroupsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client GroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, force *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "networkGroupName": autorest.Encode("path", networkGroupName), + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if force != nil { + queryParameters["force"] = autorest.Encode("query", *force) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client GroupsClient) DeleteSender(req *http.Request) (future GroupsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client GroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the specified network group. +// Parameters: +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +// networkGroupName - the name of the network group. +func (client GroupsClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string) (result Group, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, networkManagerName, networkGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.GroupsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.GroupsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.GroupsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client GroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "networkGroupName": autorest.Encode("path", networkGroupName), + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client GroupsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client GroupsClient) GetResponder(resp *http.Response) (result Group, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the specified network group. +// Parameters: +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +// top - an optional query parameter which specifies the maximum number of records to be returned by the +// server. +// skipToken - skipToken is only used if a previous operation returned a partial result. If a previous response +// contains a nextLink element, the value of the nextLink element will include a skipToken parameter that +// specifies a starting point to use for subsequent calls. +func (client GroupsClient) List(ctx context.Context, resourceGroupName string, networkManagerName string, top *int32, skipToken string) (result GroupListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.List") + defer func() { + sc := -1 + if result.glr.Response.Response != nil { + sc = result.glr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, + {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("network.GroupsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, networkManagerName, top, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "network.GroupsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.glr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.GroupsClient", "List", resp, "Failure sending request") + return + } + + result.glr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.GroupsClient", "List", resp, "Failure responding to request") + return + } + if result.glr.hasNextLink() && result.glr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client GroupsClient) ListPreparer(ctx context.Context, resourceGroupName string, networkManagerName string, top *int32, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client GroupsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client GroupsClient) ListResponder(resp *http.Response) (result GroupListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client GroupsClient) listNextResults(ctx context.Context, lastResults GroupListResult) (result GroupListResult, err error) { + req, err := lastResults.groupListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "network.GroupsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.GroupsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.GroupsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client GroupsClient) ListComplete(ctx context.Context, resourceGroupName string, networkManagerName string, top *int32, skipToken string) (result GroupListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, networkManagerName, top, skipToken) + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/hubroutetables.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/hubroutetables.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/hubroutetables.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/hubroutetables.go index 579df8d7267c..e2b54ffada4a 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/hubroutetables.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/hubroutetables.go @@ -71,7 +71,7 @@ func (client HubRouteTablesClient) CreateOrUpdatePreparer(ctx context.Context, r "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -156,7 +156,7 @@ func (client HubRouteTablesClient) DeletePreparer(ctx context.Context, resourceG "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -243,7 +243,7 @@ func (client HubRouteTablesClient) GetPreparer(ctx context.Context, resourceGrou "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -324,7 +324,7 @@ func (client HubRouteTablesClient) ListPreparer(ctx context.Context, resourceGro "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/hubvirtualnetworkconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/hubvirtualnetworkconnections.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/hubvirtualnetworkconnections.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/hubvirtualnetworkconnections.go index 2e68e70e460f..02031271f7a4 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/hubvirtualnetworkconnections.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/hubvirtualnetworkconnections.go @@ -73,7 +73,7 @@ func (client HubVirtualNetworkConnectionsClient) CreateOrUpdatePreparer(ctx cont "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -157,7 +157,7 @@ func (client HubVirtualNetworkConnectionsClient) DeletePreparer(ctx context.Cont "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -244,7 +244,7 @@ func (client HubVirtualNetworkConnectionsClient) GetPreparer(ctx context.Context "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -325,7 +325,7 @@ func (client HubVirtualNetworkConnectionsClient) ListPreparer(ctx context.Contex "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/inboundnatrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/inboundnatrules.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/inboundnatrules.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/inboundnatrules.go index f603374e192e..e0dfa3bd6568 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/inboundnatrules.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/inboundnatrules.go @@ -93,7 +93,7 @@ func (client InboundNatRulesClient) CreateOrUpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -178,7 +178,7 @@ func (client InboundNatRulesClient) DeletePreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -266,7 +266,7 @@ func (client InboundNatRulesClient) GetPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -350,7 +350,7 @@ func (client InboundNatRulesClient) ListPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/inboundsecurityrule.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/inboundsecurityrule.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/inboundsecurityrule.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/inboundsecurityrule.go index d4279e18a391..eb1144376d02 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/inboundsecurityrule.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/inboundsecurityrule.go @@ -73,7 +73,7 @@ func (client InboundSecurityRuleClient) CreateOrUpdatePreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/interfaceipconfigurations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/interfaceipconfigurations.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/interfaceipconfigurations.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/interfaceipconfigurations.go index c2675352841f..38d87b3d5ab2 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/interfaceipconfigurations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/interfaceipconfigurations.go @@ -78,7 +78,7 @@ func (client InterfaceIPConfigurationsClient) GetPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -159,7 +159,7 @@ func (client InterfaceIPConfigurationsClient) ListPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/interfaceloadbalancers.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/interfaceloadbalancers.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/interfaceloadbalancers.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/interfaceloadbalancers.go index cc49e62e6ecc..a7b2666852f1 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/interfaceloadbalancers.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/interfaceloadbalancers.go @@ -81,7 +81,7 @@ func (client InterfaceLoadBalancersClient) ListPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/interfacesgroup.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/interfacesgroup.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/interfacesgroup.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/interfacesgroup.go index 2ace149c5a5f..9e95b95955d3 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/interfacesgroup.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/interfacesgroup.go @@ -69,7 +69,7 @@ func (client InterfacesClient) CreateOrUpdatePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -151,7 +151,7 @@ func (client InterfacesClient) DeletePreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -237,7 +237,7 @@ func (client InterfacesClient) GetPreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -321,7 +321,7 @@ func (client InterfacesClient) GetCloudServiceNetworkInterfacePreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-30" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -393,7 +393,7 @@ func (client InterfacesClient) GetEffectiveRouteTablePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -487,7 +487,7 @@ func (client InterfacesClient) GetVirtualMachineScaleSetIPConfigurationPreparer( "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), } - const APIVersion = "2017-03-30" + const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -571,7 +571,7 @@ func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterfacePreparer "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), } - const APIVersion = "2017-03-30" + const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -653,7 +653,7 @@ func (client InterfacesClient) ListPreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -766,7 +766,7 @@ func (client InterfacesClient) ListAllPreparer(ctx context.Context) (*http.Reque "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -884,7 +884,7 @@ func (client InterfacesClient) ListCloudServiceNetworkInterfacesPreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-30" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1005,7 +1005,7 @@ func (client InterfacesClient) ListCloudServiceRoleInstanceNetworkInterfacesPrep "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-30" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1111,7 +1111,7 @@ func (client InterfacesClient) ListEffectiveNetworkSecurityGroupsPreparer(ctx co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1208,7 +1208,7 @@ func (client InterfacesClient) ListVirtualMachineScaleSetIPConfigurationsPrepare "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), } - const APIVersion = "2017-03-30" + const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1329,7 +1329,7 @@ func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesPrepar "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), } - const APIVersion = "2017-03-30" + const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1450,7 +1450,7 @@ func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesPrep "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), } - const APIVersion = "2017-03-30" + const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1564,7 +1564,7 @@ func (client InterfacesClient) UpdateTagsPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/interfacetapconfigurations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/interfacetapconfigurations.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/interfacetapconfigurations.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/interfacetapconfigurations.go index bf16177e294e..12b4a1102849 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/interfacetapconfigurations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/interfacetapconfigurations.go @@ -112,7 +112,7 @@ func (client InterfaceTapConfigurationsClient) CreateOrUpdatePreparer(ctx contex "tapConfigurationName": autorest.Encode("path", tapConfigurationName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -197,7 +197,7 @@ func (client InterfaceTapConfigurationsClient) DeletePreparer(ctx context.Contex "tapConfigurationName": autorest.Encode("path", tapConfigurationName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -284,7 +284,7 @@ func (client InterfaceTapConfigurationsClient) GetPreparer(ctx context.Context, "tapConfigurationName": autorest.Encode("path", tapConfigurationName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -365,7 +365,7 @@ func (client InterfaceTapConfigurationsClient) ListPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/ipallocations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/ipallocations.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/ipallocations.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/ipallocations.go index 764e051e0052..5cfbec8391e1 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/ipallocations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/ipallocations.go @@ -69,7 +69,7 @@ func (client IPAllocationsClient) CreateOrUpdatePreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -151,7 +151,7 @@ func (client IPAllocationsClient) DeletePreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -237,7 +237,7 @@ func (client IPAllocationsClient) GetPreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -316,7 +316,7 @@ func (client IPAllocationsClient) ListPreparer(ctx context.Context) (*http.Reque "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -432,7 +432,7 @@ func (client IPAllocationsClient) ListByResourceGroupPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -546,7 +546,7 @@ func (client IPAllocationsClient) UpdateTagsPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/ipgroups.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/ipgroups.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/ipgroups.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/ipgroups.go index ec763e6966c1..16ff0075a00b 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/ipgroups.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/ipgroups.go @@ -69,7 +69,7 @@ func (client IPGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -151,7 +151,7 @@ func (client IPGroupsClient) DeletePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -238,7 +238,7 @@ func (client IPGroupsClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -317,7 +317,7 @@ func (client IPGroupsClient) ListPreparer(ctx context.Context) (*http.Request, e "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -433,7 +433,7 @@ func (client IPGroupsClient) ListByResourceGroupPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -547,7 +547,7 @@ func (client IPGroupsClient) UpdateGroupsPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancerbackendaddresspools.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancerbackendaddresspools.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancerbackendaddresspools.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancerbackendaddresspools.go index 8f5cf4c572b0..4ba059657da2 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancerbackendaddresspools.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancerbackendaddresspools.go @@ -72,7 +72,7 @@ func (client LoadBalancerBackendAddressPoolsClient) CreateOrUpdatePreparer(ctx c "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -157,7 +157,7 @@ func (client LoadBalancerBackendAddressPoolsClient) DeletePreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -244,7 +244,7 @@ func (client LoadBalancerBackendAddressPoolsClient) GetPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -325,7 +325,7 @@ func (client LoadBalancerBackendAddressPoolsClient) ListPreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancerfrontendipconfigurations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancerfrontendipconfigurations.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancerfrontendipconfigurations.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancerfrontendipconfigurations.go index 89fcfa437255..9d5495f9d35d 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancerfrontendipconfigurations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancerfrontendipconfigurations.go @@ -79,7 +79,7 @@ func (client LoadBalancerFrontendIPConfigurationsClient) GetPreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -160,7 +160,7 @@ func (client LoadBalancerFrontendIPConfigurationsClient) ListPreparer(ctx contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancerloadbalancingrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancerloadbalancingrules.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancerloadbalancingrules.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancerloadbalancingrules.go index 61d0a0eb6ad6..c11489329311 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancerloadbalancingrules.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancerloadbalancingrules.go @@ -78,7 +78,7 @@ func (client LoadBalancerLoadBalancingRulesClient) GetPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -159,7 +159,7 @@ func (client LoadBalancerLoadBalancingRulesClient) ListPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancernetworkinterfaces.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancernetworkinterfaces.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancernetworkinterfaces.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancernetworkinterfaces.go index 979d6bbc8d46..586ff96709bd 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancernetworkinterfaces.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancernetworkinterfaces.go @@ -81,7 +81,7 @@ func (client LoadBalancerNetworkInterfacesClient) ListPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalanceroutboundrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalanceroutboundrules.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalanceroutboundrules.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalanceroutboundrules.go index c0a7ee956cb1..6212cd6dedb8 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalanceroutboundrules.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalanceroutboundrules.go @@ -78,7 +78,7 @@ func (client LoadBalancerOutboundRulesClient) GetPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -159,7 +159,7 @@ func (client LoadBalancerOutboundRulesClient) ListPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancerprobes.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancerprobes.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancerprobes.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancerprobes.go index e6f4119d9d0a..4ba2205c3610 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancerprobes.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancerprobes.go @@ -78,7 +78,7 @@ func (client LoadBalancerProbesClient) GetPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -159,7 +159,7 @@ func (client LoadBalancerProbesClient) ListPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancers.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancers.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancers.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancers.go index 47a59550a3ba..ed722a05f867 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/loadbalancers.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/loadbalancers.go @@ -69,7 +69,7 @@ func (client LoadBalancersClient) CreateOrUpdatePreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -151,7 +151,7 @@ func (client LoadBalancersClient) DeletePreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -237,7 +237,7 @@ func (client LoadBalancersClient) GetPreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -319,7 +319,7 @@ func (client LoadBalancersClient) ListPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -432,7 +432,7 @@ func (client LoadBalancersClient) ListAllPreparer(ctx context.Context) (*http.Re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -541,7 +541,7 @@ func (client LoadBalancersClient) ListInboundNatRulePortMappingsPreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -621,7 +621,7 @@ func (client LoadBalancersClient) SwapPublicIPAddressesPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -709,7 +709,7 @@ func (client LoadBalancersClient) UpdateTagsPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/localnetworkgateways.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/localnetworkgateways.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/localnetworkgateways.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/localnetworkgateways.go index c7cd62e8c913..c1e4015d0681 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/localnetworkgateways.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/localnetworkgateways.go @@ -86,7 +86,7 @@ func (client LocalNetworkGatewaysClient) CreateOrUpdatePreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -174,7 +174,7 @@ func (client LocalNetworkGatewaysClient) DeletePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -265,7 +265,7 @@ func (client LocalNetworkGatewaysClient) GetPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -344,7 +344,7 @@ func (client LocalNetworkGatewaysClient) ListPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -464,7 +464,7 @@ func (client LocalNetworkGatewaysClient) UpdateTagsPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/managementgroupnetworkmanagerconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/managementgroupnetworkmanagerconnections.go new file mode 100644 index 000000000000..177be9f9bd94 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/managementgroupnetworkmanagerconnections.go @@ -0,0 +1,397 @@ +package network + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ManagementGroupNetworkManagerConnectionsClient is the network Client +type ManagementGroupNetworkManagerConnectionsClient struct { + BaseClient +} + +// NewManagementGroupNetworkManagerConnectionsClient creates an instance of the +// ManagementGroupNetworkManagerConnectionsClient client. +func NewManagementGroupNetworkManagerConnectionsClient(subscriptionID string) ManagementGroupNetworkManagerConnectionsClient { + return NewManagementGroupNetworkManagerConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewManagementGroupNetworkManagerConnectionsClientWithBaseURI creates an instance of the +// ManagementGroupNetworkManagerConnectionsClient client using a custom endpoint. Use this when interacting with an +// Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewManagementGroupNetworkManagerConnectionsClientWithBaseURI(baseURI string, subscriptionID string) ManagementGroupNetworkManagerConnectionsClient { + return ManagementGroupNetworkManagerConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create a network manager connection on this management group. +// Parameters: +// parameters - network manager connection to be created/updated. +// managementGroupID - the management group Id which uniquely identify the Microsoft Azure management group. +// networkManagerConnectionName - name for the network manager connection. +func (client ManagementGroupNetworkManagerConnectionsClient) CreateOrUpdate(ctx context.Context, parameters ManagerConnection, managementGroupID string, networkManagerConnectionName string) (result ManagerConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagementGroupNetworkManagerConnectionsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, parameters, managementGroupID, networkManagerConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ManagementGroupNetworkManagerConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.ManagementGroupNetworkManagerConnectionsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ManagementGroupNetworkManagerConnectionsClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ManagementGroupNetworkManagerConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, parameters ManagerConnection, managementGroupID string, networkManagerConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "managementGroupId": autorest.Encode("path", managementGroupID), + "networkManagerConnectionName": autorest.Encode("path", networkManagerConnectionName), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ManagementGroupNetworkManagerConnectionsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ManagementGroupNetworkManagerConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result ManagerConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete specified pending connection created by this management group. +// Parameters: +// managementGroupID - the management group Id which uniquely identify the Microsoft Azure management group. +// networkManagerConnectionName - name for the network manager connection. +func (client ManagementGroupNetworkManagerConnectionsClient) Delete(ctx context.Context, managementGroupID string, networkManagerConnectionName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagementGroupNetworkManagerConnectionsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, managementGroupID, networkManagerConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ManagementGroupNetworkManagerConnectionsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "network.ManagementGroupNetworkManagerConnectionsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ManagementGroupNetworkManagerConnectionsClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ManagementGroupNetworkManagerConnectionsClient) DeletePreparer(ctx context.Context, managementGroupID string, networkManagerConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "managementGroupId": autorest.Encode("path", managementGroupID), + "networkManagerConnectionName": autorest.Encode("path", networkManagerConnectionName), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ManagementGroupNetworkManagerConnectionsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ManagementGroupNetworkManagerConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get a specified connection created by this management group. +// Parameters: +// managementGroupID - the management group Id which uniquely identify the Microsoft Azure management group. +// networkManagerConnectionName - name for the network manager connection. +func (client ManagementGroupNetworkManagerConnectionsClient) Get(ctx context.Context, managementGroupID string, networkManagerConnectionName string) (result ManagerConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagementGroupNetworkManagerConnectionsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, managementGroupID, networkManagerConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ManagementGroupNetworkManagerConnectionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.ManagementGroupNetworkManagerConnectionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ManagementGroupNetworkManagerConnectionsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ManagementGroupNetworkManagerConnectionsClient) GetPreparer(ctx context.Context, managementGroupID string, networkManagerConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "managementGroupId": autorest.Encode("path", managementGroupID), + "networkManagerConnectionName": autorest.Encode("path", networkManagerConnectionName), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ManagementGroupNetworkManagerConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ManagementGroupNetworkManagerConnectionsClient) GetResponder(resp *http.Response) (result ManagerConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list all network manager connections created by this management group. +// Parameters: +// managementGroupID - the management group Id which uniquely identify the Microsoft Azure management group. +// top - an optional query parameter which specifies the maximum number of records to be returned by the +// server. +// skipToken - skipToken is only used if a previous operation returned a partial result. If a previous response +// contains a nextLink element, the value of the nextLink element will include a skipToken parameter that +// specifies a starting point to use for subsequent calls. +func (client ManagementGroupNetworkManagerConnectionsClient) List(ctx context.Context, managementGroupID string, top *int32, skipToken string) (result ManagerConnectionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagementGroupNetworkManagerConnectionsClient.List") + defer func() { + sc := -1 + if result.mclr.Response.Response != nil { + sc = result.mclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, + {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("network.ManagementGroupNetworkManagerConnectionsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, managementGroupID, top, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ManagementGroupNetworkManagerConnectionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.mclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.ManagementGroupNetworkManagerConnectionsClient", "List", resp, "Failure sending request") + return + } + + result.mclr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ManagementGroupNetworkManagerConnectionsClient", "List", resp, "Failure responding to request") + return + } + if result.mclr.hasNextLink() && result.mclr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ManagementGroupNetworkManagerConnectionsClient) ListPreparer(ctx context.Context, managementGroupID string, top *int32, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "managementGroupId": autorest.Encode("path", managementGroupID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Network/networkManagerConnections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ManagementGroupNetworkManagerConnectionsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ManagementGroupNetworkManagerConnectionsClient) ListResponder(resp *http.Response) (result ManagerConnectionListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ManagementGroupNetworkManagerConnectionsClient) listNextResults(ctx context.Context, lastResults ManagerConnectionListResult) (result ManagerConnectionListResult, err error) { + req, err := lastResults.managerConnectionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "network.ManagementGroupNetworkManagerConnectionsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.ManagementGroupNetworkManagerConnectionsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ManagementGroupNetworkManagerConnectionsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ManagementGroupNetworkManagerConnectionsClient) ListComplete(ctx context.Context, managementGroupID string, top *int32, skipToken string) (result ManagerConnectionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagementGroupNetworkManagerConnectionsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, managementGroupID, top, skipToken) + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/managercommits.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/managercommits.go new file mode 100644 index 000000000000..8a88e396b262 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/managercommits.go @@ -0,0 +1,121 @@ +package network + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ManagerCommitsClient is the network Client +type ManagerCommitsClient struct { + BaseClient +} + +// NewManagerCommitsClient creates an instance of the ManagerCommitsClient client. +func NewManagerCommitsClient(subscriptionID string) ManagerCommitsClient { + return NewManagerCommitsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewManagerCommitsClientWithBaseURI creates an instance of the ManagerCommitsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewManagerCommitsClientWithBaseURI(baseURI string, subscriptionID string) ManagerCommitsClient { + return ManagerCommitsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Post post a Network Manager Commit. +// Parameters: +// parameters - parameters supplied to specify which Managed Network commit is. +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +func (client ManagerCommitsClient) Post(ctx context.Context, parameters ManagerCommit, resourceGroupName string, networkManagerName string) (result ManagerCommitsPostFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagerCommitsClient.Post") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.TargetLocations", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("network.ManagerCommitsClient", "Post", err.Error()) + } + + req, err := client.PostPreparer(ctx, parameters, resourceGroupName, networkManagerName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ManagerCommitsClient", "Post", nil, "Failure preparing request") + return + } + + result, err = client.PostSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ManagerCommitsClient", "Post", result.Response(), "Failure sending request") + return + } + + return +} + +// PostPreparer prepares the Post request. +func (client ManagerCommitsClient) PostPreparer(ctx context.Context, parameters ManagerCommit, resourceGroupName string, networkManagerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.CommitID = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/commit", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PostSender sends the Post request. The method will close the +// http.Response Body if it receives an error. +func (client ManagerCommitsClient) PostSender(req *http.Request) (future ManagerCommitsPostFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PostResponder handles the response to the Post request. The method always +// closes the http.Response Body. +func (client ManagerCommitsClient) PostResponder(resp *http.Response) (result ManagerCommit, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/managerdeploymentstatus.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/managerdeploymentstatus.go new file mode 100644 index 000000000000..eff571d69866 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/managerdeploymentstatus.go @@ -0,0 +1,126 @@ +package network + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ManagerDeploymentStatusClient is the network Client +type ManagerDeploymentStatusClient struct { + BaseClient +} + +// NewManagerDeploymentStatusClient creates an instance of the ManagerDeploymentStatusClient client. +func NewManagerDeploymentStatusClient(subscriptionID string) ManagerDeploymentStatusClient { + return NewManagerDeploymentStatusClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewManagerDeploymentStatusClientWithBaseURI creates an instance of the ManagerDeploymentStatusClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewManagerDeploymentStatusClientWithBaseURI(baseURI string, subscriptionID string) ManagerDeploymentStatusClient { + return ManagerDeploymentStatusClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List post to List of Network Manager Deployment Status. +// Parameters: +// parameters - parameters supplied to specify which Managed Network deployment status is. +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +// top - an optional query parameter which specifies the maximum number of records to be returned by the +// server. +func (client ManagerDeploymentStatusClient) List(ctx context.Context, parameters ManagerDeploymentStatusParameter, resourceGroupName string, networkManagerName string, top *int32) (result ManagerDeploymentStatusListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagerDeploymentStatusClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, + {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("network.ManagerDeploymentStatusClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, parameters, resourceGroupName, networkManagerName, top) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ManagerDeploymentStatusClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.ManagerDeploymentStatusClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ManagerDeploymentStatusClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ManagerDeploymentStatusClient) ListPreparer(ctx context.Context, parameters ManagerDeploymentStatusParameter, resourceGroupName string, networkManagerName string, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/listDeploymentStatus", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ManagerDeploymentStatusClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ManagerDeploymentStatusClient) ListResponder(resp *http.Response) (result ManagerDeploymentStatusListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/managers.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/managers.go new file mode 100644 index 000000000000..f569db33cbc0 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/managers.go @@ -0,0 +1,630 @@ +package network + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ManagersClient is the network Client +type ManagersClient struct { + BaseClient +} + +// NewManagersClient creates an instance of the ManagersClient client. +func NewManagersClient(subscriptionID string) ManagersClient { + return NewManagersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewManagersClientWithBaseURI creates an instance of the ManagersClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewManagersClientWithBaseURI(baseURI string, subscriptionID string) ManagersClient { + return ManagersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a Network Manager. +// Parameters: +// parameters - parameters supplied to specify which network manager is. +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +func (client ManagersClient) CreateOrUpdate(ctx context.Context, parameters Manager, resourceGroupName string, networkManagerName string) (result Manager, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagersClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ManagerProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagerProperties.NetworkManagerScopes", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ManagerProperties.NetworkManagerScopeAccesses", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("network.ManagersClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, parameters, resourceGroupName, networkManagerName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ManagersClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.ManagersClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ManagersClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ManagersClient) CreateOrUpdatePreparer(ctx context.Context, parameters Manager, resourceGroupName string, networkManagerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.Etag = nil + parameters.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ManagersClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ManagersClient) CreateOrUpdateResponder(resp *http.Response) (result Manager, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a network manager. +// Parameters: +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +// force - deletes the resource even if it is part of a deployed configuration. If the configuration has been +// deployed, the service will do a cleanup deployment in the background, prior to the delete. +func (client ManagersClient) Delete(ctx context.Context, resourceGroupName string, networkManagerName string, force *bool) (result ManagersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagersClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, networkManagerName, force) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ManagersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ManagersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ManagersClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkManagerName string, force *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if force != nil { + queryParameters["force"] = autorest.Encode("query", *force) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ManagersClient) DeleteSender(req *http.Request) (future ManagersDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ManagersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the specified Network Manager. +// Parameters: +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +func (client ManagersClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string) (result Manager, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, networkManagerName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ManagersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.ManagersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ManagersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ManagersClient) GetPreparer(ctx context.Context, resourceGroupName string, networkManagerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ManagersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ManagersClient) GetResponder(resp *http.Response) (result Manager, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list network managers in a resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +// top - an optional query parameter which specifies the maximum number of records to be returned by the +// server. +// skipToken - skipToken is only used if a previous operation returned a partial result. If a previous response +// contains a nextLink element, the value of the nextLink element will include a skipToken parameter that +// specifies a starting point to use for subsequent calls. +func (client ManagersClient) List(ctx context.Context, resourceGroupName string, top *int32, skipToken string) (result ManagerListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagersClient.List") + defer func() { + sc := -1 + if result.mlr.Response.Response != nil { + sc = result.mlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, + {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("network.ManagersClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, top, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ManagersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.mlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.ManagersClient", "List", resp, "Failure sending request") + return + } + + result.mlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ManagersClient", "List", resp, "Failure responding to request") + return + } + if result.mlr.hasNextLink() && result.mlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ManagersClient) ListPreparer(ctx context.Context, resourceGroupName string, top *int32, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ManagersClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ManagersClient) ListResponder(resp *http.Response) (result ManagerListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ManagersClient) listNextResults(ctx context.Context, lastResults ManagerListResult) (result ManagerListResult, err error) { + req, err := lastResults.managerListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "network.ManagersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.ManagersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ManagersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ManagersClient) ListComplete(ctx context.Context, resourceGroupName string, top *int32, skipToken string) (result ManagerListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, top, skipToken) + return +} + +// ListBySubscription list all network managers in a subscription. +// Parameters: +// top - an optional query parameter which specifies the maximum number of records to be returned by the +// server. +// skipToken - skipToken is only used if a previous operation returned a partial result. If a previous response +// contains a nextLink element, the value of the nextLink element will include a skipToken parameter that +// specifies a starting point to use for subsequent calls. +func (client ManagersClient) ListBySubscription(ctx context.Context, top *int32, skipToken string) (result ManagerListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagersClient.ListBySubscription") + defer func() { + sc := -1 + if result.mlr.Response.Response != nil { + sc = result.mlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, + {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("network.ManagersClient", "ListBySubscription", err.Error()) + } + + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx, top, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ManagersClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.mlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.ManagersClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.mlr, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ManagersClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.mlr.hasNextLink() && result.mlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client ManagersClient) ListBySubscriptionPreparer(ctx context.Context, top *int32, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client ManagersClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client ManagersClient) ListBySubscriptionResponder(resp *http.Response) (result ManagerListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client ManagersClient) listBySubscriptionNextResults(ctx context.Context, lastResults ManagerListResult) (result ManagerListResult, err error) { + req, err := lastResults.managerListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "network.ManagersClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.ManagersClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ManagersClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client ManagersClient) ListBySubscriptionComplete(ctx context.Context, top *int32, skipToken string) (result ManagerListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagersClient.ListBySubscription") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBySubscription(ctx, top, skipToken) + return +} + +// Patch patch NetworkManager. +// Parameters: +// parameters - parameters supplied to specify which network manager is. +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +func (client ManagersClient) Patch(ctx context.Context, parameters PatchObject, resourceGroupName string, networkManagerName string) (result Manager, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagersClient.Patch") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PatchPreparer(ctx, parameters, resourceGroupName, networkManagerName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ManagersClient", "Patch", nil, "Failure preparing request") + return + } + + resp, err := client.PatchSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.ManagersClient", "Patch", resp, "Failure sending request") + return + } + + result, err = client.PatchResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ManagersClient", "Patch", resp, "Failure responding to request") + return + } + + return +} + +// PatchPreparer prepares the Patch request. +func (client ManagersClient) PatchPreparer(ctx context.Context, parameters PatchObject, resourceGroupName string, networkManagerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PatchSender sends the Patch request. The method will close the +// http.Response Body if it receives an error. +func (client ManagersClient) PatchSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// PatchResponder handles the response to the Patch request. The method always +// closes the http.Response Body. +func (client ManagersClient) PatchResponder(resp *http.Response) (result Manager, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/models.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/models.go similarity index 89% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/models.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/models.go index fc6475f7f815..9695388e700f 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/models.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/models.go @@ -18,7 +18,7 @@ import ( ) // The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" +const fqdn = "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" // AadAuthenticationParameters AAD Vpn authentication type related parameters. type AadAuthenticationParameters struct { @@ -30,62 +30,178 @@ type AadAuthenticationParameters struct { AadIssuer *string `json:"aadIssuer,omitempty"` } -// AddressSpace addressSpace contains an array of IP address ranges that can be used by subnets of the -// virtual network. -type AddressSpace struct { - // AddressPrefixes - A list of address blocks reserved for this virtual network in CIDR notation. - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` +// Action action to be taken on a route matching a RouteMap criterion. +type Action struct { + // Type - Type of action to be taken. Supported types are 'Remove', 'Add', 'Replace', and 'Drop.'. Possible values include: 'RouteMapActionTypeUnknown', 'RouteMapActionTypeRemove', 'RouteMapActionTypeAdd', 'RouteMapActionTypeReplace', 'RouteMapActionTypeDrop' + Type RouteMapActionType `json:"type,omitempty"` + // Parameters - List of parameters relevant to the action.For instance if type is drop then parameters has list of prefixes to be dropped.If type is add, parameters would have list of ASN numbers to be added + Parameters *[]Parameter `json:"parameters,omitempty"` } -// ApplicationGateway application gateway resource. -type ApplicationGateway struct { - autorest.Response `json:"-"` - // ApplicationGatewayPropertiesFormat - Properties of the application gateway. - *ApplicationGatewayPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Zones - A list of availability zones denoting where the resource needs to come from. - Zones *[]string `json:"zones,omitempty"` - // Identity - The identity of the application gateway, if configured. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` +// BasicActiveBaseSecurityAdminRule network base admin rule. +type BasicActiveBaseSecurityAdminRule interface { + AsActiveSecurityAdminRule() (*ActiveSecurityAdminRule, bool) + AsActiveDefaultSecurityAdminRule() (*ActiveDefaultSecurityAdminRule, bool) + AsActiveBaseSecurityAdminRule() (*ActiveBaseSecurityAdminRule, bool) +} + +// ActiveBaseSecurityAdminRule network base admin rule. +type ActiveBaseSecurityAdminRule struct { // ID - Resource ID. ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. - Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` + // CommitTime - Deployment time string. + CommitTime *date.Time `json:"commitTime,omitempty"` + // Region - Deployment region. + Region *string `json:"region,omitempty"` + // ConfigurationDescription - A description of the security admin configuration. + ConfigurationDescription *string `json:"configurationDescription,omitempty"` + // RuleCollectionDescription - A description of the rule collection. + RuleCollectionDescription *string `json:"ruleCollectionDescription,omitempty"` + // RuleCollectionAppliesToGroups - Groups for rule collection + RuleCollectionAppliesToGroups *[]ManagerSecurityGroupItem `json:"ruleCollectionAppliesToGroups,omitempty"` + // RuleGroups - Effective configuration groups. + RuleGroups *[]ConfigurationGroup `json:"ruleGroups,omitempty"` + // Kind - Possible values include: 'KindActiveBaseSecurityAdminRule', 'KindCustom', 'KindDefault' + Kind Kind `json:"kind,omitempty"` +} + +func unmarshalBasicActiveBaseSecurityAdminRule(body []byte) (BasicActiveBaseSecurityAdminRule, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindCustom): + var asar ActiveSecurityAdminRule + err := json.Unmarshal(body, &asar) + return asar, err + case string(KindDefault): + var adsar ActiveDefaultSecurityAdminRule + err := json.Unmarshal(body, &adsar) + return adsar, err + default: + var absar ActiveBaseSecurityAdminRule + err := json.Unmarshal(body, &absar) + return absar, err + } } +func unmarshalBasicActiveBaseSecurityAdminRuleArray(body []byte) ([]BasicActiveBaseSecurityAdminRule, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } -// MarshalJSON is the custom marshaler for ApplicationGateway. -func (ag ApplicationGateway) MarshalJSON() ([]byte, error) { + absarArray := make([]BasicActiveBaseSecurityAdminRule, len(rawMessages)) + + for index, rawMessage := range rawMessages { + absar, err := unmarshalBasicActiveBaseSecurityAdminRule(*rawMessage) + if err != nil { + return nil, err + } + absarArray[index] = absar + } + return absarArray, nil +} + +// MarshalJSON is the custom marshaler for ActiveBaseSecurityAdminRule. +func (absar ActiveBaseSecurityAdminRule) MarshalJSON() ([]byte, error) { + absar.Kind = KindActiveBaseSecurityAdminRule objectMap := make(map[string]interface{}) - if ag.ApplicationGatewayPropertiesFormat != nil { - objectMap["properties"] = ag.ApplicationGatewayPropertiesFormat + if absar.ID != nil { + objectMap["id"] = absar.ID } - if ag.Zones != nil { - objectMap["zones"] = ag.Zones + if absar.CommitTime != nil { + objectMap["commitTime"] = absar.CommitTime } - if ag.Identity != nil { - objectMap["identity"] = ag.Identity + if absar.Region != nil { + objectMap["region"] = absar.Region } - if ag.ID != nil { - objectMap["id"] = ag.ID + if absar.ConfigurationDescription != nil { + objectMap["configurationDescription"] = absar.ConfigurationDescription } - if ag.Location != nil { - objectMap["location"] = ag.Location + if absar.RuleCollectionDescription != nil { + objectMap["ruleCollectionDescription"] = absar.RuleCollectionDescription } - if ag.Tags != nil { - objectMap["tags"] = ag.Tags + if absar.RuleCollectionAppliesToGroups != nil { + objectMap["ruleCollectionAppliesToGroups"] = absar.RuleCollectionAppliesToGroups + } + if absar.RuleGroups != nil { + objectMap["ruleGroups"] = absar.RuleGroups + } + if absar.Kind != "" { + objectMap["kind"] = absar.Kind } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ApplicationGateway struct. -func (ag *ApplicationGateway) UnmarshalJSON(body []byte) error { +// AsActiveSecurityAdminRule is the BasicActiveBaseSecurityAdminRule implementation for ActiveBaseSecurityAdminRule. +func (absar ActiveBaseSecurityAdminRule) AsActiveSecurityAdminRule() (*ActiveSecurityAdminRule, bool) { + return nil, false +} + +// AsActiveDefaultSecurityAdminRule is the BasicActiveBaseSecurityAdminRule implementation for ActiveBaseSecurityAdminRule. +func (absar ActiveBaseSecurityAdminRule) AsActiveDefaultSecurityAdminRule() (*ActiveDefaultSecurityAdminRule, bool) { + return nil, false +} + +// AsActiveBaseSecurityAdminRule is the BasicActiveBaseSecurityAdminRule implementation for ActiveBaseSecurityAdminRule. +func (absar ActiveBaseSecurityAdminRule) AsActiveBaseSecurityAdminRule() (*ActiveBaseSecurityAdminRule, bool) { + return &absar, true +} + +// AsBasicActiveBaseSecurityAdminRule is the BasicActiveBaseSecurityAdminRule implementation for ActiveBaseSecurityAdminRule. +func (absar ActiveBaseSecurityAdminRule) AsBasicActiveBaseSecurityAdminRule() (BasicActiveBaseSecurityAdminRule, bool) { + return &absar, true +} + +// ActiveConfigurationParameter effective Virtual Networks Parameter. +type ActiveConfigurationParameter struct { + // Regions - List of regions. + Regions *[]string `json:"regions,omitempty"` + // SkipToken - When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current request) to retrieve the next page of data. + SkipToken *string `json:"skipToken,omitempty"` +} + +// ActiveConnectivityConfiguration active connectivity configuration. +type ActiveConnectivityConfiguration struct { + // CommitTime - Deployment time string. + CommitTime *date.Time `json:"commitTime,omitempty"` + // Region - Deployment region. + Region *string `json:"region,omitempty"` + // ID - Connectivity configuration ID. + ID *string `json:"id,omitempty"` + // ConnectivityConfigurationProperties - Properties of a network manager connectivity configuration + *ConnectivityConfigurationProperties `json:"properties,omitempty"` + // ConfigurationGroups - Effective configuration groups. + ConfigurationGroups *[]ConfigurationGroup `json:"configurationGroups,omitempty"` +} + +// MarshalJSON is the custom marshaler for ActiveConnectivityConfiguration. +func (acc ActiveConnectivityConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if acc.CommitTime != nil { + objectMap["commitTime"] = acc.CommitTime + } + if acc.Region != nil { + objectMap["region"] = acc.Region + } + if acc.ID != nil { + objectMap["id"] = acc.ID + } + if acc.ConnectivityConfigurationProperties != nil { + objectMap["properties"] = acc.ConnectivityConfigurationProperties + } + if acc.ConfigurationGroups != nil { + objectMap["configurationGroups"] = acc.ConfigurationGroups + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ActiveConnectivityConfiguration struct. +func (acc *ActiveConnectivityConfiguration) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -93,41 +209,161 @@ func (ag *ApplicationGateway) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "properties": + case "commitTime": if v != nil { - var applicationGatewayPropertiesFormat ApplicationGatewayPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayPropertiesFormat) + var commitTime date.Time + err = json.Unmarshal(*v, &commitTime) if err != nil { return err } - ag.ApplicationGatewayPropertiesFormat = &applicationGatewayPropertiesFormat + acc.CommitTime = &commitTime } - case "etag": + case "region": if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) + var region string + err = json.Unmarshal(*v, ®ion) if err != nil { return err } - ag.Etag = &etag + acc.Region = ®ion } - case "zones": + case "id": if v != nil { - var zones []string - err = json.Unmarshal(*v, &zones) + var ID string + err = json.Unmarshal(*v, &ID) if err != nil { return err } - ag.Zones = &zones + acc.ID = &ID } - case "identity": + case "properties": if v != nil { - var identity ManagedServiceIdentity - err = json.Unmarshal(*v, &identity) + var connectivityConfigurationProperties ConnectivityConfigurationProperties + err = json.Unmarshal(*v, &connectivityConfigurationProperties) if err != nil { return err } - ag.Identity = &identity + acc.ConnectivityConfigurationProperties = &connectivityConfigurationProperties + } + case "configurationGroups": + if v != nil { + var configurationGroups []ConfigurationGroup + err = json.Unmarshal(*v, &configurationGroups) + if err != nil { + return err + } + acc.ConfigurationGroups = &configurationGroups + } + } + } + + return nil +} + +// ActiveConnectivityConfigurationsListResult result of the request to list active connectivity +// configurations. It contains a list of active connectivity configurations and a skiptoken to get the next +// set of results. +type ActiveConnectivityConfigurationsListResult struct { + autorest.Response `json:"-"` + // Value - Gets a page of active connectivity configurations. + Value *[]ActiveConnectivityConfiguration `json:"value,omitempty"` + // SkipToken - When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current request) to retrieve the next page of data. + SkipToken *string `json:"skipToken,omitempty"` +} + +// ActiveDefaultSecurityAdminRule network default admin rule. +type ActiveDefaultSecurityAdminRule struct { + // DefaultAdminPropertiesFormat - Indicates the properties of the default security admin rule + *DefaultAdminPropertiesFormat `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // CommitTime - Deployment time string. + CommitTime *date.Time `json:"commitTime,omitempty"` + // Region - Deployment region. + Region *string `json:"region,omitempty"` + // ConfigurationDescription - A description of the security admin configuration. + ConfigurationDescription *string `json:"configurationDescription,omitempty"` + // RuleCollectionDescription - A description of the rule collection. + RuleCollectionDescription *string `json:"ruleCollectionDescription,omitempty"` + // RuleCollectionAppliesToGroups - Groups for rule collection + RuleCollectionAppliesToGroups *[]ManagerSecurityGroupItem `json:"ruleCollectionAppliesToGroups,omitempty"` + // RuleGroups - Effective configuration groups. + RuleGroups *[]ConfigurationGroup `json:"ruleGroups,omitempty"` + // Kind - Possible values include: 'KindActiveBaseSecurityAdminRule', 'KindCustom', 'KindDefault' + Kind Kind `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for ActiveDefaultSecurityAdminRule. +func (adsar ActiveDefaultSecurityAdminRule) MarshalJSON() ([]byte, error) { + adsar.Kind = KindDefault + objectMap := make(map[string]interface{}) + if adsar.DefaultAdminPropertiesFormat != nil { + objectMap["properties"] = adsar.DefaultAdminPropertiesFormat + } + if adsar.ID != nil { + objectMap["id"] = adsar.ID + } + if adsar.CommitTime != nil { + objectMap["commitTime"] = adsar.CommitTime + } + if adsar.Region != nil { + objectMap["region"] = adsar.Region + } + if adsar.ConfigurationDescription != nil { + objectMap["configurationDescription"] = adsar.ConfigurationDescription + } + if adsar.RuleCollectionDescription != nil { + objectMap["ruleCollectionDescription"] = adsar.RuleCollectionDescription + } + if adsar.RuleCollectionAppliesToGroups != nil { + objectMap["ruleCollectionAppliesToGroups"] = adsar.RuleCollectionAppliesToGroups + } + if adsar.RuleGroups != nil { + objectMap["ruleGroups"] = adsar.RuleGroups + } + if adsar.Kind != "" { + objectMap["kind"] = adsar.Kind + } + return json.Marshal(objectMap) +} + +// AsActiveSecurityAdminRule is the BasicActiveBaseSecurityAdminRule implementation for ActiveDefaultSecurityAdminRule. +func (adsar ActiveDefaultSecurityAdminRule) AsActiveSecurityAdminRule() (*ActiveSecurityAdminRule, bool) { + return nil, false +} + +// AsActiveDefaultSecurityAdminRule is the BasicActiveBaseSecurityAdminRule implementation for ActiveDefaultSecurityAdminRule. +func (adsar ActiveDefaultSecurityAdminRule) AsActiveDefaultSecurityAdminRule() (*ActiveDefaultSecurityAdminRule, bool) { + return &adsar, true +} + +// AsActiveBaseSecurityAdminRule is the BasicActiveBaseSecurityAdminRule implementation for ActiveDefaultSecurityAdminRule. +func (adsar ActiveDefaultSecurityAdminRule) AsActiveBaseSecurityAdminRule() (*ActiveBaseSecurityAdminRule, bool) { + return nil, false +} + +// AsBasicActiveBaseSecurityAdminRule is the BasicActiveBaseSecurityAdminRule implementation for ActiveDefaultSecurityAdminRule. +func (adsar ActiveDefaultSecurityAdminRule) AsBasicActiveBaseSecurityAdminRule() (BasicActiveBaseSecurityAdminRule, bool) { + return &adsar, true +} + +// UnmarshalJSON is the custom unmarshaler for ActiveDefaultSecurityAdminRule struct. +func (adsar *ActiveDefaultSecurityAdminRule) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var defaultAdminPropertiesFormat DefaultAdminPropertiesFormat + err = json.Unmarshal(*v, &defaultAdminPropertiesFormat) + if err != nil { + return err + } + adsar.DefaultAdminPropertiesFormat = &defaultAdminPropertiesFormat } case "id": if v != nil { @@ -136,43 +372,70 @@ func (ag *ApplicationGateway) UnmarshalJSON(body []byte) error { if err != nil { return err } - ag.ID = &ID + adsar.ID = &ID } - case "name": + case "commitTime": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var commitTime date.Time + err = json.Unmarshal(*v, &commitTime) if err != nil { return err } - ag.Name = &name + adsar.CommitTime = &commitTime } - case "type": + case "region": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var region string + err = json.Unmarshal(*v, ®ion) if err != nil { return err } - ag.Type = &typeVar + adsar.Region = ®ion } - case "location": + case "configurationDescription": if v != nil { - var location string - err = json.Unmarshal(*v, &location) + var configurationDescription string + err = json.Unmarshal(*v, &configurationDescription) if err != nil { return err } - ag.Location = &location + adsar.ConfigurationDescription = &configurationDescription } - case "tags": + case "ruleCollectionDescription": if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) + var ruleCollectionDescription string + err = json.Unmarshal(*v, &ruleCollectionDescription) if err != nil { return err } - ag.Tags = tags + adsar.RuleCollectionDescription = &ruleCollectionDescription + } + case "ruleCollectionAppliesToGroups": + if v != nil { + var ruleCollectionAppliesToGroups []ManagerSecurityGroupItem + err = json.Unmarshal(*v, &ruleCollectionAppliesToGroups) + if err != nil { + return err + } + adsar.RuleCollectionAppliesToGroups = &ruleCollectionAppliesToGroups + } + case "ruleGroups": + if v != nil { + var ruleGroups []ConfigurationGroup + err = json.Unmarshal(*v, &ruleGroups) + if err != nil { + return err + } + adsar.RuleGroups = &ruleGroups + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + adsar.Kind = kind } } } @@ -180,37 +443,84 @@ func (ag *ApplicationGateway) UnmarshalJSON(body []byte) error { return nil } -// ApplicationGatewayAuthenticationCertificate authentication certificates of an application gateway. -type ApplicationGatewayAuthenticationCertificate struct { - // ApplicationGatewayAuthenticationCertificatePropertiesFormat - Properties of the application gateway authentication certificate. - *ApplicationGatewayAuthenticationCertificatePropertiesFormat `json:"properties,omitempty"` - // Name - Name of the authentication certificate that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` +// ActiveSecurityAdminRule network admin rule. +type ActiveSecurityAdminRule struct { + // AdminPropertiesFormat - Indicates the properties of the security admin rule + *AdminPropertiesFormat `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` + // CommitTime - Deployment time string. + CommitTime *date.Time `json:"commitTime,omitempty"` + // Region - Deployment region. + Region *string `json:"region,omitempty"` + // ConfigurationDescription - A description of the security admin configuration. + ConfigurationDescription *string `json:"configurationDescription,omitempty"` + // RuleCollectionDescription - A description of the rule collection. + RuleCollectionDescription *string `json:"ruleCollectionDescription,omitempty"` + // RuleCollectionAppliesToGroups - Groups for rule collection + RuleCollectionAppliesToGroups *[]ManagerSecurityGroupItem `json:"ruleCollectionAppliesToGroups,omitempty"` + // RuleGroups - Effective configuration groups. + RuleGroups *[]ConfigurationGroup `json:"ruleGroups,omitempty"` + // Kind - Possible values include: 'KindActiveBaseSecurityAdminRule', 'KindCustom', 'KindDefault' + Kind Kind `json:"kind,omitempty"` } -// MarshalJSON is the custom marshaler for ApplicationGatewayAuthenticationCertificate. -func (agac ApplicationGatewayAuthenticationCertificate) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ActiveSecurityAdminRule. +func (asar ActiveSecurityAdminRule) MarshalJSON() ([]byte, error) { + asar.Kind = KindCustom objectMap := make(map[string]interface{}) - if agac.ApplicationGatewayAuthenticationCertificatePropertiesFormat != nil { - objectMap["properties"] = agac.ApplicationGatewayAuthenticationCertificatePropertiesFormat + if asar.AdminPropertiesFormat != nil { + objectMap["properties"] = asar.AdminPropertiesFormat } - if agac.Name != nil { - objectMap["name"] = agac.Name + if asar.ID != nil { + objectMap["id"] = asar.ID } - if agac.ID != nil { - objectMap["id"] = agac.ID + if asar.CommitTime != nil { + objectMap["commitTime"] = asar.CommitTime + } + if asar.Region != nil { + objectMap["region"] = asar.Region + } + if asar.ConfigurationDescription != nil { + objectMap["configurationDescription"] = asar.ConfigurationDescription + } + if asar.RuleCollectionDescription != nil { + objectMap["ruleCollectionDescription"] = asar.RuleCollectionDescription + } + if asar.RuleCollectionAppliesToGroups != nil { + objectMap["ruleCollectionAppliesToGroups"] = asar.RuleCollectionAppliesToGroups + } + if asar.RuleGroups != nil { + objectMap["ruleGroups"] = asar.RuleGroups + } + if asar.Kind != "" { + objectMap["kind"] = asar.Kind } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayAuthenticationCertificate struct. -func (agac *ApplicationGatewayAuthenticationCertificate) UnmarshalJSON(body []byte) error { +// AsActiveSecurityAdminRule is the BasicActiveBaseSecurityAdminRule implementation for ActiveSecurityAdminRule. +func (asar ActiveSecurityAdminRule) AsActiveSecurityAdminRule() (*ActiveSecurityAdminRule, bool) { + return &asar, true +} + +// AsActiveDefaultSecurityAdminRule is the BasicActiveBaseSecurityAdminRule implementation for ActiveSecurityAdminRule. +func (asar ActiveSecurityAdminRule) AsActiveDefaultSecurityAdminRule() (*ActiveDefaultSecurityAdminRule, bool) { + return nil, false +} + +// AsActiveBaseSecurityAdminRule is the BasicActiveBaseSecurityAdminRule implementation for ActiveSecurityAdminRule. +func (asar ActiveSecurityAdminRule) AsActiveBaseSecurityAdminRule() (*ActiveBaseSecurityAdminRule, bool) { + return nil, false +} + +// AsBasicActiveBaseSecurityAdminRule is the BasicActiveBaseSecurityAdminRule implementation for ActiveSecurityAdminRule. +func (asar ActiveSecurityAdminRule) AsBasicActiveBaseSecurityAdminRule() (BasicActiveBaseSecurityAdminRule, bool) { + return &asar, true +} + +// UnmarshalJSON is the custom unmarshaler for ActiveSecurityAdminRule struct. +func (asar *ActiveSecurityAdminRule) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -220,48 +530,84 @@ func (agac *ApplicationGatewayAuthenticationCertificate) UnmarshalJSON(body []by switch k { case "properties": if v != nil { - var applicationGatewayAuthenticationCertificatePropertiesFormat ApplicationGatewayAuthenticationCertificatePropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayAuthenticationCertificatePropertiesFormat) + var adminPropertiesFormat AdminPropertiesFormat + err = json.Unmarshal(*v, &adminPropertiesFormat) if err != nil { return err } - agac.ApplicationGatewayAuthenticationCertificatePropertiesFormat = &applicationGatewayAuthenticationCertificatePropertiesFormat + asar.AdminPropertiesFormat = &adminPropertiesFormat } - case "name": + case "id": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var ID string + err = json.Unmarshal(*v, &ID) if err != nil { return err } - agac.Name = &name + asar.ID = &ID } - case "etag": + case "commitTime": if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) + var commitTime date.Time + err = json.Unmarshal(*v, &commitTime) if err != nil { return err } - agac.Etag = &etag + asar.CommitTime = &commitTime } - case "type": + case "region": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var region string + err = json.Unmarshal(*v, ®ion) if err != nil { return err } - agac.Type = &typeVar + asar.Region = ®ion } - case "id": + case "configurationDescription": if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) + var configurationDescription string + err = json.Unmarshal(*v, &configurationDescription) if err != nil { return err } - agac.ID = &ID + asar.ConfigurationDescription = &configurationDescription + } + case "ruleCollectionDescription": + if v != nil { + var ruleCollectionDescription string + err = json.Unmarshal(*v, &ruleCollectionDescription) + if err != nil { + return err + } + asar.RuleCollectionDescription = &ruleCollectionDescription + } + case "ruleCollectionAppliesToGroups": + if v != nil { + var ruleCollectionAppliesToGroups []ManagerSecurityGroupItem + err = json.Unmarshal(*v, &ruleCollectionAppliesToGroups) + if err != nil { + return err + } + asar.RuleCollectionAppliesToGroups = &ruleCollectionAppliesToGroups + } + case "ruleGroups": + if v != nil { + var ruleGroups []ConfigurationGroup + err = json.Unmarshal(*v, &ruleGroups) + if err != nil { + return err + } + asar.RuleGroups = &ruleGroups + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + asar.Kind = kind } } } @@ -269,70 +615,173 @@ func (agac *ApplicationGatewayAuthenticationCertificate) UnmarshalJSON(body []by return nil } -// ApplicationGatewayAuthenticationCertificatePropertiesFormat authentication certificates properties of an -// application gateway. -type ApplicationGatewayAuthenticationCertificatePropertiesFormat struct { - // Data - Certificate public data. - Data *string `json:"data,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the authentication certificate resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' +// ActiveSecurityAdminRulesListResult result of the request to list active security admin rules. It +// contains a list of active security admin rules and a skiptoken to get the next set of results. +type ActiveSecurityAdminRulesListResult struct { + autorest.Response `json:"-"` + // Value - Gets a page of active security admin rules. + Value *[]BasicActiveBaseSecurityAdminRule `json:"value,omitempty"` + // SkipToken - When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current request) to retrieve the next page of data. + SkipToken *string `json:"skipToken,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ActiveSecurityAdminRulesListResult struct. +func (asarlr *ActiveSecurityAdminRulesListResult) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "value": + if v != nil { + value, err := unmarshalBasicActiveBaseSecurityAdminRuleArray(*v) + if err != nil { + return err + } + asarlr.Value = &value + } + case "skipToken": + if v != nil { + var skipToken string + err = json.Unmarshal(*v, &skipToken) + if err != nil { + return err + } + asarlr.SkipToken = &skipToken + } + } + } + + return nil +} + +// AddressPrefixItem address prefix item. +type AddressPrefixItem struct { + // AddressPrefix - Address prefix. + AddressPrefix *string `json:"addressPrefix,omitempty"` + // AddressPrefixType - Address prefix type. Possible values include: 'IPPrefix', 'ServiceTag' + AddressPrefixType AddressPrefixType `json:"addressPrefixType,omitempty"` +} + +// AddressSpace addressSpace contains an array of IP address ranges that can be used by subnets of the +// virtual network. +type AddressSpace struct { + // AddressPrefixes - A list of address blocks reserved for this virtual network in CIDR notation. + AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` +} + +// AdminPropertiesFormat security admin rule resource. +type AdminPropertiesFormat struct { + // Description - A description for this rule. Restricted to 140 chars. + Description *string `json:"description,omitempty"` + // Protocol - Network protocol this rule applies to. Possible values include: 'SecurityConfigurationRuleProtocolTCP', 'SecurityConfigurationRuleProtocolUDP', 'SecurityConfigurationRuleProtocolIcmp', 'SecurityConfigurationRuleProtocolEsp', 'SecurityConfigurationRuleProtocolAny', 'SecurityConfigurationRuleProtocolAh' + Protocol SecurityConfigurationRuleProtocol `json:"protocol,omitempty"` + // Sources - The CIDR or source IP ranges. + Sources *[]AddressPrefixItem `json:"sources,omitempty"` + // Destinations - The destination address prefixes. CIDR or destination IP ranges. + Destinations *[]AddressPrefixItem `json:"destinations,omitempty"` + // SourcePortRanges - The source port ranges. + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` + // DestinationPortRanges - The destination port ranges. + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + // Access - Indicates the access allowed for this particular rule. Possible values include: 'SecurityConfigurationRuleAccessAllow', 'SecurityConfigurationRuleAccessDeny', 'SecurityConfigurationRuleAccessAlwaysAllow' + Access SecurityConfigurationRuleAccess `json:"access,omitempty"` + // Priority - The priority of the rule. The value can be between 1 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule. + Priority *int32 `json:"priority,omitempty"` + // Direction - Indicates if the traffic matched against the rule in inbound or outbound. Possible values include: 'SecurityConfigurationRuleDirectionInbound', 'SecurityConfigurationRuleDirectionOutbound' + Direction SecurityConfigurationRuleDirection `json:"direction,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } -// MarshalJSON is the custom marshaler for ApplicationGatewayAuthenticationCertificatePropertiesFormat. -func (agacpf ApplicationGatewayAuthenticationCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for AdminPropertiesFormat. +func (apf AdminPropertiesFormat) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if agacpf.Data != nil { - objectMap["data"] = agacpf.Data + if apf.Description != nil { + objectMap["description"] = apf.Description + } + if apf.Protocol != "" { + objectMap["protocol"] = apf.Protocol + } + if apf.Sources != nil { + objectMap["sources"] = apf.Sources + } + if apf.Destinations != nil { + objectMap["destinations"] = apf.Destinations + } + if apf.SourcePortRanges != nil { + objectMap["sourcePortRanges"] = apf.SourcePortRanges + } + if apf.DestinationPortRanges != nil { + objectMap["destinationPortRanges"] = apf.DestinationPortRanges + } + if apf.Access != "" { + objectMap["access"] = apf.Access + } + if apf.Priority != nil { + objectMap["priority"] = apf.Priority + } + if apf.Direction != "" { + objectMap["direction"] = apf.Direction } return json.Marshal(objectMap) } -// ApplicationGatewayAutoscaleConfiguration application Gateway autoscale configuration. -type ApplicationGatewayAutoscaleConfiguration struct { - // MinCapacity - Lower bound on number of Application Gateway capacity. - MinCapacity *int32 `json:"minCapacity,omitempty"` - // MaxCapacity - Upper bound on number of Application Gateway capacity. - MaxCapacity *int32 `json:"maxCapacity,omitempty"` -} - -// ApplicationGatewayAvailableSslOptions response for ApplicationGatewayAvailableSslOptions API service -// call. -type ApplicationGatewayAvailableSslOptions struct { - autorest.Response `json:"-"` - // ApplicationGatewayAvailableSslOptionsPropertiesFormat - Properties of the application gateway available SSL options. - *ApplicationGatewayAvailableSslOptionsPropertiesFormat `json:"properties,omitempty"` - // ID - Resource ID. +// AdminRule network admin rule. +type AdminRule struct { + // AdminPropertiesFormat - Indicates the properties of the security admin rule + *AdminPropertiesFormat `json:"properties,omitempty"` + // SystemData - READ-ONLY; The system metadata related to this resource. + SystemData *SystemData `json:"systemData,omitempty"` + // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type. Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // Kind - Possible values include: 'KindBasicBaseAdminRuleKindBaseAdminRule', 'KindBasicBaseAdminRuleKindCustom', 'KindBasicBaseAdminRuleKindDefault' + Kind KindBasicBaseAdminRule `json:"kind,omitempty"` } -// MarshalJSON is the custom marshaler for ApplicationGatewayAvailableSslOptions. -func (agaso ApplicationGatewayAvailableSslOptions) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for AdminRule. +func (ar AdminRule) MarshalJSON() ([]byte, error) { + ar.Kind = KindBasicBaseAdminRuleKindCustom objectMap := make(map[string]interface{}) - if agaso.ApplicationGatewayAvailableSslOptionsPropertiesFormat != nil { - objectMap["properties"] = agaso.ApplicationGatewayAvailableSslOptionsPropertiesFormat - } - if agaso.ID != nil { - objectMap["id"] = agaso.ID + if ar.AdminPropertiesFormat != nil { + objectMap["properties"] = ar.AdminPropertiesFormat } - if agaso.Location != nil { - objectMap["location"] = agaso.Location - } - if agaso.Tags != nil { - objectMap["tags"] = agaso.Tags + if ar.Kind != "" { + objectMap["kind"] = ar.Kind } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayAvailableSslOptions struct. -func (agaso *ApplicationGatewayAvailableSslOptions) UnmarshalJSON(body []byte) error { +// AsAdminRule is the BasicBaseAdminRule implementation for AdminRule. +func (ar AdminRule) AsAdminRule() (*AdminRule, bool) { + return &ar, true +} + +// AsDefaultAdminRule is the BasicBaseAdminRule implementation for AdminRule. +func (ar AdminRule) AsDefaultAdminRule() (*DefaultAdminRule, bool) { + return nil, false +} + +// AsBaseAdminRule is the BasicBaseAdminRule implementation for AdminRule. +func (ar AdminRule) AsBaseAdminRule() (*BaseAdminRule, bool) { + return nil, false +} + +// AsBasicBaseAdminRule is the BasicBaseAdminRule implementation for AdminRule. +func (ar AdminRule) AsBasicBaseAdminRule() (BasicBaseAdminRule, bool) { + return &ar, true +} + +// UnmarshalJSON is the custom unmarshaler for AdminRule struct. +func (ar *AdminRule) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -342,12 +791,30 @@ func (agaso *ApplicationGatewayAvailableSslOptions) UnmarshalJSON(body []byte) e switch k { case "properties": if v != nil { - var applicationGatewayAvailableSslOptionsPropertiesFormat ApplicationGatewayAvailableSslOptionsPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayAvailableSslOptionsPropertiesFormat) + var adminPropertiesFormat AdminPropertiesFormat + err = json.Unmarshal(*v, &adminPropertiesFormat) if err != nil { return err } - agaso.ApplicationGatewayAvailableSslOptionsPropertiesFormat = &applicationGatewayAvailableSslOptionsPropertiesFormat + ar.AdminPropertiesFormat = &adminPropertiesFormat + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + ar.SystemData = &systemData + } + case "kind": + if v != nil { + var kind KindBasicBaseAdminRule + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ar.Kind = kind } case "id": if v != nil { @@ -356,7 +823,7 @@ func (agaso *ApplicationGatewayAvailableSslOptions) UnmarshalJSON(body []byte) e if err != nil { return err } - agaso.ID = &ID + ar.ID = &ID } case "name": if v != nil { @@ -365,7 +832,7 @@ func (agaso *ApplicationGatewayAvailableSslOptions) UnmarshalJSON(body []byte) e if err != nil { return err } - agaso.Name = &name + ar.Name = &name } case "type": if v != nil { @@ -374,25 +841,111 @@ func (agaso *ApplicationGatewayAvailableSslOptions) UnmarshalJSON(body []byte) e if err != nil { return err } - agaso.Type = &typeVar + ar.Type = &typeVar } - case "location": + case "etag": if v != nil { - var location string - err = json.Unmarshal(*v, &location) + var etag string + err = json.Unmarshal(*v, &etag) if err != nil { return err } - agaso.Location = &location + ar.Etag = &etag } - case "tags": + } + } + + return nil +} + +// AdminRuleCollection defines the admin rule collection. +type AdminRuleCollection struct { + autorest.Response `json:"-"` + // AdminRuleCollectionPropertiesFormat - Indicates the properties for the network manager admin rule collection. + *AdminRuleCollectionPropertiesFormat `json:"properties,omitempty"` + // SystemData - READ-ONLY; The system metadata related to this resource. + SystemData *SystemData `json:"systemData,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for AdminRuleCollection. +func (arc AdminRuleCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if arc.AdminRuleCollectionPropertiesFormat != nil { + objectMap["properties"] = arc.AdminRuleCollectionPropertiesFormat + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AdminRuleCollection struct. +func (arc *AdminRuleCollection) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) + var adminRuleCollectionPropertiesFormat AdminRuleCollectionPropertiesFormat + err = json.Unmarshal(*v, &adminRuleCollectionPropertiesFormat) if err != nil { return err } - agaso.Tags = tags + arc.AdminRuleCollectionPropertiesFormat = &adminRuleCollectionPropertiesFormat + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + arc.SystemData = &systemData + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + arc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + arc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + arc.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + arc.Etag = &etag } } } @@ -400,41 +953,27 @@ func (agaso *ApplicationGatewayAvailableSslOptions) UnmarshalJSON(body []byte) e return nil } -// ApplicationGatewayAvailableSslOptionsPropertiesFormat properties of -// ApplicationGatewayAvailableSslOptions. -type ApplicationGatewayAvailableSslOptionsPropertiesFormat struct { - // PredefinedPolicies - List of available Ssl predefined policy. - PredefinedPolicies *[]SubResource `json:"predefinedPolicies,omitempty"` - // DefaultPolicy - Name of the Ssl predefined policy applied by default to application gateway. Possible values include: 'ApplicationGatewaySslPolicyNameAppGwSslPolicy20150501', 'ApplicationGatewaySslPolicyNameAppGwSslPolicy20170401', 'ApplicationGatewaySslPolicyNameAppGwSslPolicy20170401S' - DefaultPolicy ApplicationGatewaySslPolicyName `json:"defaultPolicy,omitempty"` - // AvailableCipherSuites - List of available Ssl cipher suites. - AvailableCipherSuites *[]ApplicationGatewaySslCipherSuite `json:"availableCipherSuites,omitempty"` - // AvailableProtocols - List of available Ssl protocols. - AvailableProtocols *[]ApplicationGatewaySslProtocol `json:"availableProtocols,omitempty"` -} - -// ApplicationGatewayAvailableSslPredefinedPolicies response for ApplicationGatewayAvailableSslOptions API -// service call. -type ApplicationGatewayAvailableSslPredefinedPolicies struct { +// AdminRuleCollectionListResult security admin configuration rule collection list result. +type AdminRuleCollectionListResult struct { autorest.Response `json:"-"` - // Value - List of available Ssl predefined policy. - Value *[]ApplicationGatewaySslPredefinedPolicy `json:"value,omitempty"` - // NextLink - URL to get the next set of results. + // Value - A list of network manager security admin configuration rule collections + Value *[]AdminRuleCollection `json:"value,omitempty"` + // NextLink - Gets the URL to get the next set of results. NextLink *string `json:"nextLink,omitempty"` } -// ApplicationGatewayAvailableSslPredefinedPoliciesIterator provides access to a complete listing of -// ApplicationGatewaySslPredefinedPolicy values. -type ApplicationGatewayAvailableSslPredefinedPoliciesIterator struct { +// AdminRuleCollectionListResultIterator provides access to a complete listing of AdminRuleCollection +// values. +type AdminRuleCollectionListResultIterator struct { i int - page ApplicationGatewayAvailableSslPredefinedPoliciesPage + page AdminRuleCollectionListResultPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *ApplicationGatewayAvailableSslPredefinedPoliciesIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *AdminRuleCollectionListResultIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayAvailableSslPredefinedPoliciesIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/AdminRuleCollectionListResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -459,68 +998,67 @@ func (iter *ApplicationGatewayAvailableSslPredefinedPoliciesIterator) NextWithCo // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *ApplicationGatewayAvailableSslPredefinedPoliciesIterator) Next() error { +func (iter *AdminRuleCollectionListResultIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ApplicationGatewayAvailableSslPredefinedPoliciesIterator) NotDone() bool { +func (iter AdminRuleCollectionListResultIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter ApplicationGatewayAvailableSslPredefinedPoliciesIterator) Response() ApplicationGatewayAvailableSslPredefinedPolicies { +func (iter AdminRuleCollectionListResultIterator) Response() AdminRuleCollectionListResult { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter ApplicationGatewayAvailableSslPredefinedPoliciesIterator) Value() ApplicationGatewaySslPredefinedPolicy { +func (iter AdminRuleCollectionListResultIterator) Value() AdminRuleCollection { if !iter.page.NotDone() { - return ApplicationGatewaySslPredefinedPolicy{} + return AdminRuleCollection{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the ApplicationGatewayAvailableSslPredefinedPoliciesIterator type. -func NewApplicationGatewayAvailableSslPredefinedPoliciesIterator(page ApplicationGatewayAvailableSslPredefinedPoliciesPage) ApplicationGatewayAvailableSslPredefinedPoliciesIterator { - return ApplicationGatewayAvailableSslPredefinedPoliciesIterator{page: page} +// Creates a new instance of the AdminRuleCollectionListResultIterator type. +func NewAdminRuleCollectionListResultIterator(page AdminRuleCollectionListResultPage) AdminRuleCollectionListResultIterator { + return AdminRuleCollectionListResultIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (agaspp ApplicationGatewayAvailableSslPredefinedPolicies) IsEmpty() bool { - return agaspp.Value == nil || len(*agaspp.Value) == 0 +func (arclr AdminRuleCollectionListResult) IsEmpty() bool { + return arclr.Value == nil || len(*arclr.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (agaspp ApplicationGatewayAvailableSslPredefinedPolicies) hasNextLink() bool { - return agaspp.NextLink != nil && len(*agaspp.NextLink) != 0 +func (arclr AdminRuleCollectionListResult) hasNextLink() bool { + return arclr.NextLink != nil && len(*arclr.NextLink) != 0 } -// applicationGatewayAvailableSslPredefinedPoliciesPreparer prepares a request to retrieve the next set of results. +// adminRuleCollectionListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (agaspp ApplicationGatewayAvailableSslPredefinedPolicies) applicationGatewayAvailableSslPredefinedPoliciesPreparer(ctx context.Context) (*http.Request, error) { - if !agaspp.hasNextLink() { +func (arclr AdminRuleCollectionListResult) adminRuleCollectionListResultPreparer(ctx context.Context) (*http.Request, error) { + if !arclr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(agaspp.NextLink))) + autorest.WithBaseURL(to.String(arclr.NextLink))) } -// ApplicationGatewayAvailableSslPredefinedPoliciesPage contains a page of -// ApplicationGatewaySslPredefinedPolicy values. -type ApplicationGatewayAvailableSslPredefinedPoliciesPage struct { - fn func(context.Context, ApplicationGatewayAvailableSslPredefinedPolicies) (ApplicationGatewayAvailableSslPredefinedPolicies, error) - agaspp ApplicationGatewayAvailableSslPredefinedPolicies +// AdminRuleCollectionListResultPage contains a page of AdminRuleCollection values. +type AdminRuleCollectionListResultPage struct { + fn func(context.Context, AdminRuleCollectionListResult) (AdminRuleCollectionListResult, error) + arclr AdminRuleCollectionListResult } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *ApplicationGatewayAvailableSslPredefinedPoliciesPage) NextWithContext(ctx context.Context) (err error) { +func (page *AdminRuleCollectionListResultPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayAvailableSslPredefinedPoliciesPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/AdminRuleCollectionListResultPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -530,11 +1068,11 @@ func (page *ApplicationGatewayAvailableSslPredefinedPoliciesPage) NextWithContex }() } for { - next, err := page.fn(ctx, page.agaspp) + next, err := page.fn(ctx, page.arclr) if err != nil { return err } - page.agaspp = next + page.arclr = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -545,83 +1083,372 @@ func (page *ApplicationGatewayAvailableSslPredefinedPoliciesPage) NextWithContex // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *ApplicationGatewayAvailableSslPredefinedPoliciesPage) Next() error { +func (page *AdminRuleCollectionListResultPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ApplicationGatewayAvailableSslPredefinedPoliciesPage) NotDone() bool { - return !page.agaspp.IsEmpty() +func (page AdminRuleCollectionListResultPage) NotDone() bool { + return !page.arclr.IsEmpty() } // Response returns the raw server response from the last page request. -func (page ApplicationGatewayAvailableSslPredefinedPoliciesPage) Response() ApplicationGatewayAvailableSslPredefinedPolicies { - return page.agaspp +func (page AdminRuleCollectionListResultPage) Response() AdminRuleCollectionListResult { + return page.arclr } // Values returns the slice of values for the current page or nil if there are no values. -func (page ApplicationGatewayAvailableSslPredefinedPoliciesPage) Values() []ApplicationGatewaySslPredefinedPolicy { - if page.agaspp.IsEmpty() { +func (page AdminRuleCollectionListResultPage) Values() []AdminRuleCollection { + if page.arclr.IsEmpty() { return nil } - return *page.agaspp.Value + return *page.arclr.Value } -// Creates a new instance of the ApplicationGatewayAvailableSslPredefinedPoliciesPage type. -func NewApplicationGatewayAvailableSslPredefinedPoliciesPage(cur ApplicationGatewayAvailableSslPredefinedPolicies, getNextPage func(context.Context, ApplicationGatewayAvailableSslPredefinedPolicies) (ApplicationGatewayAvailableSslPredefinedPolicies, error)) ApplicationGatewayAvailableSslPredefinedPoliciesPage { - return ApplicationGatewayAvailableSslPredefinedPoliciesPage{ - fn: getNextPage, - agaspp: cur, +// Creates a new instance of the AdminRuleCollectionListResultPage type. +func NewAdminRuleCollectionListResultPage(cur AdminRuleCollectionListResult, getNextPage func(context.Context, AdminRuleCollectionListResult) (AdminRuleCollectionListResult, error)) AdminRuleCollectionListResultPage { + return AdminRuleCollectionListResultPage{ + fn: getNextPage, + arclr: cur, } } -// ApplicationGatewayAvailableWafRuleSetsResult response for ApplicationGatewayAvailableWafRuleSets API -// service call. -type ApplicationGatewayAvailableWafRuleSetsResult struct { +// AdminRuleCollectionPropertiesFormat defines the admin rule collection properties. +type AdminRuleCollectionPropertiesFormat struct { + // Description - A description of the admin rule collection. + Description *string `json:"description,omitempty"` + // AppliesToGroups - Groups for configuration + AppliesToGroups *[]ManagerSecurityGroupItem `json:"appliesToGroups,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for AdminRuleCollectionPropertiesFormat. +func (arcpf AdminRuleCollectionPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if arcpf.Description != nil { + objectMap["description"] = arcpf.Description + } + if arcpf.AppliesToGroups != nil { + objectMap["appliesToGroups"] = arcpf.AppliesToGroups + } + return json.Marshal(objectMap) +} + +// AdminRuleCollectionsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AdminRuleCollectionsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AdminRuleCollectionsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AdminRuleCollectionsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AdminRuleCollectionsDeleteFuture.Result. +func (future *AdminRuleCollectionsDeleteFuture) result(client AdminRuleCollectionsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AdminRuleCollectionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.AdminRuleCollectionsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// AdminRuleListResult security configuration admin rule list result. +type AdminRuleListResult struct { autorest.Response `json:"-"` - // Value - The list of application gateway rule sets. - Value *[]ApplicationGatewayFirewallRuleSet `json:"value,omitempty"` + // Value - A list of admin rules + Value *[]BasicBaseAdminRule `json:"value,omitempty"` + // NextLink - The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` } -// ApplicationGatewayBackendAddress backend address of an application gateway. -type ApplicationGatewayBackendAddress struct { - // Fqdn - Fully qualified domain name (FQDN). - Fqdn *string `json:"fqdn,omitempty"` - // IPAddress - IP address. - IPAddress *string `json:"ipAddress,omitempty"` +// UnmarshalJSON is the custom unmarshaler for AdminRuleListResult struct. +func (arlr *AdminRuleListResult) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "value": + if v != nil { + value, err := unmarshalBasicBaseAdminRuleArray(*v) + if err != nil { + return err + } + arlr.Value = &value + } + case "nextLink": + if v != nil { + var nextLink string + err = json.Unmarshal(*v, &nextLink) + if err != nil { + return err + } + arlr.NextLink = &nextLink + } + } + } + + return nil } -// ApplicationGatewayBackendAddressPool backend Address Pool of an application gateway. -type ApplicationGatewayBackendAddressPool struct { - // ApplicationGatewayBackendAddressPoolPropertiesFormat - Properties of the application gateway backend address pool. - *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the backend address pool that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` +// AdminRuleListResultIterator provides access to a complete listing of BaseAdminRule values. +type AdminRuleListResultIterator struct { + i int + page AdminRuleListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AdminRuleListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AdminRuleListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *AdminRuleListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AdminRuleListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AdminRuleListResultIterator) Response() AdminRuleListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AdminRuleListResultIterator) Value() BasicBaseAdminRule { + if !iter.page.NotDone() { + return BaseAdminRule{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AdminRuleListResultIterator type. +func NewAdminRuleListResultIterator(page AdminRuleListResultPage) AdminRuleListResultIterator { + return AdminRuleListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (arlr AdminRuleListResult) IsEmpty() bool { + return arlr.Value == nil || len(*arlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (arlr AdminRuleListResult) hasNextLink() bool { + return arlr.NextLink != nil && len(*arlr.NextLink) != 0 +} + +// adminRuleListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (arlr AdminRuleListResult) adminRuleListResultPreparer(ctx context.Context) (*http.Request, error) { + if !arlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(arlr.NextLink))) +} + +// AdminRuleListResultPage contains a page of BasicBaseAdminRule values. +type AdminRuleListResultPage struct { + fn func(context.Context, AdminRuleListResult) (AdminRuleListResult, error) + arlr AdminRuleListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AdminRuleListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AdminRuleListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.arlr) + if err != nil { + return err + } + page.arlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *AdminRuleListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AdminRuleListResultPage) NotDone() bool { + return !page.arlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AdminRuleListResultPage) Response() AdminRuleListResult { + return page.arlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AdminRuleListResultPage) Values() []BasicBaseAdminRule { + if page.arlr.IsEmpty() { + return nil + } + return *page.arlr.Value +} + +// Creates a new instance of the AdminRuleListResultPage type. +func NewAdminRuleListResultPage(cur AdminRuleListResult, getNextPage func(context.Context, AdminRuleListResult) (AdminRuleListResult, error)) AdminRuleListResultPage { + return AdminRuleListResultPage{ + fn: getNextPage, + arlr: cur, + } +} + +// AdminRulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AdminRulesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AdminRulesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AdminRulesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AdminRulesDeleteFuture.Result. +func (future *AdminRulesDeleteFuture) result(client AdminRulesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AdminRulesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.AdminRulesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ApplicationGateway application gateway resource. +type ApplicationGateway struct { + autorest.Response `json:"-"` + // ApplicationGatewayPropertiesFormat - Properties of the application gateway. + *ApplicationGatewayPropertiesFormat `json:"properties,omitempty"` // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` + // Zones - A list of availability zones denoting where the resource needs to come from. + Zones *[]string `json:"zones,omitempty"` + // Identity - The identity of the application gateway, if configured. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` } -// MarshalJSON is the custom marshaler for ApplicationGatewayBackendAddressPool. -func (agbap ApplicationGatewayBackendAddressPool) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ApplicationGateway. +func (ag ApplicationGateway) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat != nil { - objectMap["properties"] = agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat + if ag.ApplicationGatewayPropertiesFormat != nil { + objectMap["properties"] = ag.ApplicationGatewayPropertiesFormat } - if agbap.Name != nil { - objectMap["name"] = agbap.Name + if ag.Zones != nil { + objectMap["zones"] = ag.Zones } - if agbap.ID != nil { - objectMap["id"] = agbap.ID + if ag.Identity != nil { + objectMap["identity"] = ag.Identity + } + if ag.ID != nil { + objectMap["id"] = ag.ID + } + if ag.Location != nil { + objectMap["location"] = ag.Location + } + if ag.Tags != nil { + objectMap["tags"] = ag.Tags } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayBackendAddressPool struct. -func (agbap *ApplicationGatewayBackendAddressPool) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ApplicationGateway struct. +func (ag *ApplicationGateway) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -631,39 +1458,39 @@ func (agbap *ApplicationGatewayBackendAddressPool) UnmarshalJSON(body []byte) er switch k { case "properties": if v != nil { - var applicationGatewayBackendAddressPoolPropertiesFormat ApplicationGatewayBackendAddressPoolPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayBackendAddressPoolPropertiesFormat) + var applicationGatewayPropertiesFormat ApplicationGatewayPropertiesFormat + err = json.Unmarshal(*v, &applicationGatewayPropertiesFormat) if err != nil { return err } - agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat = &applicationGatewayBackendAddressPoolPropertiesFormat + ag.ApplicationGatewayPropertiesFormat = &applicationGatewayPropertiesFormat } - case "name": + case "etag": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var etag string + err = json.Unmarshal(*v, &etag) if err != nil { return err } - agbap.Name = &name + ag.Etag = &etag } - case "etag": + case "zones": if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) + var zones []string + err = json.Unmarshal(*v, &zones) if err != nil { return err } - agbap.Etag = &etag + ag.Zones = &zones } - case "type": + case "identity": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) if err != nil { return err } - agbap.Type = &typeVar + ag.Identity = &identity } case "id": if v != nil { @@ -672,7 +1499,43 @@ func (agbap *ApplicationGatewayBackendAddressPool) UnmarshalJSON(body []byte) er if err != nil { return err } - agbap.ID = &ID + ag.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ag.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ag.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ag.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ag.Tags = tags } } } @@ -680,75 +1543,11 @@ func (agbap *ApplicationGatewayBackendAddressPool) UnmarshalJSON(body []byte) er return nil } -// ApplicationGatewayBackendAddressPoolPropertiesFormat properties of Backend Address Pool of an -// application gateway. -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - // BackendIPConfigurations - READ-ONLY; Collection of references to IPs defined in network interfaces. - BackendIPConfigurations *[]InterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - // BackendAddresses - Backend addresses. - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the backend address pool resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` -} - -// MarshalJSON is the custom marshaler for ApplicationGatewayBackendAddressPoolPropertiesFormat. -func (agbappf ApplicationGatewayBackendAddressPoolPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agbappf.BackendAddresses != nil { - objectMap["backendAddresses"] = agbappf.BackendAddresses - } - return json.Marshal(objectMap) -} - -// ApplicationGatewayBackendHealth response for ApplicationGatewayBackendHealth API service call. -type ApplicationGatewayBackendHealth struct { - autorest.Response `json:"-"` - // BackendAddressPools - A list of ApplicationGatewayBackendHealthPool resources. - BackendAddressPools *[]ApplicationGatewayBackendHealthPool `json:"backendAddressPools,omitempty"` -} - -// ApplicationGatewayBackendHealthHTTPSettings application gateway BackendHealthHttp settings. -type ApplicationGatewayBackendHealthHTTPSettings struct { - // BackendHTTPSettings - Reference to an ApplicationGatewayBackendHttpSettings resource. - BackendHTTPSettings *ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettings,omitempty"` - // Servers - List of ApplicationGatewayBackendHealthServer resources. - Servers *[]ApplicationGatewayBackendHealthServer `json:"servers,omitempty"` -} - -// ApplicationGatewayBackendHealthOnDemand result of on demand test probe. -type ApplicationGatewayBackendHealthOnDemand struct { - autorest.Response `json:"-"` - // BackendAddressPool - Reference to an ApplicationGatewayBackendAddressPool resource. - BackendAddressPool *ApplicationGatewayBackendAddressPool `json:"backendAddressPool,omitempty"` - // BackendHealthHTTPSettings - Application gateway BackendHealthHttp settings. - BackendHealthHTTPSettings *ApplicationGatewayBackendHealthHTTPSettings `json:"backendHealthHttpSettings,omitempty"` -} - -// ApplicationGatewayBackendHealthPool application gateway BackendHealth pool. -type ApplicationGatewayBackendHealthPool struct { - // BackendAddressPool - Reference to an ApplicationGatewayBackendAddressPool resource. - BackendAddressPool *ApplicationGatewayBackendAddressPool `json:"backendAddressPool,omitempty"` - // BackendHTTPSettingsCollection - List of ApplicationGatewayBackendHealthHttpSettings resources. - BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHealthHTTPSettings `json:"backendHttpSettingsCollection,omitempty"` -} - -// ApplicationGatewayBackendHealthServer application gateway backendhealth http settings. -type ApplicationGatewayBackendHealthServer struct { - // Address - IP address or FQDN of backend server. - Address *string `json:"address,omitempty"` - // IPConfiguration - Reference to IP configuration of backend server. - IPConfiguration *InterfaceIPConfiguration `json:"ipConfiguration,omitempty"` - // Health - Health of backend server. Possible values include: 'ApplicationGatewayBackendHealthServerHealthUnknown', 'ApplicationGatewayBackendHealthServerHealthUp', 'ApplicationGatewayBackendHealthServerHealthDown', 'ApplicationGatewayBackendHealthServerHealthPartial', 'ApplicationGatewayBackendHealthServerHealthDraining' - Health ApplicationGatewayBackendHealthServerHealth `json:"health,omitempty"` - // HealthProbeLog - Health Probe Log. - HealthProbeLog *string `json:"healthProbeLog,omitempty"` -} - -// ApplicationGatewayBackendHTTPSettings backend address pool settings of an application gateway. -type ApplicationGatewayBackendHTTPSettings struct { - // ApplicationGatewayBackendHTTPSettingsPropertiesFormat - Properties of the application gateway backend HTTP settings. - *ApplicationGatewayBackendHTTPSettingsPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the backend http settings that is unique within an Application Gateway. +// ApplicationGatewayAuthenticationCertificate authentication certificates of an application gateway. +type ApplicationGatewayAuthenticationCertificate struct { + // ApplicationGatewayAuthenticationCertificatePropertiesFormat - Properties of the application gateway authentication certificate. + *ApplicationGatewayAuthenticationCertificatePropertiesFormat `json:"properties,omitempty"` + // Name - Name of the authentication certificate that is unique within an Application Gateway. Name *string `json:"name,omitempty"` // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` @@ -758,23 +1557,23 @@ type ApplicationGatewayBackendHTTPSettings struct { ID *string `json:"id,omitempty"` } -// MarshalJSON is the custom marshaler for ApplicationGatewayBackendHTTPSettings. -func (agbhs ApplicationGatewayBackendHTTPSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ApplicationGatewayAuthenticationCertificate. +func (agac ApplicationGatewayAuthenticationCertificate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat != nil { - objectMap["properties"] = agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat + if agac.ApplicationGatewayAuthenticationCertificatePropertiesFormat != nil { + objectMap["properties"] = agac.ApplicationGatewayAuthenticationCertificatePropertiesFormat } - if agbhs.Name != nil { - objectMap["name"] = agbhs.Name + if agac.Name != nil { + objectMap["name"] = agac.Name } - if agbhs.ID != nil { - objectMap["id"] = agbhs.ID + if agac.ID != nil { + objectMap["id"] = agac.ID } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayBackendHTTPSettings struct. -func (agbhs *ApplicationGatewayBackendHTTPSettings) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayAuthenticationCertificate struct. +func (agac *ApplicationGatewayAuthenticationCertificate) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -784,12 +1583,12 @@ func (agbhs *ApplicationGatewayBackendHTTPSettings) UnmarshalJSON(body []byte) e switch k { case "properties": if v != nil { - var applicationGatewayBackendHTTPSettingsPropertiesFormat ApplicationGatewayBackendHTTPSettingsPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayBackendHTTPSettingsPropertiesFormat) + var applicationGatewayAuthenticationCertificatePropertiesFormat ApplicationGatewayAuthenticationCertificatePropertiesFormat + err = json.Unmarshal(*v, &applicationGatewayAuthenticationCertificatePropertiesFormat) if err != nil { return err } - agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat = &applicationGatewayBackendHTTPSettingsPropertiesFormat + agac.ApplicationGatewayAuthenticationCertificatePropertiesFormat = &applicationGatewayAuthenticationCertificatePropertiesFormat } case "name": if v != nil { @@ -798,7 +1597,7 @@ func (agbhs *ApplicationGatewayBackendHTTPSettings) UnmarshalJSON(body []byte) e if err != nil { return err } - agbhs.Name = &name + agac.Name = &name } case "etag": if v != nil { @@ -807,7 +1606,7 @@ func (agbhs *ApplicationGatewayBackendHTTPSettings) UnmarshalJSON(body []byte) e if err != nil { return err } - agbhs.Etag = &etag + agac.Etag = &etag } case "type": if v != nil { @@ -816,7 +1615,7 @@ func (agbhs *ApplicationGatewayBackendHTTPSettings) UnmarshalJSON(body []byte) e if err != nil { return err } - agbhs.Type = &typeVar + agac.Type = &typeVar } case "id": if v != nil { @@ -825,7 +1624,7 @@ func (agbhs *ApplicationGatewayBackendHTTPSettings) UnmarshalJSON(body []byte) e if err != nil { return err } - agbhs.ID = &ID + agac.ID = &ID } } } @@ -833,115 +1632,70 @@ func (agbhs *ApplicationGatewayBackendHTTPSettings) UnmarshalJSON(body []byte) e return nil } -// ApplicationGatewayBackendHTTPSettingsPropertiesFormat properties of Backend address pool settings of an +// ApplicationGatewayAuthenticationCertificatePropertiesFormat authentication certificates properties of an // application gateway. -type ApplicationGatewayBackendHTTPSettingsPropertiesFormat struct { - // Port - The destination port on the backend. - Port *int32 `json:"port,omitempty"` - // Protocol - The protocol used to communicate with the backend. Possible values include: 'ApplicationGatewayProtocolHTTP', 'ApplicationGatewayProtocolHTTPS', 'ApplicationGatewayProtocolTCP', 'ApplicationGatewayProtocolTLS' - Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` - // CookieBasedAffinity - Cookie based affinity. Possible values include: 'ApplicationGatewayCookieBasedAffinityEnabled', 'ApplicationGatewayCookieBasedAffinityDisabled' - CookieBasedAffinity ApplicationGatewayCookieBasedAffinity `json:"cookieBasedAffinity,omitempty"` - // RequestTimeout - Request timeout in seconds. Application Gateway will fail the request if response is not received within RequestTimeout. Acceptable values are from 1 second to 86400 seconds. - RequestTimeout *int32 `json:"requestTimeout,omitempty"` - // Probe - Probe resource of an application gateway. - Probe *SubResource `json:"probe,omitempty"` - // AuthenticationCertificates - Array of references to application gateway authentication certificates. - AuthenticationCertificates *[]SubResource `json:"authenticationCertificates,omitempty"` - // TrustedRootCertificates - Array of references to application gateway trusted root certificates. - TrustedRootCertificates *[]SubResource `json:"trustedRootCertificates,omitempty"` - // ConnectionDraining - Connection draining of the backend http settings resource. - ConnectionDraining *ApplicationGatewayConnectionDraining `json:"connectionDraining,omitempty"` - // HostName - Host header to be sent to the backend servers. - HostName *string `json:"hostName,omitempty"` - // PickHostNameFromBackendAddress - Whether to pick host header should be picked from the host name of the backend server. Default value is false. - PickHostNameFromBackendAddress *bool `json:"pickHostNameFromBackendAddress,omitempty"` - // AffinityCookieName - Cookie name to use for the affinity cookie. - AffinityCookieName *string `json:"affinityCookieName,omitempty"` - // ProbeEnabled - Whether the probe is enabled. Default value is false. - ProbeEnabled *bool `json:"probeEnabled,omitempty"` - // Path - Path which should be used as a prefix for all HTTP requests. Null means no path will be prefixed. Default value is null. - Path *string `json:"path,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the backend HTTP settings resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' +type ApplicationGatewayAuthenticationCertificatePropertiesFormat struct { + // Data - Certificate public data. + Data *string `json:"data,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the authentication certificate resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } -// MarshalJSON is the custom marshaler for ApplicationGatewayBackendHTTPSettingsPropertiesFormat. -func (agbhspf ApplicationGatewayBackendHTTPSettingsPropertiesFormat) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ApplicationGatewayAuthenticationCertificatePropertiesFormat. +func (agacpf ApplicationGatewayAuthenticationCertificatePropertiesFormat) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if agbhspf.Port != nil { - objectMap["port"] = agbhspf.Port - } - if agbhspf.Protocol != "" { - objectMap["protocol"] = agbhspf.Protocol - } - if agbhspf.CookieBasedAffinity != "" { - objectMap["cookieBasedAffinity"] = agbhspf.CookieBasedAffinity - } - if agbhspf.RequestTimeout != nil { - objectMap["requestTimeout"] = agbhspf.RequestTimeout - } - if agbhspf.Probe != nil { - objectMap["probe"] = agbhspf.Probe - } - if agbhspf.AuthenticationCertificates != nil { - objectMap["authenticationCertificates"] = agbhspf.AuthenticationCertificates - } - if agbhspf.TrustedRootCertificates != nil { - objectMap["trustedRootCertificates"] = agbhspf.TrustedRootCertificates - } - if agbhspf.ConnectionDraining != nil { - objectMap["connectionDraining"] = agbhspf.ConnectionDraining - } - if agbhspf.HostName != nil { - objectMap["hostName"] = agbhspf.HostName - } - if agbhspf.PickHostNameFromBackendAddress != nil { - objectMap["pickHostNameFromBackendAddress"] = agbhspf.PickHostNameFromBackendAddress - } - if agbhspf.AffinityCookieName != nil { - objectMap["affinityCookieName"] = agbhspf.AffinityCookieName - } - if agbhspf.ProbeEnabled != nil { - objectMap["probeEnabled"] = agbhspf.ProbeEnabled - } - if agbhspf.Path != nil { - objectMap["path"] = agbhspf.Path + if agacpf.Data != nil { + objectMap["data"] = agacpf.Data } return json.Marshal(objectMap) } -// ApplicationGatewayBackendSettings backend address pool settings of an application gateway. -type ApplicationGatewayBackendSettings struct { - // ApplicationGatewayBackendSettingsPropertiesFormat - Properties of the application gateway backend settings. - *ApplicationGatewayBackendSettingsPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the backend settings that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` +// ApplicationGatewayAutoscaleConfiguration application Gateway autoscale configuration. +type ApplicationGatewayAutoscaleConfiguration struct { + // MinCapacity - Lower bound on number of Application Gateway capacity. + MinCapacity *int32 `json:"minCapacity,omitempty"` + // MaxCapacity - Upper bound on number of Application Gateway capacity. + MaxCapacity *int32 `json:"maxCapacity,omitempty"` +} + +// ApplicationGatewayAvailableSslOptions response for ApplicationGatewayAvailableSslOptions API service +// call. +type ApplicationGatewayAvailableSslOptions struct { + autorest.Response `json:"-"` + // ApplicationGatewayAvailableSslOptionsPropertiesFormat - Properties of the application gateway available SSL options. + *ApplicationGatewayAvailableSslOptionsPropertiesFormat `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` } -// MarshalJSON is the custom marshaler for ApplicationGatewayBackendSettings. -func (agbs ApplicationGatewayBackendSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ApplicationGatewayAvailableSslOptions. +func (agaso ApplicationGatewayAvailableSslOptions) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if agbs.ApplicationGatewayBackendSettingsPropertiesFormat != nil { - objectMap["properties"] = agbs.ApplicationGatewayBackendSettingsPropertiesFormat + if agaso.ApplicationGatewayAvailableSslOptionsPropertiesFormat != nil { + objectMap["properties"] = agaso.ApplicationGatewayAvailableSslOptionsPropertiesFormat } - if agbs.Name != nil { - objectMap["name"] = agbs.Name + if agaso.ID != nil { + objectMap["id"] = agaso.ID } - if agbs.ID != nil { - objectMap["id"] = agbs.ID + if agaso.Location != nil { + objectMap["location"] = agaso.Location + } + if agaso.Tags != nil { + objectMap["tags"] = agaso.Tags } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayBackendSettings struct. -func (agbs *ApplicationGatewayBackendSettings) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayAvailableSslOptions struct. +func (agaso *ApplicationGatewayAvailableSslOptions) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -951,30 +1705,30 @@ func (agbs *ApplicationGatewayBackendSettings) UnmarshalJSON(body []byte) error switch k { case "properties": if v != nil { - var applicationGatewayBackendSettingsPropertiesFormat ApplicationGatewayBackendSettingsPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayBackendSettingsPropertiesFormat) + var applicationGatewayAvailableSslOptionsPropertiesFormat ApplicationGatewayAvailableSslOptionsPropertiesFormat + err = json.Unmarshal(*v, &applicationGatewayAvailableSslOptionsPropertiesFormat) if err != nil { return err } - agbs.ApplicationGatewayBackendSettingsPropertiesFormat = &applicationGatewayBackendSettingsPropertiesFormat + agaso.ApplicationGatewayAvailableSslOptionsPropertiesFormat = &applicationGatewayAvailableSslOptionsPropertiesFormat } - case "name": + case "id": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var ID string + err = json.Unmarshal(*v, &ID) if err != nil { return err } - agbs.Name = &name + agaso.ID = &ID } - case "etag": + case "name": if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - agbs.Etag = &etag + agaso.Name = &name } case "type": if v != nil { @@ -983,16 +1737,25 @@ func (agbs *ApplicationGatewayBackendSettings) UnmarshalJSON(body []byte) error if err != nil { return err } - agbs.Type = &typeVar + agaso.Type = &typeVar } - case "id": + case "location": if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) + var location string + err = json.Unmarshal(*v, &location) if err != nil { return err } - agbs.ID = &ID + agaso.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + agaso.Tags = tags } } } @@ -1000,151 +1763,228 @@ func (agbs *ApplicationGatewayBackendSettings) UnmarshalJSON(body []byte) error return nil } -// ApplicationGatewayBackendSettingsPropertiesFormat properties of Backend address pool settings of an -// application gateway. -type ApplicationGatewayBackendSettingsPropertiesFormat struct { - // Port - The destination port on the backend. - Port *int32 `json:"port,omitempty"` - // Protocol - The protocol used to communicate with the backend. Possible values include: 'ApplicationGatewayProtocolHTTP', 'ApplicationGatewayProtocolHTTPS', 'ApplicationGatewayProtocolTCP', 'ApplicationGatewayProtocolTLS' - Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` - // Timeout - Connection timeout in seconds. Application Gateway will fail the request if response is not received within ConnectionTimeout. Acceptable values are from 1 second to 86400 seconds. - Timeout *int32 `json:"timeout,omitempty"` - // Probe - Probe resource of an application gateway. - Probe *SubResource `json:"probe,omitempty"` - // TrustedRootCertificates - Array of references to application gateway trusted root certificates. - TrustedRootCertificates *[]SubResource `json:"trustedRootCertificates,omitempty"` - // HostName - Server name indication to be sent to the backend servers for Tls protocol. - HostName *string `json:"hostName,omitempty"` - // PickHostNameFromBackendAddress - Whether to pick server name indication from the host name of the backend server for Tls protocol. Default value is false. - PickHostNameFromBackendAddress *bool `json:"pickHostNameFromBackendAddress,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the backend HTTP settings resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +// ApplicationGatewayAvailableSslOptionsPropertiesFormat properties of +// ApplicationGatewayAvailableSslOptions. +type ApplicationGatewayAvailableSslOptionsPropertiesFormat struct { + // PredefinedPolicies - List of available Ssl predefined policy. + PredefinedPolicies *[]SubResource `json:"predefinedPolicies,omitempty"` + // DefaultPolicy - Name of the Ssl predefined policy applied by default to application gateway. Possible values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S', 'AppGwSslPolicy20220101', 'AppGwSslPolicy20220101S' + DefaultPolicy ApplicationGatewaySslPolicyName `json:"defaultPolicy,omitempty"` + // AvailableCipherSuites - List of available Ssl cipher suites. + AvailableCipherSuites *[]ApplicationGatewaySslCipherSuite `json:"availableCipherSuites,omitempty"` + // AvailableProtocols - List of available Ssl protocols. + AvailableProtocols *[]ApplicationGatewaySslProtocol `json:"availableProtocols,omitempty"` } -// MarshalJSON is the custom marshaler for ApplicationGatewayBackendSettingsPropertiesFormat. -func (agbspf ApplicationGatewayBackendSettingsPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if agbspf.Port != nil { - objectMap["port"] = agbspf.Port +// ApplicationGatewayAvailableSslPredefinedPolicies response for ApplicationGatewayAvailableSslOptions API +// service call. +type ApplicationGatewayAvailableSslPredefinedPolicies struct { + autorest.Response `json:"-"` + // Value - List of available Ssl predefined policy. + Value *[]ApplicationGatewaySslPredefinedPolicy `json:"value,omitempty"` + // NextLink - URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ApplicationGatewayAvailableSslPredefinedPoliciesIterator provides access to a complete listing of +// ApplicationGatewaySslPredefinedPolicy values. +type ApplicationGatewayAvailableSslPredefinedPoliciesIterator struct { + i int + page ApplicationGatewayAvailableSslPredefinedPoliciesPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ApplicationGatewayAvailableSslPredefinedPoliciesIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayAvailableSslPredefinedPoliciesIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() } - if agbspf.Protocol != "" { - objectMap["protocol"] = agbspf.Protocol + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil } - if agbspf.Timeout != nil { - objectMap["timeout"] = agbspf.Timeout + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err } - if agbspf.Probe != nil { - objectMap["probe"] = agbspf.Probe + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ApplicationGatewayAvailableSslPredefinedPoliciesIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ApplicationGatewayAvailableSslPredefinedPoliciesIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ApplicationGatewayAvailableSslPredefinedPoliciesIterator) Response() ApplicationGatewayAvailableSslPredefinedPolicies { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ApplicationGatewayAvailableSslPredefinedPoliciesIterator) Value() ApplicationGatewaySslPredefinedPolicy { + if !iter.page.NotDone() { + return ApplicationGatewaySslPredefinedPolicy{} } - if agbspf.TrustedRootCertificates != nil { - objectMap["trustedRootCertificates"] = agbspf.TrustedRootCertificates + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ApplicationGatewayAvailableSslPredefinedPoliciesIterator type. +func NewApplicationGatewayAvailableSslPredefinedPoliciesIterator(page ApplicationGatewayAvailableSslPredefinedPoliciesPage) ApplicationGatewayAvailableSslPredefinedPoliciesIterator { + return ApplicationGatewayAvailableSslPredefinedPoliciesIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (agaspp ApplicationGatewayAvailableSslPredefinedPolicies) IsEmpty() bool { + return agaspp.Value == nil || len(*agaspp.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (agaspp ApplicationGatewayAvailableSslPredefinedPolicies) hasNextLink() bool { + return agaspp.NextLink != nil && len(*agaspp.NextLink) != 0 +} + +// applicationGatewayAvailableSslPredefinedPoliciesPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (agaspp ApplicationGatewayAvailableSslPredefinedPolicies) applicationGatewayAvailableSslPredefinedPoliciesPreparer(ctx context.Context) (*http.Request, error) { + if !agaspp.hasNextLink() { + return nil, nil } - if agbspf.HostName != nil { - objectMap["hostName"] = agbspf.HostName + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(agaspp.NextLink))) +} + +// ApplicationGatewayAvailableSslPredefinedPoliciesPage contains a page of +// ApplicationGatewaySslPredefinedPolicy values. +type ApplicationGatewayAvailableSslPredefinedPoliciesPage struct { + fn func(context.Context, ApplicationGatewayAvailableSslPredefinedPolicies) (ApplicationGatewayAvailableSslPredefinedPolicies, error) + agaspp ApplicationGatewayAvailableSslPredefinedPolicies +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ApplicationGatewayAvailableSslPredefinedPoliciesPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayAvailableSslPredefinedPoliciesPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() } - if agbspf.PickHostNameFromBackendAddress != nil { - objectMap["pickHostNameFromBackendAddress"] = agbspf.PickHostNameFromBackendAddress + for { + next, err := page.fn(ctx, page.agaspp) + if err != nil { + return err + } + page.agaspp = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - return json.Marshal(objectMap) + return nil } -// ApplicationGatewayClientAuthConfiguration application gateway client authentication configuration. -type ApplicationGatewayClientAuthConfiguration struct { - // VerifyClientCertIssuerDN - Verify client certificate issuer name on the application gateway. - VerifyClientCertIssuerDN *bool `json:"verifyClientCertIssuerDN,omitempty"` +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ApplicationGatewayAvailableSslPredefinedPoliciesPage) Next() error { + return page.NextWithContext(context.Background()) } -// ApplicationGatewayConnectionDraining connection draining allows open connections to a backend server to -// be active for a specified time after the backend server got removed from the configuration. -type ApplicationGatewayConnectionDraining struct { - // Enabled - Whether connection draining is enabled or not. - Enabled *bool `json:"enabled,omitempty"` - // DrainTimeoutInSec - The number of seconds connection draining is active. Acceptable values are from 1 second to 3600 seconds. - DrainTimeoutInSec *int32 `json:"drainTimeoutInSec,omitempty"` +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ApplicationGatewayAvailableSslPredefinedPoliciesPage) NotDone() bool { + return !page.agaspp.IsEmpty() } -// ApplicationGatewayCustomError customer error of an application gateway. -type ApplicationGatewayCustomError struct { - // StatusCode - Status code of the application gateway customer error. Possible values include: 'ApplicationGatewayCustomErrorStatusCodeHTTPStatus403', 'ApplicationGatewayCustomErrorStatusCodeHTTPStatus502' - StatusCode ApplicationGatewayCustomErrorStatusCode `json:"statusCode,omitempty"` - // CustomErrorPageURL - Error page URL of the application gateway customer error. - CustomErrorPageURL *string `json:"customErrorPageUrl,omitempty"` +// Response returns the raw server response from the last page request. +func (page ApplicationGatewayAvailableSslPredefinedPoliciesPage) Response() ApplicationGatewayAvailableSslPredefinedPolicies { + return page.agaspp } -// ApplicationGatewayFirewallDisabledRuleGroup allows to disable rules within a rule group or an entire -// rule group. -type ApplicationGatewayFirewallDisabledRuleGroup struct { - // RuleGroupName - The name of the rule group that will be disabled. - RuleGroupName *string `json:"ruleGroupName,omitempty"` - // Rules - The list of rules that will be disabled. If null, all rules of the rule group will be disabled. - Rules *[]int32 `json:"rules,omitempty"` +// Values returns the slice of values for the current page or nil if there are no values. +func (page ApplicationGatewayAvailableSslPredefinedPoliciesPage) Values() []ApplicationGatewaySslPredefinedPolicy { + if page.agaspp.IsEmpty() { + return nil + } + return *page.agaspp.Value } -// ApplicationGatewayFirewallExclusion allow to exclude some variable satisfy the condition for the WAF -// check. -type ApplicationGatewayFirewallExclusion struct { - // MatchVariable - The variable to be excluded. - MatchVariable *string `json:"matchVariable,omitempty"` - // SelectorMatchOperator - When matchVariable is a collection, operate on the selector to specify which elements in the collection this exclusion applies to. - SelectorMatchOperator *string `json:"selectorMatchOperator,omitempty"` - // Selector - When matchVariable is a collection, operator used to specify which elements in the collection this exclusion applies to. - Selector *string `json:"selector,omitempty"` +// Creates a new instance of the ApplicationGatewayAvailableSslPredefinedPoliciesPage type. +func NewApplicationGatewayAvailableSslPredefinedPoliciesPage(cur ApplicationGatewayAvailableSslPredefinedPolicies, getNextPage func(context.Context, ApplicationGatewayAvailableSslPredefinedPolicies) (ApplicationGatewayAvailableSslPredefinedPolicies, error)) ApplicationGatewayAvailableSslPredefinedPoliciesPage { + return ApplicationGatewayAvailableSslPredefinedPoliciesPage{ + fn: getNextPage, + agaspp: cur, + } } -// ApplicationGatewayFirewallRule a web application firewall rule. -type ApplicationGatewayFirewallRule struct { - // RuleID - The identifier of the web application firewall rule. - RuleID *int32 `json:"ruleId,omitempty"` - // Description - The description of the web application firewall rule. - Description *string `json:"description,omitempty"` +// ApplicationGatewayAvailableWafRuleSetsResult response for ApplicationGatewayAvailableWafRuleSets API +// service call. +type ApplicationGatewayAvailableWafRuleSetsResult struct { + autorest.Response `json:"-"` + // Value - The list of application gateway rule sets. + Value *[]ApplicationGatewayFirewallRuleSet `json:"value,omitempty"` } -// ApplicationGatewayFirewallRuleGroup a web application firewall rule group. -type ApplicationGatewayFirewallRuleGroup struct { - // RuleGroupName - The name of the web application firewall rule group. - RuleGroupName *string `json:"ruleGroupName,omitempty"` - // Description - The description of the web application firewall rule group. - Description *string `json:"description,omitempty"` - // Rules - The rules of the web application firewall rule group. - Rules *[]ApplicationGatewayFirewallRule `json:"rules,omitempty"` +// ApplicationGatewayBackendAddress backend address of an application gateway. +type ApplicationGatewayBackendAddress struct { + // Fqdn - Fully qualified domain name (FQDN). + Fqdn *string `json:"fqdn,omitempty"` + // IPAddress - IP address. + IPAddress *string `json:"ipAddress,omitempty"` } -// ApplicationGatewayFirewallRuleSet a web application firewall rule set. -type ApplicationGatewayFirewallRuleSet struct { - // ApplicationGatewayFirewallRuleSetPropertiesFormat - Properties of the application gateway firewall rule set. - *ApplicationGatewayFirewallRuleSetPropertiesFormat `json:"properties,omitempty"` - // ID - Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. +// ApplicationGatewayBackendAddressPool backend Address Pool of an application gateway. +type ApplicationGatewayBackendAddressPool struct { + // ApplicationGatewayBackendAddressPoolPropertiesFormat - Properties of the application gateway backend address pool. + *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` + // Name - Name of the backend address pool that is unique within an Application Gateway. Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // Type - READ-ONLY; Type of the resource. Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` } -// MarshalJSON is the custom marshaler for ApplicationGatewayFirewallRuleSet. -func (agfrs ApplicationGatewayFirewallRuleSet) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ApplicationGatewayBackendAddressPool. +func (agbap ApplicationGatewayBackendAddressPool) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if agfrs.ApplicationGatewayFirewallRuleSetPropertiesFormat != nil { - objectMap["properties"] = agfrs.ApplicationGatewayFirewallRuleSetPropertiesFormat - } - if agfrs.ID != nil { - objectMap["id"] = agfrs.ID + if agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat != nil { + objectMap["properties"] = agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat } - if agfrs.Location != nil { - objectMap["location"] = agfrs.Location + if agbap.Name != nil { + objectMap["name"] = agbap.Name } - if agfrs.Tags != nil { - objectMap["tags"] = agfrs.Tags + if agbap.ID != nil { + objectMap["id"] = agbap.ID } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayFirewallRuleSet struct. -func (agfrs *ApplicationGatewayFirewallRuleSet) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayBackendAddressPool struct. +func (agbap *ApplicationGatewayBackendAddressPool) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -1154,21 +1994,12 @@ func (agfrs *ApplicationGatewayFirewallRuleSet) UnmarshalJSON(body []byte) error switch k { case "properties": if v != nil { - var applicationGatewayFirewallRuleSetPropertiesFormat ApplicationGatewayFirewallRuleSetPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayFirewallRuleSetPropertiesFormat) - if err != nil { - return err - } - agfrs.ApplicationGatewayFirewallRuleSetPropertiesFormat = &applicationGatewayFirewallRuleSetPropertiesFormat - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) + var applicationGatewayBackendAddressPoolPropertiesFormat ApplicationGatewayBackendAddressPoolPropertiesFormat + err = json.Unmarshal(*v, &applicationGatewayBackendAddressPoolPropertiesFormat) if err != nil { return err } - agfrs.ID = &ID + agbap.ApplicationGatewayBackendAddressPoolPropertiesFormat = &applicationGatewayBackendAddressPoolPropertiesFormat } case "name": if v != nil { @@ -1177,34 +2008,34 @@ func (agfrs *ApplicationGatewayFirewallRuleSet) UnmarshalJSON(body []byte) error if err != nil { return err } - agfrs.Name = &name + agbap.Name = &name } - case "type": + case "etag": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var etag string + err = json.Unmarshal(*v, &etag) if err != nil { return err } - agfrs.Type = &typeVar + agbap.Etag = &etag } - case "location": + case "type": if v != nil { - var location string - err = json.Unmarshal(*v, &location) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - agfrs.Location = &location + agbap.Type = &typeVar } - case "tags": + case "id": if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) + var ID string + err = json.Unmarshal(*v, &ID) if err != nil { return err } - agfrs.Tags = tags + agbap.ID = &ID } } } @@ -1212,64 +2043,101 @@ func (agfrs *ApplicationGatewayFirewallRuleSet) UnmarshalJSON(body []byte) error return nil } -// ApplicationGatewayFirewallRuleSetPropertiesFormat properties of the web application firewall rule set. -type ApplicationGatewayFirewallRuleSetPropertiesFormat struct { - // ProvisioningState - READ-ONLY; The provisioning state of the web application firewall rule set. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' +// ApplicationGatewayBackendAddressPoolPropertiesFormat properties of Backend Address Pool of an +// application gateway. +type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { + // BackendIPConfigurations - READ-ONLY; Collection of references to IPs defined in network interfaces. + BackendIPConfigurations *[]InterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` + // BackendAddresses - Backend addresses. + BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the backend address pool resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // RuleSetType - The type of the web application firewall rule set. - RuleSetType *string `json:"ruleSetType,omitempty"` - // RuleSetVersion - The version of the web application firewall rule set type. - RuleSetVersion *string `json:"ruleSetVersion,omitempty"` - // RuleGroups - The rule groups of the web application firewall rule set. - RuleGroups *[]ApplicationGatewayFirewallRuleGroup `json:"ruleGroups,omitempty"` } -// MarshalJSON is the custom marshaler for ApplicationGatewayFirewallRuleSetPropertiesFormat. -func (agfrspf ApplicationGatewayFirewallRuleSetPropertiesFormat) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ApplicationGatewayBackendAddressPoolPropertiesFormat. +func (agbappf ApplicationGatewayBackendAddressPoolPropertiesFormat) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if agfrspf.RuleSetType != nil { - objectMap["ruleSetType"] = agfrspf.RuleSetType - } - if agfrspf.RuleSetVersion != nil { - objectMap["ruleSetVersion"] = agfrspf.RuleSetVersion - } - if agfrspf.RuleGroups != nil { - objectMap["ruleGroups"] = agfrspf.RuleGroups + if agbappf.BackendAddresses != nil { + objectMap["backendAddresses"] = agbappf.BackendAddresses } return json.Marshal(objectMap) } -// ApplicationGatewayFrontendIPConfiguration frontend IP configuration of an application gateway. -type ApplicationGatewayFrontendIPConfiguration struct { - // ApplicationGatewayFrontendIPConfigurationPropertiesFormat - Properties of the application gateway frontend IP configuration. - *ApplicationGatewayFrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the frontend IP configuration that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` +// ApplicationGatewayBackendHealth response for ApplicationGatewayBackendHealth API service call. +type ApplicationGatewayBackendHealth struct { + autorest.Response `json:"-"` + // BackendAddressPools - A list of ApplicationGatewayBackendHealthPool resources. + BackendAddressPools *[]ApplicationGatewayBackendHealthPool `json:"backendAddressPools,omitempty"` +} + +// ApplicationGatewayBackendHealthHTTPSettings application gateway BackendHealthHttp settings. +type ApplicationGatewayBackendHealthHTTPSettings struct { + // BackendHTTPSettings - Reference to an ApplicationGatewayBackendHttpSettings resource. + BackendHTTPSettings *ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettings,omitempty"` + // Servers - List of ApplicationGatewayBackendHealthServer resources. + Servers *[]ApplicationGatewayBackendHealthServer `json:"servers,omitempty"` +} + +// ApplicationGatewayBackendHealthOnDemand result of on demand test probe. +type ApplicationGatewayBackendHealthOnDemand struct { + autorest.Response `json:"-"` + // BackendAddressPool - Reference to an ApplicationGatewayBackendAddressPool resource. + BackendAddressPool *ApplicationGatewayBackendAddressPool `json:"backendAddressPool,omitempty"` + // BackendHealthHTTPSettings - Application gateway BackendHealthHttp settings. + BackendHealthHTTPSettings *ApplicationGatewayBackendHealthHTTPSettings `json:"backendHealthHttpSettings,omitempty"` +} + +// ApplicationGatewayBackendHealthPool application gateway BackendHealth pool. +type ApplicationGatewayBackendHealthPool struct { + // BackendAddressPool - Reference to an ApplicationGatewayBackendAddressPool resource. + BackendAddressPool *ApplicationGatewayBackendAddressPool `json:"backendAddressPool,omitempty"` + // BackendHTTPSettingsCollection - List of ApplicationGatewayBackendHealthHttpSettings resources. + BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHealthHTTPSettings `json:"backendHttpSettingsCollection,omitempty"` +} + +// ApplicationGatewayBackendHealthServer application gateway backendhealth http settings. +type ApplicationGatewayBackendHealthServer struct { + // Address - IP address or FQDN of backend server. + Address *string `json:"address,omitempty"` + // IPConfiguration - Reference to IP configuration of backend server. + IPConfiguration *InterfaceIPConfiguration `json:"ipConfiguration,omitempty"` + // Health - Health of backend server. Possible values include: 'Unknown', 'Up', 'Down', 'Partial', 'Draining' + Health ApplicationGatewayBackendHealthServerHealth `json:"health,omitempty"` + // HealthProbeLog - Health Probe Log. + HealthProbeLog *string `json:"healthProbeLog,omitempty"` +} + +// ApplicationGatewayBackendHTTPSettings backend address pool settings of an application gateway. +type ApplicationGatewayBackendHTTPSettings struct { + // ApplicationGatewayBackendHTTPSettingsPropertiesFormat - Properties of the application gateway backend HTTP settings. + *ApplicationGatewayBackendHTTPSettingsPropertiesFormat `json:"properties,omitempty"` + // Name - Name of the backend http settings that is unique within an Application Gateway. + Name *string `json:"name,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` // Type - READ-ONLY; Type of the resource. Type *string `json:"type,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` } -// MarshalJSON is the custom marshaler for ApplicationGatewayFrontendIPConfiguration. -func (agfic ApplicationGatewayFrontendIPConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ApplicationGatewayBackendHTTPSettings. +func (agbhs ApplicationGatewayBackendHTTPSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat != nil { - objectMap["properties"] = agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat + if agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat != nil { + objectMap["properties"] = agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat } - if agfic.Name != nil { - objectMap["name"] = agfic.Name + if agbhs.Name != nil { + objectMap["name"] = agbhs.Name } - if agfic.ID != nil { - objectMap["id"] = agfic.ID + if agbhs.ID != nil { + objectMap["id"] = agbhs.ID } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayFrontendIPConfiguration struct. -func (agfic *ApplicationGatewayFrontendIPConfiguration) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayBackendHTTPSettings struct. +func (agbhs *ApplicationGatewayBackendHTTPSettings) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -1279,12 +2147,12 @@ func (agfic *ApplicationGatewayFrontendIPConfiguration) UnmarshalJSON(body []byt switch k { case "properties": if v != nil { - var applicationGatewayFrontendIPConfigurationPropertiesFormat ApplicationGatewayFrontendIPConfigurationPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayFrontendIPConfigurationPropertiesFormat) + var applicationGatewayBackendHTTPSettingsPropertiesFormat ApplicationGatewayBackendHTTPSettingsPropertiesFormat + err = json.Unmarshal(*v, &applicationGatewayBackendHTTPSettingsPropertiesFormat) if err != nil { return err } - agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat = &applicationGatewayFrontendIPConfigurationPropertiesFormat + agbhs.ApplicationGatewayBackendHTTPSettingsPropertiesFormat = &applicationGatewayBackendHTTPSettingsPropertiesFormat } case "name": if v != nil { @@ -1293,7 +2161,7 @@ func (agfic *ApplicationGatewayFrontendIPConfiguration) UnmarshalJSON(body []byt if err != nil { return err } - agfic.Name = &name + agbhs.Name = &name } case "etag": if v != nil { @@ -1302,7 +2170,7 @@ func (agfic *ApplicationGatewayFrontendIPConfiguration) UnmarshalJSON(body []byt if err != nil { return err } - agfic.Etag = &etag + agbhs.Etag = &etag } case "type": if v != nil { @@ -1311,7 +2179,7 @@ func (agfic *ApplicationGatewayFrontendIPConfiguration) UnmarshalJSON(body []byt if err != nil { return err } - agfic.Type = &typeVar + agbhs.Type = &typeVar } case "id": if v != nil { @@ -1320,7 +2188,7 @@ func (agfic *ApplicationGatewayFrontendIPConfiguration) UnmarshalJSON(body []byt if err != nil { return err } - agfic.ID = &ID + agbhs.ID = &ID } } } @@ -1328,49 +2196,89 @@ func (agfic *ApplicationGatewayFrontendIPConfiguration) UnmarshalJSON(body []byt return nil } -// ApplicationGatewayFrontendIPConfigurationPropertiesFormat properties of Frontend IP configuration of an +// ApplicationGatewayBackendHTTPSettingsPropertiesFormat properties of Backend address pool settings of an // application gateway. -type ApplicationGatewayFrontendIPConfigurationPropertiesFormat struct { - // PrivateIPAddress - PrivateIPAddress of the network interface IP Configuration. - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'IPAllocationMethodStatic', 'IPAllocationMethodDynamic' - PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - // Subnet - Reference to the subnet resource. - Subnet *SubResource `json:"subnet,omitempty"` - // PublicIPAddress - Reference to the PublicIP resource. - PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` - // PrivateLinkConfiguration - Reference to the application gateway private link configuration. - PrivateLinkConfiguration *SubResource `json:"privateLinkConfiguration,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the frontend IP configuration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' +type ApplicationGatewayBackendHTTPSettingsPropertiesFormat struct { + // Port - The destination port on the backend. + Port *int32 `json:"port,omitempty"` + // Protocol - The protocol used to communicate with the backend. Possible values include: 'HTTP', 'HTTPS', 'TCP', 'TLS' + Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` + // CookieBasedAffinity - Cookie based affinity. Possible values include: 'Enabled', 'Disabled' + CookieBasedAffinity ApplicationGatewayCookieBasedAffinity `json:"cookieBasedAffinity,omitempty"` + // RequestTimeout - Request timeout in seconds. Application Gateway will fail the request if response is not received within RequestTimeout. Acceptable values are from 1 second to 86400 seconds. + RequestTimeout *int32 `json:"requestTimeout,omitempty"` + // Probe - Probe resource of an application gateway. + Probe *SubResource `json:"probe,omitempty"` + // AuthenticationCertificates - Array of references to application gateway authentication certificates. + AuthenticationCertificates *[]SubResource `json:"authenticationCertificates,omitempty"` + // TrustedRootCertificates - Array of references to application gateway trusted root certificates. + TrustedRootCertificates *[]SubResource `json:"trustedRootCertificates,omitempty"` + // ConnectionDraining - Connection draining of the backend http settings resource. + ConnectionDraining *ApplicationGatewayConnectionDraining `json:"connectionDraining,omitempty"` + // HostName - Host header to be sent to the backend servers. + HostName *string `json:"hostName,omitempty"` + // PickHostNameFromBackendAddress - Whether to pick host header should be picked from the host name of the backend server. Default value is false. + PickHostNameFromBackendAddress *bool `json:"pickHostNameFromBackendAddress,omitempty"` + // AffinityCookieName - Cookie name to use for the affinity cookie. + AffinityCookieName *string `json:"affinityCookieName,omitempty"` + // ProbeEnabled - Whether the probe is enabled. Default value is false. + ProbeEnabled *bool `json:"probeEnabled,omitempty"` + // Path - Path which should be used as a prefix for all HTTP requests. Null means no path will be prefixed. Default value is null. + Path *string `json:"path,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the backend HTTP settings resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } -// MarshalJSON is the custom marshaler for ApplicationGatewayFrontendIPConfigurationPropertiesFormat. -func (agficpf ApplicationGatewayFrontendIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ApplicationGatewayBackendHTTPSettingsPropertiesFormat. +func (agbhspf ApplicationGatewayBackendHTTPSettingsPropertiesFormat) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if agficpf.PrivateIPAddress != nil { - objectMap["privateIPAddress"] = agficpf.PrivateIPAddress + if agbhspf.Port != nil { + objectMap["port"] = agbhspf.Port } - if agficpf.PrivateIPAllocationMethod != "" { - objectMap["privateIPAllocationMethod"] = agficpf.PrivateIPAllocationMethod + if agbhspf.Protocol != "" { + objectMap["protocol"] = agbhspf.Protocol } - if agficpf.Subnet != nil { - objectMap["subnet"] = agficpf.Subnet + if agbhspf.CookieBasedAffinity != "" { + objectMap["cookieBasedAffinity"] = agbhspf.CookieBasedAffinity } - if agficpf.PublicIPAddress != nil { - objectMap["publicIPAddress"] = agficpf.PublicIPAddress + if agbhspf.RequestTimeout != nil { + objectMap["requestTimeout"] = agbhspf.RequestTimeout } - if agficpf.PrivateLinkConfiguration != nil { - objectMap["privateLinkConfiguration"] = agficpf.PrivateLinkConfiguration + if agbhspf.Probe != nil { + objectMap["probe"] = agbhspf.Probe + } + if agbhspf.AuthenticationCertificates != nil { + objectMap["authenticationCertificates"] = agbhspf.AuthenticationCertificates + } + if agbhspf.TrustedRootCertificates != nil { + objectMap["trustedRootCertificates"] = agbhspf.TrustedRootCertificates + } + if agbhspf.ConnectionDraining != nil { + objectMap["connectionDraining"] = agbhspf.ConnectionDraining + } + if agbhspf.HostName != nil { + objectMap["hostName"] = agbhspf.HostName + } + if agbhspf.PickHostNameFromBackendAddress != nil { + objectMap["pickHostNameFromBackendAddress"] = agbhspf.PickHostNameFromBackendAddress + } + if agbhspf.AffinityCookieName != nil { + objectMap["affinityCookieName"] = agbhspf.AffinityCookieName + } + if agbhspf.ProbeEnabled != nil { + objectMap["probeEnabled"] = agbhspf.ProbeEnabled + } + if agbhspf.Path != nil { + objectMap["path"] = agbhspf.Path } return json.Marshal(objectMap) } -// ApplicationGatewayFrontendPort frontend port of an application gateway. -type ApplicationGatewayFrontendPort struct { - // ApplicationGatewayFrontendPortPropertiesFormat - Properties of the application gateway frontend port. - *ApplicationGatewayFrontendPortPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the frontend port that is unique within an Application Gateway. +// ApplicationGatewayBackendSettings backend address pool settings of an application gateway. +type ApplicationGatewayBackendSettings struct { + // ApplicationGatewayBackendSettingsPropertiesFormat - Properties of the application gateway backend settings. + *ApplicationGatewayBackendSettingsPropertiesFormat `json:"properties,omitempty"` + // Name - Name of the backend settings that is unique within an Application Gateway. Name *string `json:"name,omitempty"` // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` @@ -1380,23 +2288,23 @@ type ApplicationGatewayFrontendPort struct { ID *string `json:"id,omitempty"` } -// MarshalJSON is the custom marshaler for ApplicationGatewayFrontendPort. -func (agfp ApplicationGatewayFrontendPort) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ApplicationGatewayBackendSettings. +func (agbs ApplicationGatewayBackendSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if agfp.ApplicationGatewayFrontendPortPropertiesFormat != nil { - objectMap["properties"] = agfp.ApplicationGatewayFrontendPortPropertiesFormat + if agbs.ApplicationGatewayBackendSettingsPropertiesFormat != nil { + objectMap["properties"] = agbs.ApplicationGatewayBackendSettingsPropertiesFormat } - if agfp.Name != nil { - objectMap["name"] = agfp.Name + if agbs.Name != nil { + objectMap["name"] = agbs.Name } - if agfp.ID != nil { - objectMap["id"] = agfp.ID + if agbs.ID != nil { + objectMap["id"] = agbs.ID } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayFrontendPort struct. -func (agfp *ApplicationGatewayFrontendPort) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayBackendSettings struct. +func (agbs *ApplicationGatewayBackendSettings) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -1406,12 +2314,12 @@ func (agfp *ApplicationGatewayFrontendPort) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var applicationGatewayFrontendPortPropertiesFormat ApplicationGatewayFrontendPortPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayFrontendPortPropertiesFormat) + var applicationGatewayBackendSettingsPropertiesFormat ApplicationGatewayBackendSettingsPropertiesFormat + err = json.Unmarshal(*v, &applicationGatewayBackendSettingsPropertiesFormat) if err != nil { return err } - agfp.ApplicationGatewayFrontendPortPropertiesFormat = &applicationGatewayFrontendPortPropertiesFormat + agbs.ApplicationGatewayBackendSettingsPropertiesFormat = &applicationGatewayBackendSettingsPropertiesFormat } case "name": if v != nil { @@ -1420,7 +2328,7 @@ func (agfp *ApplicationGatewayFrontendPort) UnmarshalJSON(body []byte) error { if err != nil { return err } - agfp.Name = &name + agbs.Name = &name } case "etag": if v != nil { @@ -1429,7 +2337,7 @@ func (agfp *ApplicationGatewayFrontendPort) UnmarshalJSON(body []byte) error { if err != nil { return err } - agfp.Etag = &etag + agbs.Etag = &etag } case "type": if v != nil { @@ -1438,7 +2346,7 @@ func (agfp *ApplicationGatewayFrontendPort) UnmarshalJSON(body []byte) error { if err != nil { return err } - agfp.Type = &typeVar + agbs.Type = &typeVar } case "id": if v != nil { @@ -1447,7 +2355,7 @@ func (agfp *ApplicationGatewayFrontendPort) UnmarshalJSON(body []byte) error { if err != nil { return err } - agfp.ID = &ID + agbs.ID = &ID } } } @@ -1455,70 +2363,173 @@ func (agfp *ApplicationGatewayFrontendPort) UnmarshalJSON(body []byte) error { return nil } -// ApplicationGatewayFrontendPortPropertiesFormat properties of Frontend port of an application gateway. -type ApplicationGatewayFrontendPortPropertiesFormat struct { - // Port - Frontend port. +// ApplicationGatewayBackendSettingsPropertiesFormat properties of Backend address pool settings of an +// application gateway. +type ApplicationGatewayBackendSettingsPropertiesFormat struct { + // Port - The destination port on the backend. Port *int32 `json:"port,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the frontend port resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' + // Protocol - The protocol used to communicate with the backend. Possible values include: 'HTTP', 'HTTPS', 'TCP', 'TLS' + Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` + // Timeout - Connection timeout in seconds. Application Gateway will fail the request if response is not received within ConnectionTimeout. Acceptable values are from 1 second to 86400 seconds. + Timeout *int32 `json:"timeout,omitempty"` + // Probe - Probe resource of an application gateway. + Probe *SubResource `json:"probe,omitempty"` + // TrustedRootCertificates - Array of references to application gateway trusted root certificates. + TrustedRootCertificates *[]SubResource `json:"trustedRootCertificates,omitempty"` + // HostName - Server name indication to be sent to the backend servers for Tls protocol. + HostName *string `json:"hostName,omitempty"` + // PickHostNameFromBackendAddress - Whether to pick server name indication from the host name of the backend server for Tls protocol. Default value is false. + PickHostNameFromBackendAddress *bool `json:"pickHostNameFromBackendAddress,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the backend HTTP settings resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } -// MarshalJSON is the custom marshaler for ApplicationGatewayFrontendPortPropertiesFormat. -func (agfppf ApplicationGatewayFrontendPortPropertiesFormat) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ApplicationGatewayBackendSettingsPropertiesFormat. +func (agbspf ApplicationGatewayBackendSettingsPropertiesFormat) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if agfppf.Port != nil { - objectMap["port"] = agfppf.Port + if agbspf.Port != nil { + objectMap["port"] = agbspf.Port + } + if agbspf.Protocol != "" { + objectMap["protocol"] = agbspf.Protocol + } + if agbspf.Timeout != nil { + objectMap["timeout"] = agbspf.Timeout + } + if agbspf.Probe != nil { + objectMap["probe"] = agbspf.Probe + } + if agbspf.TrustedRootCertificates != nil { + objectMap["trustedRootCertificates"] = agbspf.TrustedRootCertificates + } + if agbspf.HostName != nil { + objectMap["hostName"] = agbspf.HostName + } + if agbspf.PickHostNameFromBackendAddress != nil { + objectMap["pickHostNameFromBackendAddress"] = agbspf.PickHostNameFromBackendAddress } return json.Marshal(objectMap) } -// ApplicationGatewayGlobalConfiguration application Gateway global configuration. -type ApplicationGatewayGlobalConfiguration struct { - // EnableRequestBuffering - Enable request buffering. - EnableRequestBuffering *bool `json:"enableRequestBuffering,omitempty"` - // EnableResponseBuffering - Enable response buffering. - EnableResponseBuffering *bool `json:"enableResponseBuffering,omitempty"` +// ApplicationGatewayClientAuthConfiguration application gateway client authentication configuration. +type ApplicationGatewayClientAuthConfiguration struct { + // VerifyClientCertIssuerDN - Verify client certificate issuer name on the application gateway. + VerifyClientCertIssuerDN *bool `json:"verifyClientCertIssuerDN,omitempty"` + // VerifyClientRevocation - Verify client certificate revocation status. Possible values include: 'None', 'OCSP' + VerifyClientRevocation ApplicationGatewayClientRevocationOptions `json:"verifyClientRevocation,omitempty"` } -// ApplicationGatewayHeaderConfiguration header configuration of the Actions set in Application Gateway. -type ApplicationGatewayHeaderConfiguration struct { - // HeaderName - Header name of the header configuration. - HeaderName *string `json:"headerName,omitempty"` - // HeaderValue - Header value of the header configuration. - HeaderValue *string `json:"headerValue,omitempty"` +// ApplicationGatewayConnectionDraining connection draining allows open connections to a backend server to +// be active for a specified time after the backend server got removed from the configuration. +type ApplicationGatewayConnectionDraining struct { + // Enabled - Whether connection draining is enabled or not. + Enabled *bool `json:"enabled,omitempty"` + // DrainTimeoutInSec - The number of seconds connection draining is active. Acceptable values are from 1 second to 3600 seconds. + DrainTimeoutInSec *int32 `json:"drainTimeoutInSec,omitempty"` } -// ApplicationGatewayHTTPListener http listener of an application gateway. -type ApplicationGatewayHTTPListener struct { - // ApplicationGatewayHTTPListenerPropertiesFormat - Properties of the application gateway HTTP listener. - *ApplicationGatewayHTTPListenerPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the HTTP listener that is unique within an Application Gateway. - Name *string `json:"name,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` +// ApplicationGatewayCustomError customer error of an application gateway. +type ApplicationGatewayCustomError struct { + // StatusCode - Status code of the application gateway customer error. Possible values include: 'HTTPStatus403', 'HTTPStatus502' + StatusCode ApplicationGatewayCustomErrorStatusCode `json:"statusCode,omitempty"` + // CustomErrorPageURL - Error page URL of the application gateway customer error. + CustomErrorPageURL *string `json:"customErrorPageUrl,omitempty"` +} + +// ApplicationGatewayFirewallDisabledRuleGroup allows to disable rules within a rule group or an entire +// rule group. +type ApplicationGatewayFirewallDisabledRuleGroup struct { + // RuleGroupName - The name of the rule group that will be disabled. + RuleGroupName *string `json:"ruleGroupName,omitempty"` + // Rules - The list of rules that will be disabled. If null, all rules of the rule group will be disabled. + Rules *[]int32 `json:"rules,omitempty"` +} + +// ApplicationGatewayFirewallExclusion allow to exclude some variable satisfy the condition for the WAF +// check. +type ApplicationGatewayFirewallExclusion struct { + // MatchVariable - The variable to be excluded. + MatchVariable *string `json:"matchVariable,omitempty"` + // SelectorMatchOperator - When matchVariable is a collection, operate on the selector to specify which elements in the collection this exclusion applies to. + SelectorMatchOperator *string `json:"selectorMatchOperator,omitempty"` + // Selector - When matchVariable is a collection, operator used to specify which elements in the collection this exclusion applies to. + Selector *string `json:"selector,omitempty"` +} + +// ApplicationGatewayFirewallManifestRuleSet properties of the web application firewall rule set. +type ApplicationGatewayFirewallManifestRuleSet struct { + // RuleSetType - The type of the web application firewall rule set. + RuleSetType *string `json:"ruleSetType,omitempty"` + // RuleSetVersion - The version of the web application firewall rule set type. + RuleSetVersion *string `json:"ruleSetVersion,omitempty"` + // Status - The rule set status. Possible values include: 'Preview', 'GA', 'Supported', 'Deprecated' + Status ApplicationGatewayRuleSetStatusOptions `json:"status,omitempty"` + // Tiers - Tier of an application gateway that support the rule set. + Tiers *[]ApplicationGatewayTierTypes `json:"tiers,omitempty"` + // RuleGroups - The rule groups of the web application firewall rule set. + RuleGroups *[]ApplicationGatewayFirewallRuleGroup `json:"ruleGroups,omitempty"` +} + +// ApplicationGatewayFirewallRule a web application firewall rule. +type ApplicationGatewayFirewallRule struct { + // RuleID - The identifier of the web application firewall rule. + RuleID *int32 `json:"ruleId,omitempty"` + // RuleIDString - The string representation of the web application firewall rule identifier. + RuleIDString *string `json:"ruleIdString,omitempty"` + // State - The string representation of the web application firewall rule state. Possible values include: 'ApplicationGatewayWafRuleStateTypesEnabled', 'ApplicationGatewayWafRuleStateTypesDisabled' + State ApplicationGatewayWafRuleStateTypes `json:"state,omitempty"` + // Action - The string representation of the web application firewall rule action. Possible values include: 'ApplicationGatewayWafRuleActionTypesNone', 'ApplicationGatewayWafRuleActionTypesAnomalyScoring', 'ApplicationGatewayWafRuleActionTypesAllow', 'ApplicationGatewayWafRuleActionTypesBlock', 'ApplicationGatewayWafRuleActionTypesLog' + Action ApplicationGatewayWafRuleActionTypes `json:"action,omitempty"` + // Description - The description of the web application firewall rule. + Description *string `json:"description,omitempty"` +} + +// ApplicationGatewayFirewallRuleGroup a web application firewall rule group. +type ApplicationGatewayFirewallRuleGroup struct { + // RuleGroupName - The name of the web application firewall rule group. + RuleGroupName *string `json:"ruleGroupName,omitempty"` + // Description - The description of the web application firewall rule group. + Description *string `json:"description,omitempty"` + // Rules - The rules of the web application firewall rule group. + Rules *[]ApplicationGatewayFirewallRule `json:"rules,omitempty"` +} + +// ApplicationGatewayFirewallRuleSet a web application firewall rule set. +type ApplicationGatewayFirewallRuleSet struct { + // ApplicationGatewayFirewallRuleSetPropertiesFormat - Properties of the application gateway firewall rule set. + *ApplicationGatewayFirewallRuleSetPropertiesFormat `json:"properties,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` } -// MarshalJSON is the custom marshaler for ApplicationGatewayHTTPListener. -func (aghl ApplicationGatewayHTTPListener) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ApplicationGatewayFirewallRuleSet. +func (agfrs ApplicationGatewayFirewallRuleSet) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if aghl.ApplicationGatewayHTTPListenerPropertiesFormat != nil { - objectMap["properties"] = aghl.ApplicationGatewayHTTPListenerPropertiesFormat + if agfrs.ApplicationGatewayFirewallRuleSetPropertiesFormat != nil { + objectMap["properties"] = agfrs.ApplicationGatewayFirewallRuleSetPropertiesFormat } - if aghl.Name != nil { - objectMap["name"] = aghl.Name + if agfrs.ID != nil { + objectMap["id"] = agfrs.ID } - if aghl.ID != nil { - objectMap["id"] = aghl.ID + if agfrs.Location != nil { + objectMap["location"] = agfrs.Location + } + if agfrs.Tags != nil { + objectMap["tags"] = agfrs.Tags } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayHTTPListener struct. -func (aghl *ApplicationGatewayHTTPListener) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayFirewallRuleSet struct. +func (agfrs *ApplicationGatewayFirewallRuleSet) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -1528,30 +2539,30 @@ func (aghl *ApplicationGatewayHTTPListener) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var applicationGatewayHTTPListenerPropertiesFormat ApplicationGatewayHTTPListenerPropertiesFormat - err = json.Unmarshal(*v, &applicationGatewayHTTPListenerPropertiesFormat) + var applicationGatewayFirewallRuleSetPropertiesFormat ApplicationGatewayFirewallRuleSetPropertiesFormat + err = json.Unmarshal(*v, &applicationGatewayFirewallRuleSetPropertiesFormat) if err != nil { return err } - aghl.ApplicationGatewayHTTPListenerPropertiesFormat = &applicationGatewayHTTPListenerPropertiesFormat + agfrs.ApplicationGatewayFirewallRuleSetPropertiesFormat = &applicationGatewayFirewallRuleSetPropertiesFormat } - case "name": + case "id": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var ID string + err = json.Unmarshal(*v, &ID) if err != nil { return err } - aghl.Name = &name + agfrs.ID = &ID } - case "etag": + case "name": if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - aghl.Etag = &etag + agfrs.Name = &name } case "type": if v != nil { @@ -1560,16 +2571,25 @@ func (aghl *ApplicationGatewayHTTPListener) UnmarshalJSON(body []byte) error { if err != nil { return err } - aghl.Type = &typeVar + agfrs.Type = &typeVar } - case "id": + case "location": if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) + var location string + err = json.Unmarshal(*v, &location) if err != nil { return err } - aghl.ID = &ID + agfrs.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + agfrs.Tags = tags } } } @@ -1577,74 +2597,43 @@ func (aghl *ApplicationGatewayHTTPListener) UnmarshalJSON(body []byte) error { return nil } -// ApplicationGatewayHTTPListenerPropertiesFormat properties of HTTP listener of an application gateway. -type ApplicationGatewayHTTPListenerPropertiesFormat struct { - // FrontendIPConfiguration - Frontend IP configuration resource of an application gateway. - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - // FrontendPort - Frontend port resource of an application gateway. - FrontendPort *SubResource `json:"frontendPort,omitempty"` - // Protocol - Protocol of the HTTP listener. Possible values include: 'ApplicationGatewayProtocolHTTP', 'ApplicationGatewayProtocolHTTPS', 'ApplicationGatewayProtocolTCP', 'ApplicationGatewayProtocolTLS' - Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` - // HostName - Host name of HTTP listener. - HostName *string `json:"hostName,omitempty"` - // SslCertificate - SSL certificate resource of an application gateway. - SslCertificate *SubResource `json:"sslCertificate,omitempty"` - // SslProfile - SSL profile resource of the application gateway. - SslProfile *SubResource `json:"sslProfile,omitempty"` - // RequireServerNameIndication - Applicable only if protocol is https. Enables SNI for multi-hosting. - RequireServerNameIndication *bool `json:"requireServerNameIndication,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the HTTP listener resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' +// ApplicationGatewayFirewallRuleSetPropertiesFormat properties of the web application firewall rule set. +type ApplicationGatewayFirewallRuleSetPropertiesFormat struct { + // ProvisioningState - READ-ONLY; The provisioning state of the web application firewall rule set. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // CustomErrorConfigurations - Custom error configurations of the HTTP listener. - CustomErrorConfigurations *[]ApplicationGatewayCustomError `json:"customErrorConfigurations,omitempty"` - // FirewallPolicy - Reference to the FirewallPolicy resource. - FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"` - // HostNames - List of Host names for HTTP Listener that allows special wildcard characters as well. - HostNames *[]string `json:"hostNames,omitempty"` + // RuleSetType - The type of the web application firewall rule set. + RuleSetType *string `json:"ruleSetType,omitempty"` + // RuleSetVersion - The version of the web application firewall rule set type. + RuleSetVersion *string `json:"ruleSetVersion,omitempty"` + // RuleGroups - The rule groups of the web application firewall rule set. + RuleGroups *[]ApplicationGatewayFirewallRuleGroup `json:"ruleGroups,omitempty"` + // Tiers - Tier of an application gateway that support the rule set. + Tiers *[]ApplicationGatewayTierTypes `json:"tiers,omitempty"` } -// MarshalJSON is the custom marshaler for ApplicationGatewayHTTPListenerPropertiesFormat. -func (aghlpf ApplicationGatewayHTTPListenerPropertiesFormat) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ApplicationGatewayFirewallRuleSetPropertiesFormat. +func (agfrspf ApplicationGatewayFirewallRuleSetPropertiesFormat) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if aghlpf.FrontendIPConfiguration != nil { - objectMap["frontendIPConfiguration"] = aghlpf.FrontendIPConfiguration - } - if aghlpf.FrontendPort != nil { - objectMap["frontendPort"] = aghlpf.FrontendPort - } - if aghlpf.Protocol != "" { - objectMap["protocol"] = aghlpf.Protocol - } - if aghlpf.HostName != nil { - objectMap["hostName"] = aghlpf.HostName - } - if aghlpf.SslCertificate != nil { - objectMap["sslCertificate"] = aghlpf.SslCertificate - } - if aghlpf.SslProfile != nil { - objectMap["sslProfile"] = aghlpf.SslProfile - } - if aghlpf.RequireServerNameIndication != nil { - objectMap["requireServerNameIndication"] = aghlpf.RequireServerNameIndication + if agfrspf.RuleSetType != nil { + objectMap["ruleSetType"] = agfrspf.RuleSetType } - if aghlpf.CustomErrorConfigurations != nil { - objectMap["customErrorConfigurations"] = aghlpf.CustomErrorConfigurations + if agfrspf.RuleSetVersion != nil { + objectMap["ruleSetVersion"] = agfrspf.RuleSetVersion } - if aghlpf.FirewallPolicy != nil { - objectMap["firewallPolicy"] = aghlpf.FirewallPolicy + if agfrspf.RuleGroups != nil { + objectMap["ruleGroups"] = agfrspf.RuleGroups } - if aghlpf.HostNames != nil { - objectMap["hostNames"] = aghlpf.HostNames + if agfrspf.Tiers != nil { + objectMap["tiers"] = agfrspf.Tiers } return json.Marshal(objectMap) } -// ApplicationGatewayIPConfiguration IP configuration of an application gateway. Currently 1 public and 1 -// private IP configuration is allowed. -type ApplicationGatewayIPConfiguration struct { - // ApplicationGatewayIPConfigurationPropertiesFormat - Properties of the application gateway IP configuration. - *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - // Name - Name of the IP configuration that is unique within an Application Gateway. +// ApplicationGatewayFrontendIPConfiguration frontend IP configuration of an application gateway. +type ApplicationGatewayFrontendIPConfiguration struct { + // ApplicationGatewayFrontendIPConfigurationPropertiesFormat - Properties of the application gateway frontend IP configuration. + *ApplicationGatewayFrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` + // Name - Name of the frontend IP configuration that is unique within an Application Gateway. Name *string `json:"name,omitempty"` // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` @@ -1654,14 +2643,415 @@ type ApplicationGatewayIPConfiguration struct { ID *string `json:"id,omitempty"` } -// MarshalJSON is the custom marshaler for ApplicationGatewayIPConfiguration. -func (agic ApplicationGatewayIPConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ApplicationGatewayFrontendIPConfiguration. +func (agfic ApplicationGatewayFrontendIPConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if agic.ApplicationGatewayIPConfigurationPropertiesFormat != nil { - objectMap["properties"] = agic.ApplicationGatewayIPConfigurationPropertiesFormat + if agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat != nil { + objectMap["properties"] = agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat } - if agic.Name != nil { - objectMap["name"] = agic.Name + if agfic.Name != nil { + objectMap["name"] = agfic.Name + } + if agfic.ID != nil { + objectMap["id"] = agfic.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayFrontendIPConfiguration struct. +func (agfic *ApplicationGatewayFrontendIPConfiguration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var applicationGatewayFrontendIPConfigurationPropertiesFormat ApplicationGatewayFrontendIPConfigurationPropertiesFormat + err = json.Unmarshal(*v, &applicationGatewayFrontendIPConfigurationPropertiesFormat) + if err != nil { + return err + } + agfic.ApplicationGatewayFrontendIPConfigurationPropertiesFormat = &applicationGatewayFrontendIPConfigurationPropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + agfic.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + agfic.Etag = &etag + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + agfic.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + agfic.ID = &ID + } + } + } + + return nil +} + +// ApplicationGatewayFrontendIPConfigurationPropertiesFormat properties of Frontend IP configuration of an +// application gateway. +type ApplicationGatewayFrontendIPConfigurationPropertiesFormat struct { + // PrivateIPAddress - PrivateIPAddress of the network interface IP Configuration. + PrivateIPAddress *string `json:"privateIPAddress,omitempty"` + // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'Static', 'Dynamic' + PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` + // Subnet - Reference to the subnet resource. + Subnet *SubResource `json:"subnet,omitempty"` + // PublicIPAddress - Reference to the PublicIP resource. + PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` + // PrivateLinkConfiguration - Reference to the application gateway private link configuration. + PrivateLinkConfiguration *SubResource `json:"privateLinkConfiguration,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the frontend IP configuration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for ApplicationGatewayFrontendIPConfigurationPropertiesFormat. +func (agficpf ApplicationGatewayFrontendIPConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agficpf.PrivateIPAddress != nil { + objectMap["privateIPAddress"] = agficpf.PrivateIPAddress + } + if agficpf.PrivateIPAllocationMethod != "" { + objectMap["privateIPAllocationMethod"] = agficpf.PrivateIPAllocationMethod + } + if agficpf.Subnet != nil { + objectMap["subnet"] = agficpf.Subnet + } + if agficpf.PublicIPAddress != nil { + objectMap["publicIPAddress"] = agficpf.PublicIPAddress + } + if agficpf.PrivateLinkConfiguration != nil { + objectMap["privateLinkConfiguration"] = agficpf.PrivateLinkConfiguration + } + return json.Marshal(objectMap) +} + +// ApplicationGatewayFrontendPort frontend port of an application gateway. +type ApplicationGatewayFrontendPort struct { + // ApplicationGatewayFrontendPortPropertiesFormat - Properties of the application gateway frontend port. + *ApplicationGatewayFrontendPortPropertiesFormat `json:"properties,omitempty"` + // Name - Name of the frontend port that is unique within an Application Gateway. + Name *string `json:"name,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // Type - READ-ONLY; Type of the resource. + Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for ApplicationGatewayFrontendPort. +func (agfp ApplicationGatewayFrontendPort) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agfp.ApplicationGatewayFrontendPortPropertiesFormat != nil { + objectMap["properties"] = agfp.ApplicationGatewayFrontendPortPropertiesFormat + } + if agfp.Name != nil { + objectMap["name"] = agfp.Name + } + if agfp.ID != nil { + objectMap["id"] = agfp.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayFrontendPort struct. +func (agfp *ApplicationGatewayFrontendPort) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var applicationGatewayFrontendPortPropertiesFormat ApplicationGatewayFrontendPortPropertiesFormat + err = json.Unmarshal(*v, &applicationGatewayFrontendPortPropertiesFormat) + if err != nil { + return err + } + agfp.ApplicationGatewayFrontendPortPropertiesFormat = &applicationGatewayFrontendPortPropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + agfp.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + agfp.Etag = &etag + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + agfp.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + agfp.ID = &ID + } + } + } + + return nil +} + +// ApplicationGatewayFrontendPortPropertiesFormat properties of Frontend port of an application gateway. +type ApplicationGatewayFrontendPortPropertiesFormat struct { + // Port - Frontend port. + Port *int32 `json:"port,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the frontend port resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for ApplicationGatewayFrontendPortPropertiesFormat. +func (agfppf ApplicationGatewayFrontendPortPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agfppf.Port != nil { + objectMap["port"] = agfppf.Port + } + return json.Marshal(objectMap) +} + +// ApplicationGatewayGlobalConfiguration application Gateway global configuration. +type ApplicationGatewayGlobalConfiguration struct { + // EnableRequestBuffering - Enable request buffering. + EnableRequestBuffering *bool `json:"enableRequestBuffering,omitempty"` + // EnableResponseBuffering - Enable response buffering. + EnableResponseBuffering *bool `json:"enableResponseBuffering,omitempty"` +} + +// ApplicationGatewayHeaderConfiguration header configuration of the Actions set in Application Gateway. +type ApplicationGatewayHeaderConfiguration struct { + // HeaderName - Header name of the header configuration. + HeaderName *string `json:"headerName,omitempty"` + // HeaderValue - Header value of the header configuration. + HeaderValue *string `json:"headerValue,omitempty"` +} + +// ApplicationGatewayHTTPListener http listener of an application gateway. +type ApplicationGatewayHTTPListener struct { + // ApplicationGatewayHTTPListenerPropertiesFormat - Properties of the application gateway HTTP listener. + *ApplicationGatewayHTTPListenerPropertiesFormat `json:"properties,omitempty"` + // Name - Name of the HTTP listener that is unique within an Application Gateway. + Name *string `json:"name,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // Type - READ-ONLY; Type of the resource. + Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for ApplicationGatewayHTTPListener. +func (aghl ApplicationGatewayHTTPListener) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aghl.ApplicationGatewayHTTPListenerPropertiesFormat != nil { + objectMap["properties"] = aghl.ApplicationGatewayHTTPListenerPropertiesFormat + } + if aghl.Name != nil { + objectMap["name"] = aghl.Name + } + if aghl.ID != nil { + objectMap["id"] = aghl.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayHTTPListener struct. +func (aghl *ApplicationGatewayHTTPListener) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var applicationGatewayHTTPListenerPropertiesFormat ApplicationGatewayHTTPListenerPropertiesFormat + err = json.Unmarshal(*v, &applicationGatewayHTTPListenerPropertiesFormat) + if err != nil { + return err + } + aghl.ApplicationGatewayHTTPListenerPropertiesFormat = &applicationGatewayHTTPListenerPropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + aghl.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + aghl.Etag = &etag + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + aghl.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + aghl.ID = &ID + } + } + } + + return nil +} + +// ApplicationGatewayHTTPListenerPropertiesFormat properties of HTTP listener of an application gateway. +type ApplicationGatewayHTTPListenerPropertiesFormat struct { + // FrontendIPConfiguration - Frontend IP configuration resource of an application gateway. + FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` + // FrontendPort - Frontend port resource of an application gateway. + FrontendPort *SubResource `json:"frontendPort,omitempty"` + // Protocol - Protocol of the HTTP listener. Possible values include: 'HTTP', 'HTTPS', 'TCP', 'TLS' + Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` + // HostName - Host name of HTTP listener. + HostName *string `json:"hostName,omitempty"` + // SslCertificate - SSL certificate resource of an application gateway. + SslCertificate *SubResource `json:"sslCertificate,omitempty"` + // SslProfile - SSL profile resource of the application gateway. + SslProfile *SubResource `json:"sslProfile,omitempty"` + // RequireServerNameIndication - Applicable only if protocol is https. Enables SNI for multi-hosting. + RequireServerNameIndication *bool `json:"requireServerNameIndication,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the HTTP listener resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // CustomErrorConfigurations - Custom error configurations of the HTTP listener. + CustomErrorConfigurations *[]ApplicationGatewayCustomError `json:"customErrorConfigurations,omitempty"` + // FirewallPolicy - Reference to the FirewallPolicy resource. + FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"` + // HostNames - List of Host names for HTTP Listener that allows special wildcard characters as well. + HostNames *[]string `json:"hostNames,omitempty"` +} + +// MarshalJSON is the custom marshaler for ApplicationGatewayHTTPListenerPropertiesFormat. +func (aghlpf ApplicationGatewayHTTPListenerPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aghlpf.FrontendIPConfiguration != nil { + objectMap["frontendIPConfiguration"] = aghlpf.FrontendIPConfiguration + } + if aghlpf.FrontendPort != nil { + objectMap["frontendPort"] = aghlpf.FrontendPort + } + if aghlpf.Protocol != "" { + objectMap["protocol"] = aghlpf.Protocol + } + if aghlpf.HostName != nil { + objectMap["hostName"] = aghlpf.HostName + } + if aghlpf.SslCertificate != nil { + objectMap["sslCertificate"] = aghlpf.SslCertificate + } + if aghlpf.SslProfile != nil { + objectMap["sslProfile"] = aghlpf.SslProfile + } + if aghlpf.RequireServerNameIndication != nil { + objectMap["requireServerNameIndication"] = aghlpf.RequireServerNameIndication + } + if aghlpf.CustomErrorConfigurations != nil { + objectMap["customErrorConfigurations"] = aghlpf.CustomErrorConfigurations + } + if aghlpf.FirewallPolicy != nil { + objectMap["firewallPolicy"] = aghlpf.FirewallPolicy + } + if aghlpf.HostNames != nil { + objectMap["hostNames"] = aghlpf.HostNames + } + return json.Marshal(objectMap) +} + +// ApplicationGatewayIPConfiguration IP configuration of an application gateway. Currently 1 public and 1 +// private IP configuration is allowed. +type ApplicationGatewayIPConfiguration struct { + // ApplicationGatewayIPConfigurationPropertiesFormat - Properties of the application gateway IP configuration. + *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` + // Name - Name of the IP configuration that is unique within an Application Gateway. + Name *string `json:"name,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // Type - READ-ONLY; Type of the resource. + Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for ApplicationGatewayIPConfiguration. +func (agic ApplicationGatewayIPConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agic.ApplicationGatewayIPConfigurationPropertiesFormat != nil { + objectMap["properties"] = agic.ApplicationGatewayIPConfigurationPropertiesFormat + } + if agic.Name != nil { + objectMap["name"] = agic.Name } if agic.ID != nil { objectMap["id"] = agic.ID @@ -1842,7 +3232,7 @@ type ApplicationGatewayListenerPropertiesFormat struct { FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` // FrontendPort - Frontend port resource of an application gateway. FrontendPort *SubResource `json:"frontendPort,omitempty"` - // Protocol - Protocol of the listener. Possible values include: 'ApplicationGatewayProtocolHTTP', 'ApplicationGatewayProtocolHTTPS', 'ApplicationGatewayProtocolTCP', 'ApplicationGatewayProtocolTLS' + // Protocol - Protocol of the listener. Possible values include: 'HTTP', 'HTTPS', 'TCP', 'TLS' Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` // SslCertificate - SSL certificate resource of an application gateway. SslCertificate *SubResource `json:"sslCertificate,omitempty"` @@ -2126,7 +3516,7 @@ func (agldp *ApplicationGatewayLoadDistributionPolicy) UnmarshalJSON(body []byte type ApplicationGatewayLoadDistributionPolicyPropertiesFormat struct { // LoadDistributionTargets - Load Distribution Targets resource of an application gateway. LoadDistributionTargets *[]ApplicationGatewayLoadDistributionTarget `json:"loadDistributionTargets,omitempty"` - // LoadDistributionAlgorithm - Load Distribution Targets resource of an application gateway. Possible values include: 'ApplicationGatewayLoadDistributionAlgorithmRoundRobin', 'ApplicationGatewayLoadDistributionAlgorithmLeastConnections', 'ApplicationGatewayLoadDistributionAlgorithmIPHash' + // LoadDistributionAlgorithm - Load Distribution Targets resource of an application gateway. Possible values include: 'RoundRobin', 'LeastConnections', 'IPHash' LoadDistributionAlgorithm ApplicationGatewayLoadDistributionAlgorithm `json:"loadDistributionAlgorithm,omitempty"` // ProvisioningState - READ-ONLY; The provisioning state of the Load Distribution Policy resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` @@ -2243,7 +3633,7 @@ type ApplicationGatewayLoadDistributionTargetPropertiesFormat struct { // ApplicationGatewayOnDemandProbe details of on demand test probe request. type ApplicationGatewayOnDemandProbe struct { - // Protocol - The protocol used for the probe. Possible values include: 'ApplicationGatewayProtocolHTTP', 'ApplicationGatewayProtocolHTTPS', 'ApplicationGatewayProtocolTCP', 'ApplicationGatewayProtocolTLS' + // Protocol - The protocol used for the probe. Possible values include: 'HTTP', 'HTTPS', 'TCP', 'TLS' Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` // Host - Host name to send the probe to. Host *string `json:"host,omitempty"` @@ -2953,7 +4343,7 @@ func (agplic *ApplicationGatewayPrivateLinkIPConfiguration) UnmarshalJSON(body [ type ApplicationGatewayPrivateLinkIPConfigurationProperties struct { // PrivateIPAddress - The private IP address of the IP configuration. PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'IPAllocationMethodStatic', 'IPAllocationMethodDynamic' + // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'Static', 'Dynamic' PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` // Subnet - Reference to the subnet resource. Subnet *SubResource `json:"subnet,omitempty"` @@ -3350,7 +4740,7 @@ type ApplicationGatewayProbeHealthResponseMatch struct { // ApplicationGatewayProbePropertiesFormat properties of probe of an application gateway. type ApplicationGatewayProbePropertiesFormat struct { - // Protocol - The protocol used for the probe. Possible values include: 'ApplicationGatewayProtocolHTTP', 'ApplicationGatewayProtocolHTTPS', 'ApplicationGatewayProtocolTCP', 'ApplicationGatewayProtocolTLS' + // Protocol - The protocol used for the probe. Possible values include: 'HTTP', 'HTTPS', 'TCP', 'TLS' Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` // Host - Host name to send the probe to. Host *string `json:"host,omitempty"` @@ -3421,7 +4811,7 @@ type ApplicationGatewayPropertiesFormat struct { Sku *ApplicationGatewaySku `json:"sku,omitempty"` // SslPolicy - SSL policy of the application gateway resource. SslPolicy *ApplicationGatewaySslPolicy `json:"sslPolicy,omitempty"` - // OperationalState - READ-ONLY; Operational state of the application gateway resource. Possible values include: 'ApplicationGatewayOperationalStateStopped', 'ApplicationGatewayOperationalStateStarting', 'ApplicationGatewayOperationalStateRunning', 'ApplicationGatewayOperationalStateStopping' + // OperationalState - READ-ONLY; Operational state of the application gateway resource. Possible values include: 'Stopped', 'Starting', 'Running', 'Stopping' OperationalState ApplicationGatewayOperationalState `json:"operationalState,omitempty"` // GatewayIPConfigurations - Subnets of the application gateway resource. For default limits, see [Application Gateway limits](https://docs.microsoft.com/azure/azure-subscription-service-limits#application-gateway-limits). GatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"gatewayIPConfigurations,omitempty"` @@ -3680,7 +5070,7 @@ func (agrc *ApplicationGatewayRedirectConfiguration) UnmarshalJSON(body []byte) // ApplicationGatewayRedirectConfigurationPropertiesFormat properties of redirect configuration of the // application gateway. type ApplicationGatewayRedirectConfigurationPropertiesFormat struct { - // RedirectType - HTTP redirection type. Possible values include: 'ApplicationGatewayRedirectTypePermanent', 'ApplicationGatewayRedirectTypeFound', 'ApplicationGatewayRedirectTypeSeeOther', 'ApplicationGatewayRedirectTypeTemporary' + // RedirectType - HTTP redirection type. Possible values include: 'Permanent', 'Found', 'SeeOther', 'Temporary' RedirectType ApplicationGatewayRedirectType `json:"redirectType,omitempty"` // TargetListener - Reference to a listener to redirect the request to. TargetListener *SubResource `json:"targetListener,omitempty"` @@ -3790,7 +5180,7 @@ func (agrrr *ApplicationGatewayRequestRoutingRule) UnmarshalJSON(body []byte) er // ApplicationGatewayRequestRoutingRulePropertiesFormat properties of request routing rule of the // application gateway. type ApplicationGatewayRequestRoutingRulePropertiesFormat struct { - // RuleType - Rule type. Possible values include: 'ApplicationGatewayRequestRoutingRuleTypeBasic', 'ApplicationGatewayRequestRoutingRuleTypePathBasedRouting' + // RuleType - Rule type. Possible values include: 'Basic', 'PathBasedRouting' RuleType ApplicationGatewayRequestRoutingRuleType `json:"ruleType,omitempty"` // Priority - Priority of the request routing rule. Priority *int32 `json:"priority,omitempty"` @@ -4066,7 +5456,7 @@ func (agrr *ApplicationGatewayRoutingRule) UnmarshalJSON(body []byte) error { // ApplicationGatewayRoutingRulePropertiesFormat properties of routing rule of the application gateway. type ApplicationGatewayRoutingRulePropertiesFormat struct { - // RuleType - Rule type. Possible values include: 'ApplicationGatewayRequestRoutingRuleTypeBasic', 'ApplicationGatewayRequestRoutingRuleTypePathBasedRouting' + // RuleType - Rule type. Possible values include: 'Basic', 'PathBasedRouting' RuleType ApplicationGatewayRequestRoutingRuleType `json:"ruleType,omitempty"` // Priority - Priority of the routing rule. Priority *int32 `json:"priority,omitempty"` @@ -4269,9 +5659,9 @@ func (future *ApplicationGatewaysDeleteFuture) result(client ApplicationGateways // ApplicationGatewaySku SKU of an application gateway. type ApplicationGatewaySku struct { - // Name - Name of an application gateway SKU. Possible values include: 'ApplicationGatewaySkuNameStandardSmall', 'ApplicationGatewaySkuNameStandardMedium', 'ApplicationGatewaySkuNameStandardLarge', 'ApplicationGatewaySkuNameWAFMedium', 'ApplicationGatewaySkuNameWAFLarge', 'ApplicationGatewaySkuNameStandardV2', 'ApplicationGatewaySkuNameWAFV2' + // Name - Name of an application gateway SKU. Possible values include: 'StandardSmall', 'StandardMedium', 'StandardLarge', 'WAFMedium', 'WAFLarge', 'StandardV2', 'StandardBasic', 'WAFV2' Name ApplicationGatewaySkuName `json:"name,omitempty"` - // Tier - Tier of an application gateway. Possible values include: 'ApplicationGatewayTierStandard', 'ApplicationGatewayTierWAF', 'ApplicationGatewayTierStandardV2', 'ApplicationGatewayTierWAFV2' + // Tier - Tier of an application gateway. Possible values include: 'ApplicationGatewayTierStandard', 'ApplicationGatewayTierWAF', 'ApplicationGatewayTierStandardV2', 'ApplicationGatewayTierWAFV2', 'ApplicationGatewayTierStandardBasic' Tier ApplicationGatewayTier `json:"tier,omitempty"` // Capacity - Capacity (instance count) of an application gateway. Capacity *int32 `json:"capacity,omitempty"` @@ -4400,13 +5790,13 @@ func (agscpf ApplicationGatewaySslCertificatePropertiesFormat) MarshalJSON() ([] type ApplicationGatewaySslPolicy struct { // DisabledSslProtocols - Ssl protocols to be disabled on application gateway. DisabledSslProtocols *[]ApplicationGatewaySslProtocol `json:"disabledSslProtocols,omitempty"` - // PolicyType - Type of Ssl Policy. Possible values include: 'ApplicationGatewaySslPolicyTypePredefined', 'ApplicationGatewaySslPolicyTypeCustom' + // PolicyType - Type of Ssl Policy. Possible values include: 'Predefined', 'Custom', 'CustomV2' PolicyType ApplicationGatewaySslPolicyType `json:"policyType,omitempty"` - // PolicyName - Name of Ssl predefined policy. Possible values include: 'ApplicationGatewaySslPolicyNameAppGwSslPolicy20150501', 'ApplicationGatewaySslPolicyNameAppGwSslPolicy20170401', 'ApplicationGatewaySslPolicyNameAppGwSslPolicy20170401S' + // PolicyName - Name of Ssl predefined policy. Possible values include: 'AppGwSslPolicy20150501', 'AppGwSslPolicy20170401', 'AppGwSslPolicy20170401S', 'AppGwSslPolicy20220101', 'AppGwSslPolicy20220101S' PolicyName ApplicationGatewaySslPolicyName `json:"policyName,omitempty"` // CipherSuites - Ssl cipher suites to be enabled in the specified order to application gateway. CipherSuites *[]ApplicationGatewaySslCipherSuite `json:"cipherSuites,omitempty"` - // MinProtocolVersion - Minimum version of Ssl protocol to be supported on application gateway. Possible values include: 'ApplicationGatewaySslProtocolTLSv10', 'ApplicationGatewaySslProtocolTLSv11', 'ApplicationGatewaySslProtocolTLSv12' + // MinProtocolVersion - Minimum version of Ssl protocol to be supported on application gateway. Possible values include: 'TLSv10', 'TLSv11', 'TLSv12', 'TLSv13' MinProtocolVersion ApplicationGatewaySslProtocol `json:"minProtocolVersion,omitempty"` } @@ -4483,7 +5873,7 @@ func (agspp *ApplicationGatewaySslPredefinedPolicy) UnmarshalJSON(body []byte) e type ApplicationGatewaySslPredefinedPolicyPropertiesFormat struct { // CipherSuites - Ssl cipher suites to be enabled in the specified order for application gateway. CipherSuites *[]ApplicationGatewaySslCipherSuite `json:"cipherSuites,omitempty"` - // MinProtocolVersion - Minimum version of Ssl protocol to be supported on application gateway. Possible values include: 'ApplicationGatewaySslProtocolTLSv10', 'ApplicationGatewaySslProtocolTLSv11', 'ApplicationGatewaySslProtocolTLSv12' + // MinProtocolVersion - Minimum version of Ssl protocol to be supported on application gateway. Possible values include: 'TLSv10', 'TLSv11', 'TLSv12', 'TLSv13' MinProtocolVersion ApplicationGatewaySslProtocol `json:"minProtocolVersion,omitempty"` } @@ -5042,12 +6432,304 @@ func (agupmpf ApplicationGatewayURLPathMapPropertiesFormat) MarshalJSON() ([]byt return json.Marshal(objectMap) } +// ApplicationGatewayWafDynamicManifestPropertiesResult properties of ApplicationGatewayWafDynamicManifest. +type ApplicationGatewayWafDynamicManifestPropertiesResult struct { + // DefaultRuleSetPropertyFormat - The default ruleset. + *DefaultRuleSetPropertyFormat `json:"defaultRuleSet,omitempty"` + // AvailableRuleSets - The available rulesets. + AvailableRuleSets *[]ApplicationGatewayFirewallManifestRuleSet `json:"availableRuleSets,omitempty"` +} + +// MarshalJSON is the custom marshaler for ApplicationGatewayWafDynamicManifestPropertiesResult. +func (agwdmpr ApplicationGatewayWafDynamicManifestPropertiesResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agwdmpr.DefaultRuleSetPropertyFormat != nil { + objectMap["defaultRuleSet"] = agwdmpr.DefaultRuleSetPropertyFormat + } + if agwdmpr.AvailableRuleSets != nil { + objectMap["availableRuleSets"] = agwdmpr.AvailableRuleSets + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayWafDynamicManifestPropertiesResult struct. +func (agwdmpr *ApplicationGatewayWafDynamicManifestPropertiesResult) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "defaultRuleSet": + if v != nil { + var defaultRuleSetPropertyFormat DefaultRuleSetPropertyFormat + err = json.Unmarshal(*v, &defaultRuleSetPropertyFormat) + if err != nil { + return err + } + agwdmpr.DefaultRuleSetPropertyFormat = &defaultRuleSetPropertyFormat + } + case "availableRuleSets": + if v != nil { + var availableRuleSets []ApplicationGatewayFirewallManifestRuleSet + err = json.Unmarshal(*v, &availableRuleSets) + if err != nil { + return err + } + agwdmpr.AvailableRuleSets = &availableRuleSets + } + } + } + + return nil +} + +// ApplicationGatewayWafDynamicManifestResult response for ApplicationGatewayWafDynamicManifest API service +// call. +type ApplicationGatewayWafDynamicManifestResult struct { + autorest.Response `json:"-"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // ApplicationGatewayWafDynamicManifestPropertiesResult - Properties of the ApplicationGatewayWafDynamicManifest . + *ApplicationGatewayWafDynamicManifestPropertiesResult `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ApplicationGatewayWafDynamicManifestResult. +func (agwdmr ApplicationGatewayWafDynamicManifestResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agwdmr.ID != nil { + objectMap["id"] = agwdmr.ID + } + if agwdmr.ApplicationGatewayWafDynamicManifestPropertiesResult != nil { + objectMap["properties"] = agwdmr.ApplicationGatewayWafDynamicManifestPropertiesResult + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ApplicationGatewayWafDynamicManifestResult struct. +func (agwdmr *ApplicationGatewayWafDynamicManifestResult) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + agwdmr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + agwdmr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + agwdmr.Type = &typeVar + } + case "properties": + if v != nil { + var applicationGatewayWafDynamicManifestPropertiesResult ApplicationGatewayWafDynamicManifestPropertiesResult + err = json.Unmarshal(*v, &applicationGatewayWafDynamicManifestPropertiesResult) + if err != nil { + return err + } + agwdmr.ApplicationGatewayWafDynamicManifestPropertiesResult = &applicationGatewayWafDynamicManifestPropertiesResult + } + } + } + + return nil +} + +// ApplicationGatewayWafDynamicManifestResultList response for ApplicationGatewayWafDynamicManifests API +// service call. +type ApplicationGatewayWafDynamicManifestResultList struct { + autorest.Response `json:"-"` + // Value - The list of application gateway waf manifest. + Value *[]ApplicationGatewayWafDynamicManifestResult `json:"value,omitempty"` + // NextLink - URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ApplicationGatewayWafDynamicManifestResultListIterator provides access to a complete listing of +// ApplicationGatewayWafDynamicManifestResult values. +type ApplicationGatewayWafDynamicManifestResultListIterator struct { + i int + page ApplicationGatewayWafDynamicManifestResultListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ApplicationGatewayWafDynamicManifestResultListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayWafDynamicManifestResultListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ApplicationGatewayWafDynamicManifestResultListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ApplicationGatewayWafDynamicManifestResultListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ApplicationGatewayWafDynamicManifestResultListIterator) Response() ApplicationGatewayWafDynamicManifestResultList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ApplicationGatewayWafDynamicManifestResultListIterator) Value() ApplicationGatewayWafDynamicManifestResult { + if !iter.page.NotDone() { + return ApplicationGatewayWafDynamicManifestResult{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ApplicationGatewayWafDynamicManifestResultListIterator type. +func NewApplicationGatewayWafDynamicManifestResultListIterator(page ApplicationGatewayWafDynamicManifestResultListPage) ApplicationGatewayWafDynamicManifestResultListIterator { + return ApplicationGatewayWafDynamicManifestResultListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (agwdmrl ApplicationGatewayWafDynamicManifestResultList) IsEmpty() bool { + return agwdmrl.Value == nil || len(*agwdmrl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (agwdmrl ApplicationGatewayWafDynamicManifestResultList) hasNextLink() bool { + return agwdmrl.NextLink != nil && len(*agwdmrl.NextLink) != 0 +} + +// applicationGatewayWafDynamicManifestResultListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (agwdmrl ApplicationGatewayWafDynamicManifestResultList) applicationGatewayWafDynamicManifestResultListPreparer(ctx context.Context) (*http.Request, error) { + if !agwdmrl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(agwdmrl.NextLink))) +} + +// ApplicationGatewayWafDynamicManifestResultListPage contains a page of +// ApplicationGatewayWafDynamicManifestResult values. +type ApplicationGatewayWafDynamicManifestResultListPage struct { + fn func(context.Context, ApplicationGatewayWafDynamicManifestResultList) (ApplicationGatewayWafDynamicManifestResultList, error) + agwdmrl ApplicationGatewayWafDynamicManifestResultList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ApplicationGatewayWafDynamicManifestResultListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGatewayWafDynamicManifestResultListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.agwdmrl) + if err != nil { + return err + } + page.agwdmrl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ApplicationGatewayWafDynamicManifestResultListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ApplicationGatewayWafDynamicManifestResultListPage) NotDone() bool { + return !page.agwdmrl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ApplicationGatewayWafDynamicManifestResultListPage) Response() ApplicationGatewayWafDynamicManifestResultList { + return page.agwdmrl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ApplicationGatewayWafDynamicManifestResultListPage) Values() []ApplicationGatewayWafDynamicManifestResult { + if page.agwdmrl.IsEmpty() { + return nil + } + return *page.agwdmrl.Value +} + +// Creates a new instance of the ApplicationGatewayWafDynamicManifestResultListPage type. +func NewApplicationGatewayWafDynamicManifestResultListPage(cur ApplicationGatewayWafDynamicManifestResultList, getNextPage func(context.Context, ApplicationGatewayWafDynamicManifestResultList) (ApplicationGatewayWafDynamicManifestResultList, error)) ApplicationGatewayWafDynamicManifestResultListPage { + return ApplicationGatewayWafDynamicManifestResultListPage{ + fn: getNextPage, + agwdmrl: cur, + } +} + // ApplicationGatewayWebApplicationFirewallConfiguration application gateway web application firewall // configuration. type ApplicationGatewayWebApplicationFirewallConfiguration struct { // Enabled - Whether the web application firewall is enabled or not. Enabled *bool `json:"enabled,omitempty"` - // FirewallMode - Web application firewall mode. Possible values include: 'ApplicationGatewayFirewallModeDetection', 'ApplicationGatewayFirewallModePrevention' + // FirewallMode - Web application firewall mode. Possible values include: 'Detection', 'Prevention' FirewallMode ApplicationGatewayFirewallMode `json:"firewallMode,omitempty"` // RuleSetType - The type of the web application firewall rule set. Possible values are: 'OWASP'. RuleSetType *string `json:"ruleSetType,omitempty"` @@ -5706,7 +7388,7 @@ func NewAuthorizationListResultPage(cur AuthorizationListResult, getNextPage fun type AuthorizationPropertiesFormat struct { // AuthorizationKey - The authorization key. AuthorizationKey *string `json:"authorizationKey,omitempty"` - // AuthorizationUseStatus - The authorization use status. Possible values include: 'AuthorizationUseStatusAvailable', 'AuthorizationUseStatusInUse' + // AuthorizationUseStatus - The authorization use status. Possible values include: 'Available', 'InUse' AuthorizationUseStatus AuthorizationUseStatus `json:"authorizationUseStatus,omitempty"` // ProvisioningState - READ-ONLY; The provisioning state of the authorization resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` @@ -7354,7 +9036,7 @@ func NewAzureFirewallListResultPage(cur AzureFirewallListResult, getNextPage fun // AzureFirewallNatRCAction azureFirewall NAT Rule Collection Action. type AzureFirewallNatRCAction struct { - // Type - The type of action. Possible values include: 'AzureFirewallNatRCActionTypeSnat', 'AzureFirewallNatRCActionTypeDnat' + // Type - The type of action. Possible values include: 'Snat', 'Dnat' Type AzureFirewallNatRCActionType `json:"type,omitempty"` } @@ -7777,12 +9459,55 @@ func (future *AzureFirewallsDeleteFuture) result(client AzureFirewallsClient) (a // AzureFirewallSku SKU of an Azure Firewall. type AzureFirewallSku struct { - // Name - Name of an Azure Firewall SKU. Possible values include: 'AzureFirewallSkuNameAZFWVNet', 'AzureFirewallSkuNameAZFWHub' + // Name - Name of an Azure Firewall SKU. Possible values include: 'AZFWVNet', 'AZFWHub' Name AzureFirewallSkuName `json:"name,omitempty"` // Tier - Tier of an Azure Firewall. Possible values include: 'AzureFirewallSkuTierStandard', 'AzureFirewallSkuTierPremium', 'AzureFirewallSkuTierBasic' Tier AzureFirewallSkuTier `json:"tier,omitempty"` } +// AzureFirewallsListLearnedPrefixesFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AzureFirewallsListLearnedPrefixesFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AzureFirewallsClient) (IPPrefixesList, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AzureFirewallsListLearnedPrefixesFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AzureFirewallsListLearnedPrefixesFuture.Result. +func (future *AzureFirewallsListLearnedPrefixesFuture) result(client AzureFirewallsClient) (ipl IPPrefixesList, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AzureFirewallsListLearnedPrefixesFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ipl.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.AzureFirewallsListLearnedPrefixesFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ipl.Response.Response, err = future.GetResult(sender); err == nil && ipl.Response.Response.StatusCode != http.StatusNoContent { + ipl, err = client.ListLearnedPrefixesResponder(ipl.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AzureFirewallsListLearnedPrefixesFuture", "Result", ipl.Response.Response, "Failure responding to request") + } + } + return +} + // AzureFirewallsUpdateTagsFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type AzureFirewallsUpdateTagsFuture struct { @@ -8256,6 +9981,8 @@ type BackendAddressPoolPropertiesFormat struct { ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // DrainPeriodInSeconds - Amount of seconds Load Balancer waits for before sending RESET to client and backend address. DrainPeriodInSeconds *int32 `json:"drainPeriodInSeconds,omitempty"` + // VirtualNetwork - A reference to a virtual network. + VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` } // MarshalJSON is the custom marshaler for BackendAddressPoolPropertiesFormat. @@ -8273,9 +10000,124 @@ func (bappf BackendAddressPoolPropertiesFormat) MarshalJSON() ([]byte, error) { if bappf.DrainPeriodInSeconds != nil { objectMap["drainPeriodInSeconds"] = bappf.DrainPeriodInSeconds } + if bappf.VirtualNetwork != nil { + objectMap["virtualNetwork"] = bappf.VirtualNetwork + } return json.Marshal(objectMap) } +// BasicBaseAdminRule network base admin rule. +type BasicBaseAdminRule interface { + AsAdminRule() (*AdminRule, bool) + AsDefaultAdminRule() (*DefaultAdminRule, bool) + AsBaseAdminRule() (*BaseAdminRule, bool) +} + +// BaseAdminRule network base admin rule. +type BaseAdminRule struct { + autorest.Response `json:"-"` + // SystemData - READ-ONLY; The system metadata related to this resource. + SystemData *SystemData `json:"systemData,omitempty"` + // Kind - Possible values include: 'KindBasicBaseAdminRuleKindBaseAdminRule', 'KindBasicBaseAdminRuleKindCustom', 'KindBasicBaseAdminRuleKindDefault' + Kind KindBasicBaseAdminRule `json:"kind,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` +} + +func unmarshalBasicBaseAdminRule(body []byte) (BasicBaseAdminRule, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindBasicBaseAdminRuleKindCustom): + var ar AdminRule + err := json.Unmarshal(body, &ar) + return ar, err + case string(KindBasicBaseAdminRuleKindDefault): + var dar DefaultAdminRule + err := json.Unmarshal(body, &dar) + return dar, err + default: + var bar BaseAdminRule + err := json.Unmarshal(body, &bar) + return bar, err + } +} +func unmarshalBasicBaseAdminRuleArray(body []byte) ([]BasicBaseAdminRule, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + barArray := make([]BasicBaseAdminRule, len(rawMessages)) + + for index, rawMessage := range rawMessages { + bar, err := unmarshalBasicBaseAdminRule(*rawMessage) + if err != nil { + return nil, err + } + barArray[index] = bar + } + return barArray, nil +} + +// MarshalJSON is the custom marshaler for BaseAdminRule. +func (bar BaseAdminRule) MarshalJSON() ([]byte, error) { + bar.Kind = KindBasicBaseAdminRuleKindBaseAdminRule + objectMap := make(map[string]interface{}) + if bar.Kind != "" { + objectMap["kind"] = bar.Kind + } + return json.Marshal(objectMap) +} + +// AsAdminRule is the BasicBaseAdminRule implementation for BaseAdminRule. +func (bar BaseAdminRule) AsAdminRule() (*AdminRule, bool) { + return nil, false +} + +// AsDefaultAdminRule is the BasicBaseAdminRule implementation for BaseAdminRule. +func (bar BaseAdminRule) AsDefaultAdminRule() (*DefaultAdminRule, bool) { + return nil, false +} + +// AsBaseAdminRule is the BasicBaseAdminRule implementation for BaseAdminRule. +func (bar BaseAdminRule) AsBaseAdminRule() (*BaseAdminRule, bool) { + return &bar, true +} + +// AsBasicBaseAdminRule is the BasicBaseAdminRule implementation for BaseAdminRule. +func (bar BaseAdminRule) AsBasicBaseAdminRule() (BasicBaseAdminRule, bool) { + return &bar, true +} + +// BaseAdminRuleModel ... +type BaseAdminRuleModel struct { + autorest.Response `json:"-"` + Value BasicBaseAdminRule `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for BaseAdminRuleModel struct. +func (barm *BaseAdminRuleModel) UnmarshalJSON(body []byte) error { + bar, err := unmarshalBasicBaseAdminRule(body) + if err != nil { + return err + } + barm.Value = bar + + return nil +} + // BastionActiveSession the session detail for a target. type BastionActiveSession struct { // SessionID - READ-ONLY; A unique id for the session. @@ -8294,7 +10136,7 @@ type BastionActiveSession struct { UserName *string `json:"userName,omitempty"` // TargetIPAddress - READ-ONLY; The IP Address of the target. TargetIPAddress *string `json:"targetIpAddress,omitempty"` - // Protocol - READ-ONLY; The protocol used to connect to the target. Possible values include: 'BastionConnectProtocolSSH', 'BastionConnectProtocolRDP' + // Protocol - READ-ONLY; The protocol used to connect to the target. Possible values include: 'SSH', 'RDP' Protocol BastionConnectProtocol `json:"protocol,omitempty"` // TargetResourceID - READ-ONLY; The resource id of the target. TargetResourceID *string `json:"targetResourceId,omitempty"` @@ -8694,7 +10536,7 @@ type BastionHostIPConfigurationPropertiesFormat struct { PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` // ProvisioningState - READ-ONLY; The provisioning state of the bastion host IP configuration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // PrivateIPAllocationMethod - Private IP allocation method. Possible values include: 'IPAllocationMethodStatic', 'IPAllocationMethodDynamic' + // PrivateIPAllocationMethod - Private IP allocation method. Possible values include: 'Static', 'Dynamic' PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` } @@ -9877,6 +11719,24 @@ type CheckPrivateLinkServiceVisibilityRequest struct { PrivateLinkServiceAlias *string `json:"privateLinkServiceAlias,omitempty"` } +// ChildResource proxy resource representation. +type ChildResource struct { + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ChildResource. +func (cr ChildResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // CloudError an error response from the service. type CloudError struct { // Error - Cloud error body. @@ -9907,7 +11767,7 @@ type ConfigurationDiagnosticParameters struct { // ConfigurationDiagnosticProfile parameters to compare with network configuration. type ConfigurationDiagnosticProfile struct { - // Direction - The direction of the traffic. Possible values include: 'DirectionInbound', 'DirectionOutbound' + // Direction - The direction of the traffic. Possible values include: 'Inbound', 'Outbound' Direction Direction `json:"direction,omitempty"` // Protocol - Protocol to be verified on. Accepted values are '*', TCP, UDP. Protocol *string `json:"protocol,omitempty"` @@ -9941,6 +11801,59 @@ type ConfigurationDiagnosticResult struct { NetworkSecurityGroupResult *SecurityGroupResult `json:"networkSecurityGroupResult,omitempty"` } +// ConfigurationGroup the network configuration group resource +type ConfigurationGroup struct { + // ID - Network group ID. + ID *string `json:"id,omitempty"` + // GroupProperties - The network configuration group properties + *GroupProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConfigurationGroup. +func (cg ConfigurationGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cg.ID != nil { + objectMap["id"] = cg.ID + } + if cg.GroupProperties != nil { + objectMap["properties"] = cg.GroupProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ConfigurationGroup struct. +func (cg *ConfigurationGroup) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cg.ID = &ID + } + case "properties": + if v != nil { + var groupProperties GroupProperties + err = json.Unmarshal(*v, &groupProperties) + if err != nil { + return err + } + cg.GroupProperties = &groupProperties + } + } + } + + return nil +} + // ConfigurationPolicyGroupsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results // of a long-running operation. type ConfigurationPolicyGroupsCreateOrUpdateFuture struct { @@ -10102,7 +12015,7 @@ type ConnectionMonitorDestination struct { type ConnectionMonitorEndpoint struct { // Name - The name of the connection monitor endpoint. Name *string `json:"name,omitempty"` - // Type - The endpoint type. Possible values include: 'EndpointTypeAzureVM', 'EndpointTypeAzureVNet', 'EndpointTypeAzureSubnet', 'EndpointTypeExternalAddress', 'EndpointTypeMMAWorkspaceMachine', 'EndpointTypeMMAWorkspaceNetwork' + // Type - The endpoint type. Possible values include: 'AzureVM', 'AzureVNet', 'AzureSubnet', 'ExternalAddress', 'MMAWorkspaceMachine', 'MMAWorkspaceNetwork', 'AzureArcVM', 'AzureVMSS' Type EndpointType `json:"type,omitempty"` // ResourceID - Resource ID of the connection monitor endpoint. ResourceID *string `json:"resourceId,omitempty"` @@ -10112,13 +12025,13 @@ type ConnectionMonitorEndpoint struct { Filter *ConnectionMonitorEndpointFilter `json:"filter,omitempty"` // Scope - Endpoint scope. Scope *ConnectionMonitorEndpointScope `json:"scope,omitempty"` - // CoverageLevel - Test coverage for the endpoint. Possible values include: 'CoverageLevelDefault', 'CoverageLevelLow', 'CoverageLevelBelowAverage', 'CoverageLevelAverage', 'CoverageLevelAboveAverage', 'CoverageLevelFull' + // CoverageLevel - Test coverage for the endpoint. Possible values include: 'Default', 'Low', 'BelowAverage', 'Average', 'AboveAverage', 'Full' CoverageLevel CoverageLevel `json:"coverageLevel,omitempty"` } // ConnectionMonitorEndpointFilter describes the connection monitor endpoint filter. type ConnectionMonitorEndpointFilter struct { - // Type - The behavior of the endpoint filter. Currently only 'Include' is supported. Possible values include: 'ConnectionMonitorEndpointFilterTypeInclude' + // Type - The behavior of the endpoint filter. Currently only 'Include' is supported. Possible values include: 'Include' Type ConnectionMonitorEndpointFilterType `json:"type,omitempty"` // Items - List of items in the filter. Items *[]ConnectionMonitorEndpointFilterItem `json:"items,omitempty"` @@ -10126,7 +12039,7 @@ type ConnectionMonitorEndpointFilter struct { // ConnectionMonitorEndpointFilterItem describes the connection monitor endpoint filter item. type ConnectionMonitorEndpointFilterItem struct { - // Type - The type of item included in the filter. Currently only 'AgentAddress' is supported. Possible values include: 'ConnectionMonitorEndpointFilterItemTypeAgentAddress' + // Type - The type of item included in the filter. Currently only 'AgentAddress' is supported. Possible values include: 'AgentAddress' Type ConnectionMonitorEndpointFilterItemType `json:"type,omitempty"` // Address - The address of the filter item. Address *string `json:"address,omitempty"` @@ -10150,7 +12063,7 @@ type ConnectionMonitorEndpointScopeItem struct { type ConnectionMonitorHTTPConfiguration struct { // Port - The port to connect to. Port *int32 `json:"port,omitempty"` - // Method - The HTTP method to use. Possible values include: 'HTTPConfigurationMethodGet', 'HTTPConfigurationMethodPost' + // Method - The HTTP method to use. Possible values include: 'Get', 'Post' Method HTTPConfigurationMethod `json:"method,omitempty"` // Path - The path component of the URI. For instance, "/dir1/dir2". Path *string `json:"path,omitempty"` @@ -10177,7 +12090,7 @@ type ConnectionMonitorListResult struct { // ConnectionMonitorOutput describes a connection monitor output destination. type ConnectionMonitorOutput struct { - // Type - Connection monitor output destination type. Currently, only "Workspace" is supported. Possible values include: 'OutputTypeWorkspace' + // Type - Connection monitor output destination type. Currently, only "Workspace" is supported. Possible values include: 'Workspace' Type OutputType `json:"type,omitempty"` // WorkspaceSettings - Describes the settings for producing output into a log analytics workspace. WorkspaceSettings *ConnectionMonitorWorkspaceSettings `json:"workspaceSettings,omitempty"` @@ -10334,7 +12247,7 @@ type ConnectionMonitorResultProperties struct { StartTime *date.Time `json:"startTime,omitempty"` // MonitoringStatus - READ-ONLY; The monitoring status of the connection monitor. MonitoringStatus *string `json:"monitoringStatus,omitempty"` - // ConnectionMonitorType - READ-ONLY; Type of connection monitor. Possible values include: 'ConnectionMonitorTypeMultiEndpoint', 'ConnectionMonitorTypeSingleSourceDestination' + // ConnectionMonitorType - READ-ONLY; Type of connection monitor. Possible values include: 'MultiEndpoint', 'SingleSourceDestination' ConnectionMonitorType ConnectionMonitorType `json:"connectionMonitorType,omitempty"` // Source - Describes the source of connection monitor. Source *ConnectionMonitorSource `json:"source,omitempty"` @@ -10726,6 +12639,341 @@ func (CSS ConnectionStateSnapshot) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// ConnectivityConfiguration the network manager connectivity configuration resource +type ConnectivityConfiguration struct { + autorest.Response `json:"-"` + // ConnectivityConfigurationProperties - Properties of a network manager connectivity configuration + *ConnectivityConfigurationProperties `json:"properties,omitempty"` + // SystemData - READ-ONLY; The system metadata related to this resource. + SystemData *SystemData `json:"systemData,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConnectivityConfiguration. +func (cc ConnectivityConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cc.ConnectivityConfigurationProperties != nil { + objectMap["properties"] = cc.ConnectivityConfigurationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ConnectivityConfiguration struct. +func (cc *ConnectivityConfiguration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var connectivityConfigurationProperties ConnectivityConfigurationProperties + err = json.Unmarshal(*v, &connectivityConfigurationProperties) + if err != nil { + return err + } + cc.ConnectivityConfigurationProperties = &connectivityConfigurationProperties + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + cc.SystemData = &systemData + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cc.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + cc.Etag = &etag + } + } + } + + return nil +} + +// ConnectivityConfigurationListResult result of the request to list network manager connectivity +// configurations. It contains a list of configurations and a link to get the next set of results. +type ConnectivityConfigurationListResult struct { + autorest.Response `json:"-"` + // Value - Gets a page of Connectivity Configurations + Value *[]ConnectivityConfiguration `json:"value,omitempty"` + // NextLink - Gets the URL to get the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ConnectivityConfigurationListResultIterator provides access to a complete listing of +// ConnectivityConfiguration values. +type ConnectivityConfigurationListResultIterator struct { + i int + page ConnectivityConfigurationListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ConnectivityConfigurationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectivityConfigurationListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ConnectivityConfigurationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ConnectivityConfigurationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ConnectivityConfigurationListResultIterator) Response() ConnectivityConfigurationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ConnectivityConfigurationListResultIterator) Value() ConnectivityConfiguration { + if !iter.page.NotDone() { + return ConnectivityConfiguration{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ConnectivityConfigurationListResultIterator type. +func NewConnectivityConfigurationListResultIterator(page ConnectivityConfigurationListResultPage) ConnectivityConfigurationListResultIterator { + return ConnectivityConfigurationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (cclr ConnectivityConfigurationListResult) IsEmpty() bool { + return cclr.Value == nil || len(*cclr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (cclr ConnectivityConfigurationListResult) hasNextLink() bool { + return cclr.NextLink != nil && len(*cclr.NextLink) != 0 +} + +// connectivityConfigurationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (cclr ConnectivityConfigurationListResult) connectivityConfigurationListResultPreparer(ctx context.Context) (*http.Request, error) { + if !cclr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(cclr.NextLink))) +} + +// ConnectivityConfigurationListResultPage contains a page of ConnectivityConfiguration values. +type ConnectivityConfigurationListResultPage struct { + fn func(context.Context, ConnectivityConfigurationListResult) (ConnectivityConfigurationListResult, error) + cclr ConnectivityConfigurationListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ConnectivityConfigurationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectivityConfigurationListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.cclr) + if err != nil { + return err + } + page.cclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ConnectivityConfigurationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ConnectivityConfigurationListResultPage) NotDone() bool { + return !page.cclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ConnectivityConfigurationListResultPage) Response() ConnectivityConfigurationListResult { + return page.cclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ConnectivityConfigurationListResultPage) Values() []ConnectivityConfiguration { + if page.cclr.IsEmpty() { + return nil + } + return *page.cclr.Value +} + +// Creates a new instance of the ConnectivityConfigurationListResultPage type. +func NewConnectivityConfigurationListResultPage(cur ConnectivityConfigurationListResult, getNextPage func(context.Context, ConnectivityConfigurationListResult) (ConnectivityConfigurationListResult, error)) ConnectivityConfigurationListResultPage { + return ConnectivityConfigurationListResultPage{ + fn: getNextPage, + cclr: cur, + } +} + +// ConnectivityConfigurationProperties properties of network manager connectivity configuration +type ConnectivityConfigurationProperties struct { + // Description - A description of the connectivity configuration. + Description *string `json:"description,omitempty"` + // ConnectivityTopology - Connectivity topology type. Possible values include: 'HubAndSpoke', 'Mesh' + ConnectivityTopology ConnectivityTopology `json:"connectivityTopology,omitempty"` + // Hubs - List of hubItems + Hubs *[]Hub `json:"hubs,omitempty"` + // IsGlobal - Flag if global mesh is supported. Possible values include: 'IsGlobalFalse', 'IsGlobalTrue' + IsGlobal IsGlobal `json:"isGlobal,omitempty"` + // AppliesToGroups - Groups for configuration + AppliesToGroups *[]ConnectivityGroupItem `json:"appliesToGroups,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the connectivity configuration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // DeleteExistingPeering - Flag if need to remove current existing peerings. Possible values include: 'False', 'True' + DeleteExistingPeering DeleteExistingPeering `json:"deleteExistingPeering,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConnectivityConfigurationProperties. +func (ccp ConnectivityConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ccp.Description != nil { + objectMap["description"] = ccp.Description + } + if ccp.ConnectivityTopology != "" { + objectMap["connectivityTopology"] = ccp.ConnectivityTopology + } + if ccp.Hubs != nil { + objectMap["hubs"] = ccp.Hubs + } + if ccp.IsGlobal != "" { + objectMap["isGlobal"] = ccp.IsGlobal + } + if ccp.AppliesToGroups != nil { + objectMap["appliesToGroups"] = ccp.AppliesToGroups + } + if ccp.DeleteExistingPeering != "" { + objectMap["deleteExistingPeering"] = ccp.DeleteExistingPeering + } + return json.Marshal(objectMap) +} + +// ConnectivityConfigurationsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ConnectivityConfigurationsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ConnectivityConfigurationsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ConnectivityConfigurationsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ConnectivityConfigurationsDeleteFuture.Result. +func (future *ConnectivityConfigurationsDeleteFuture) result(client ConnectivityConfigurationsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ConnectivityConfigurationsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.ConnectivityConfigurationsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + // ConnectivityDestination parameters that define destination of connection. type ConnectivityDestination struct { // ResourceID - The ID of the resource to which a connection attempt will be made. @@ -10736,6 +12984,18 @@ type ConnectivityDestination struct { Port *int32 `json:"port,omitempty"` } +// ConnectivityGroupItem connectivity group item. +type ConnectivityGroupItem struct { + // NetworkGroupID - Network group Id. + NetworkGroupID *string `json:"networkGroupId,omitempty"` + // UseHubGateway - Flag if need to use hub gateway. Possible values include: 'UseHubGatewayFalse', 'UseHubGatewayTrue' + UseHubGateway UseHubGateway `json:"useHubGateway,omitempty"` + // IsGlobal - Flag if global is supported. Possible values include: 'IsGlobalFalse', 'IsGlobalTrue' + IsGlobal IsGlobal `json:"isGlobal,omitempty"` + // GroupConnectivity - Group connectivity type. Possible values include: 'GroupConnectivityNone', 'GroupConnectivityDirectlyConnected' + GroupConnectivity GroupConnectivity `json:"groupConnectivity,omitempty"` +} + // ConnectivityHop information about a hop between the source and the destination. type ConnectivityHop struct { // Type - READ-ONLY; The type of the hop. @@ -10817,7 +13077,7 @@ type ConnectivityParameters struct { Protocol Protocol `json:"protocol,omitempty"` // ProtocolConfiguration - Configuration of the protocol. ProtocolConfiguration *ProtocolConfiguration `json:"protocolConfiguration,omitempty"` - // PreferredIPVersion - Preferred IP version of the connection. Possible values include: 'IPVersionIPv4', 'IPVersionIPv6' + // PreferredIPVersion - Preferred IP version of the connection. Possible values include: 'IPv4', 'IPv6' PreferredIPVersion IPVersion `json:"preferredIPVersion,omitempty"` } @@ -11145,6 +13405,34 @@ func (cnipf ContainerNetworkInterfacePropertiesFormat) MarshalJSON() ([]byte, er return json.Marshal(objectMap) } +// Criterion a matching criteria which matches routes based on route prefix, community, and AS path. +type Criterion struct { + // RoutePrefix - List of route prefixes which this criteria matches. + RoutePrefix *[]string `json:"routePrefix,omitempty"` + // Community - List of BGP communities which this criteria matches. + Community *[]string `json:"community,omitempty"` + // AsPath - List of AS paths which this criteria matches. + AsPath *[]string `json:"asPath,omitempty"` + // MatchCondition - Match condition to apply RouteMap rules. Possible values include: 'RouteMapMatchConditionUnknown', 'RouteMapMatchConditionContains', 'RouteMapMatchConditionEquals', 'RouteMapMatchConditionNotContains', 'RouteMapMatchConditionNotEquals' + MatchCondition RouteMapMatchCondition `json:"matchCondition,omitempty"` +} + +// CrossTenantScopes cross tenant scopes. +type CrossTenantScopes struct { + // TenantID - READ-ONLY; Tenant ID. + TenantID *string `json:"tenantId,omitempty"` + // ManagementGroups - READ-ONLY; List of management groups. + ManagementGroups *[]string `json:"managementGroups,omitempty"` + // Subscriptions - READ-ONLY; List of subscriptions. + Subscriptions *[]string `json:"subscriptions,omitempty"` +} + +// MarshalJSON is the custom marshaler for CrossTenantScopes. +func (cts CrossTenantScopes) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // CustomDNSConfigPropertiesFormat contains custom Dns resolution configuration from customer. type CustomDNSConfigPropertiesFormat struct { // Fqdn - Fqdn that resolves to private endpoint ip address. @@ -11537,6 +13825,8 @@ func NewCustomIPPrefixListResultPage(cur CustomIPPrefixListResult, getNextPage f // CustomIPPrefixPropertiesFormat custom IP prefix properties. type CustomIPPrefixPropertiesFormat struct { + // Asn - The ASN for CIDR advertising. Should be an integer as string. + Asn *string `json:"asn,omitempty"` // Cidr - The prefix range in CIDR notation. Should include the start address and the prefix length. Cidr *string `json:"cidr,omitempty"` // SignedMessage - Signed message for WAN validation. @@ -11547,8 +13837,16 @@ type CustomIPPrefixPropertiesFormat struct { CustomIPPrefixParent *SubResource `json:"customIpPrefixParent,omitempty"` // ChildCustomIPPrefixes - READ-ONLY; The list of all Children for IPv6 /48 CustomIpPrefix. ChildCustomIPPrefixes *[]SubResource `json:"childCustomIpPrefixes,omitempty"` - // CommissionedState - The commissioned state of the Custom IP Prefix. Possible values include: 'CommissionedStateProvisioning', 'CommissionedStateProvisioned', 'CommissionedStateCommissioning', 'CommissionedStateCommissioned', 'CommissionedStateDecommissioning', 'CommissionedStateDeprovisioning' + // CommissionedState - The commissioned state of the Custom IP Prefix. Possible values include: 'Provisioning', 'Provisioned', 'Commissioning', 'CommissionedNoInternetAdvertise', 'Commissioned', 'Decommissioning', 'Deprovisioning', 'Deprovisioned' CommissionedState CommissionedState `json:"commissionedState,omitempty"` + // ExpressRouteAdvertise - Whether to do express route advertise. + ExpressRouteAdvertise *bool `json:"expressRouteAdvertise,omitempty"` + // Geo - The Geo for CIDR advertising. Should be an Geo code. Possible values include: 'GLOBAL', 'AFRI', 'APAC', 'EURO', 'LATAM', 'NAM', 'ME', 'OCEANIA', 'AQ' + Geo Geo `json:"geo,omitempty"` + // NoInternetAdvertise - Whether to Advertise the range to Internet. + NoInternetAdvertise *bool `json:"noInternetAdvertise,omitempty"` + // PrefixType - Type of custom IP prefix. Should be Singular, Parent, or Child. Possible values include: 'Singular', 'Parent', 'Child' + PrefixType CustomIPPrefixType `json:"prefixType,omitempty"` // PublicIPPrefixes - READ-ONLY; The list of all referenced PublicIpPrefixes. PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` // ResourceGUID - READ-ONLY; The resource GUID property of the custom IP prefix resource. @@ -11562,6 +13860,9 @@ type CustomIPPrefixPropertiesFormat struct { // MarshalJSON is the custom marshaler for CustomIPPrefixPropertiesFormat. func (cippf CustomIPPrefixPropertiesFormat) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + if cippf.Asn != nil { + objectMap["asn"] = cippf.Asn + } if cippf.Cidr != nil { objectMap["cidr"] = cippf.Cidr } @@ -11577,6 +13878,18 @@ func (cippf CustomIPPrefixPropertiesFormat) MarshalJSON() ([]byte, error) { if cippf.CommissionedState != "" { objectMap["commissionedState"] = cippf.CommissionedState } + if cippf.ExpressRouteAdvertise != nil { + objectMap["expressRouteAdvertise"] = cippf.ExpressRouteAdvertise + } + if cippf.Geo != "" { + objectMap["geo"] = cippf.Geo + } + if cippf.NoInternetAdvertise != nil { + objectMap["noInternetAdvertise"] = cippf.NoInternetAdvertise + } + if cippf.PrefixType != "" { + objectMap["prefixType"] = cippf.PrefixType + } return json.Marshal(objectMap) } @@ -11781,18 +14094,11 @@ type DdosCustomPolicyPropertiesFormat struct { ResourceGUID *string `json:"resourceGuid,omitempty"` // ProvisioningState - READ-ONLY; The provisioning state of the DDoS custom policy resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // PublicIPAddresses - READ-ONLY; The list of public IPs associated with the DDoS custom policy resource. This list is read-only. - PublicIPAddresses *[]SubResource `json:"publicIPAddresses,omitempty"` - // ProtocolCustomSettings - The protocol-specific DDoS policy customization parameters. - ProtocolCustomSettings *[]ProtocolCustomSettingsFormat `json:"protocolCustomSettings,omitempty"` } // MarshalJSON is the custom marshaler for DdosCustomPolicyPropertiesFormat. func (dcppf DdosCustomPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if dcppf.ProtocolCustomSettings != nil { - objectMap["protocolCustomSettings"] = dcppf.ProtocolCustomSettings - } return json.Marshal(objectMap) } @@ -12082,6 +14388,8 @@ type DdosProtectionPlanPropertiesFormat struct { ResourceGUID *string `json:"resourceGuid,omitempty"` // ProvisioningState - READ-ONLY; The provisioning state of the DDoS protection plan resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // PublicIPAddresses - READ-ONLY; The list of public IPs associated with the DDoS protection plan resource. This list is read-only. + PublicIPAddresses *[]SubResource `json:"publicIPAddresses,omitempty"` // VirtualNetworks - READ-ONLY; The list of virtual networks associated with the DDoS protection plan resource. This list is read-only. VirtualNetworks *[]SubResource `json:"virtualNetworks,omitempty"` } @@ -12174,12 +14482,182 @@ func (future *DdosProtectionPlansDeleteFuture) result(client DdosProtectionPlans // DdosSettings contains the DDoS protection settings of the public IP. type DdosSettings struct { - // DdosCustomPolicy - The DDoS custom policy associated with the public IP. - DdosCustomPolicy *SubResource `json:"ddosCustomPolicy,omitempty"` - // ProtectionCoverage - The DDoS protection policy customizability of the public IP. Only standard coverage will have the ability to be customized. Possible values include: 'DdosSettingsProtectionCoverageBasic', 'DdosSettingsProtectionCoverageStandard' - ProtectionCoverage DdosSettingsProtectionCoverage `json:"protectionCoverage,omitempty"` - // ProtectedIP - Enables DDoS protection on the public IP. - ProtectedIP *bool `json:"protectedIP,omitempty"` + // ProtectionMode - The DDoS protection mode of the public IP. Possible values include: 'DdosSettingsProtectionModeVirtualNetworkInherited', 'DdosSettingsProtectionModeEnabled', 'DdosSettingsProtectionModeDisabled' + ProtectionMode DdosSettingsProtectionMode `json:"protectionMode,omitempty"` + // DdosProtectionPlan - The DDoS protection plan associated with the public IP. Can only be set if ProtectionMode is Enabled + DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` +} + +// DefaultAdminPropertiesFormat security default admin rule resource. +type DefaultAdminPropertiesFormat struct { + // Description - READ-ONLY; A description for this rule. Restricted to 140 chars. + Description *string `json:"description,omitempty"` + // Flag - Default rule flag. + Flag *string `json:"flag,omitempty"` + // Protocol - READ-ONLY; Network protocol this rule applies to. Possible values include: 'SecurityConfigurationRuleProtocolTCP', 'SecurityConfigurationRuleProtocolUDP', 'SecurityConfigurationRuleProtocolIcmp', 'SecurityConfigurationRuleProtocolEsp', 'SecurityConfigurationRuleProtocolAny', 'SecurityConfigurationRuleProtocolAh' + Protocol SecurityConfigurationRuleProtocol `json:"protocol,omitempty"` + // Sources - READ-ONLY; The CIDR or source IP ranges. + Sources *[]AddressPrefixItem `json:"sources,omitempty"` + // Destinations - READ-ONLY; The destination address prefixes. CIDR or destination IP ranges. + Destinations *[]AddressPrefixItem `json:"destinations,omitempty"` + // SourcePortRanges - READ-ONLY; The source port ranges. + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` + // DestinationPortRanges - READ-ONLY; The destination port ranges. + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + // Access - READ-ONLY; Indicates the access allowed for this particular rule. Possible values include: 'SecurityConfigurationRuleAccessAllow', 'SecurityConfigurationRuleAccessDeny', 'SecurityConfigurationRuleAccessAlwaysAllow' + Access SecurityConfigurationRuleAccess `json:"access,omitempty"` + // Priority - READ-ONLY; The priority of the rule. The value can be between 1 and 4096. The priority number must be unique for each rule in the collection. The lower the priority number, the higher the priority of the rule. + Priority *int32 `json:"priority,omitempty"` + // Direction - READ-ONLY; Indicates if the traffic matched against the rule in inbound or outbound. Possible values include: 'SecurityConfigurationRuleDirectionInbound', 'SecurityConfigurationRuleDirectionOutbound' + Direction SecurityConfigurationRuleDirection `json:"direction,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for DefaultAdminPropertiesFormat. +func (dapf DefaultAdminPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dapf.Flag != nil { + objectMap["flag"] = dapf.Flag + } + return json.Marshal(objectMap) +} + +// DefaultAdminRule network default admin rule. +type DefaultAdminRule struct { + // DefaultAdminPropertiesFormat - Indicates the properties of the security admin rule + *DefaultAdminPropertiesFormat `json:"properties,omitempty"` + // SystemData - READ-ONLY; The system metadata related to this resource. + SystemData *SystemData `json:"systemData,omitempty"` + // Kind - Possible values include: 'KindBasicBaseAdminRuleKindBaseAdminRule', 'KindBasicBaseAdminRuleKindCustom', 'KindBasicBaseAdminRuleKindDefault' + Kind KindBasicBaseAdminRule `json:"kind,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for DefaultAdminRule. +func (dar DefaultAdminRule) MarshalJSON() ([]byte, error) { + dar.Kind = KindBasicBaseAdminRuleKindDefault + objectMap := make(map[string]interface{}) + if dar.DefaultAdminPropertiesFormat != nil { + objectMap["properties"] = dar.DefaultAdminPropertiesFormat + } + if dar.Kind != "" { + objectMap["kind"] = dar.Kind + } + return json.Marshal(objectMap) +} + +// AsAdminRule is the BasicBaseAdminRule implementation for DefaultAdminRule. +func (dar DefaultAdminRule) AsAdminRule() (*AdminRule, bool) { + return nil, false +} + +// AsDefaultAdminRule is the BasicBaseAdminRule implementation for DefaultAdminRule. +func (dar DefaultAdminRule) AsDefaultAdminRule() (*DefaultAdminRule, bool) { + return &dar, true +} + +// AsBaseAdminRule is the BasicBaseAdminRule implementation for DefaultAdminRule. +func (dar DefaultAdminRule) AsBaseAdminRule() (*BaseAdminRule, bool) { + return nil, false +} + +// AsBasicBaseAdminRule is the BasicBaseAdminRule implementation for DefaultAdminRule. +func (dar DefaultAdminRule) AsBasicBaseAdminRule() (BasicBaseAdminRule, bool) { + return &dar, true +} + +// UnmarshalJSON is the custom unmarshaler for DefaultAdminRule struct. +func (dar *DefaultAdminRule) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var defaultAdminPropertiesFormat DefaultAdminPropertiesFormat + err = json.Unmarshal(*v, &defaultAdminPropertiesFormat) + if err != nil { + return err + } + dar.DefaultAdminPropertiesFormat = &defaultAdminPropertiesFormat + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + dar.SystemData = &systemData + } + case "kind": + if v != nil { + var kind KindBasicBaseAdminRule + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + dar.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dar.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + dar.Etag = &etag + } + } + } + + return nil +} + +// DefaultRuleSetPropertyFormat the default web application firewall rule set. +type DefaultRuleSetPropertyFormat struct { + // RuleSetType - The type of the web application firewall rule set. + RuleSetType *string `json:"ruleSetType,omitempty"` + // RuleSetVersion - The version of the web application firewall rule set type. + RuleSetVersion *string `json:"ruleSetVersion,omitempty"` } // Delegation details the service to which the subnet is delegated. @@ -12274,6 +14752,23 @@ func (d *Delegation) UnmarshalJSON(body []byte) error { return nil } +// DelegationProperties properties of the delegation. +type DelegationProperties struct { + // ServiceName - The service name to which the NVA is delegated. + ServiceName *string `json:"serviceName,omitempty"` + // ProvisioningState - READ-ONLY; Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for DelegationProperties. +func (dp DelegationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dp.ServiceName != nil { + objectMap["serviceName"] = dp.ServiceName + } + return json.Marshal(objectMap) +} + // DeleteBastionShareableLinkFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type DeleteBastionShareableLinkFuture struct { @@ -12771,6 +15266,326 @@ func (dcpf DscpConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// BasicEffectiveBaseSecurityAdminRule network base admin rule. +type BasicEffectiveBaseSecurityAdminRule interface { + AsEffectiveSecurityAdminRule() (*EffectiveSecurityAdminRule, bool) + AsEffectiveDefaultSecurityAdminRule() (*EffectiveDefaultSecurityAdminRule, bool) + AsEffectiveBaseSecurityAdminRule() (*EffectiveBaseSecurityAdminRule, bool) +} + +// EffectiveBaseSecurityAdminRule network base admin rule. +type EffectiveBaseSecurityAdminRule struct { + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // ConfigurationDescription - A description of the security admin configuration. + ConfigurationDescription *string `json:"configurationDescription,omitempty"` + // RuleCollectionDescription - A description of the rule collection. + RuleCollectionDescription *string `json:"ruleCollectionDescription,omitempty"` + // RuleCollectionAppliesToGroups - Groups for rule collection + RuleCollectionAppliesToGroups *[]ManagerSecurityGroupItem `json:"ruleCollectionAppliesToGroups,omitempty"` + // RuleGroups - Effective configuration groups. + RuleGroups *[]ConfigurationGroup `json:"ruleGroups,omitempty"` + // Kind - Possible values include: 'KindBasicEffectiveBaseSecurityAdminRuleKindEffectiveBaseSecurityAdminRule', 'KindBasicEffectiveBaseSecurityAdminRuleKindCustom', 'KindBasicEffectiveBaseSecurityAdminRuleKindDefault' + Kind KindBasicEffectiveBaseSecurityAdminRule `json:"kind,omitempty"` +} + +func unmarshalBasicEffectiveBaseSecurityAdminRule(body []byte) (BasicEffectiveBaseSecurityAdminRule, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindBasicEffectiveBaseSecurityAdminRuleKindCustom): + var esar EffectiveSecurityAdminRule + err := json.Unmarshal(body, &esar) + return esar, err + case string(KindBasicEffectiveBaseSecurityAdminRuleKindDefault): + var edsar EffectiveDefaultSecurityAdminRule + err := json.Unmarshal(body, &edsar) + return edsar, err + default: + var ebsar EffectiveBaseSecurityAdminRule + err := json.Unmarshal(body, &ebsar) + return ebsar, err + } +} +func unmarshalBasicEffectiveBaseSecurityAdminRuleArray(body []byte) ([]BasicEffectiveBaseSecurityAdminRule, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ebsarArray := make([]BasicEffectiveBaseSecurityAdminRule, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ebsar, err := unmarshalBasicEffectiveBaseSecurityAdminRule(*rawMessage) + if err != nil { + return nil, err + } + ebsarArray[index] = ebsar + } + return ebsarArray, nil +} + +// MarshalJSON is the custom marshaler for EffectiveBaseSecurityAdminRule. +func (ebsar EffectiveBaseSecurityAdminRule) MarshalJSON() ([]byte, error) { + ebsar.Kind = KindBasicEffectiveBaseSecurityAdminRuleKindEffectiveBaseSecurityAdminRule + objectMap := make(map[string]interface{}) + if ebsar.ID != nil { + objectMap["id"] = ebsar.ID + } + if ebsar.ConfigurationDescription != nil { + objectMap["configurationDescription"] = ebsar.ConfigurationDescription + } + if ebsar.RuleCollectionDescription != nil { + objectMap["ruleCollectionDescription"] = ebsar.RuleCollectionDescription + } + if ebsar.RuleCollectionAppliesToGroups != nil { + objectMap["ruleCollectionAppliesToGroups"] = ebsar.RuleCollectionAppliesToGroups + } + if ebsar.RuleGroups != nil { + objectMap["ruleGroups"] = ebsar.RuleGroups + } + if ebsar.Kind != "" { + objectMap["kind"] = ebsar.Kind + } + return json.Marshal(objectMap) +} + +// AsEffectiveSecurityAdminRule is the BasicEffectiveBaseSecurityAdminRule implementation for EffectiveBaseSecurityAdminRule. +func (ebsar EffectiveBaseSecurityAdminRule) AsEffectiveSecurityAdminRule() (*EffectiveSecurityAdminRule, bool) { + return nil, false +} + +// AsEffectiveDefaultSecurityAdminRule is the BasicEffectiveBaseSecurityAdminRule implementation for EffectiveBaseSecurityAdminRule. +func (ebsar EffectiveBaseSecurityAdminRule) AsEffectiveDefaultSecurityAdminRule() (*EffectiveDefaultSecurityAdminRule, bool) { + return nil, false +} + +// AsEffectiveBaseSecurityAdminRule is the BasicEffectiveBaseSecurityAdminRule implementation for EffectiveBaseSecurityAdminRule. +func (ebsar EffectiveBaseSecurityAdminRule) AsEffectiveBaseSecurityAdminRule() (*EffectiveBaseSecurityAdminRule, bool) { + return &ebsar, true +} + +// AsBasicEffectiveBaseSecurityAdminRule is the BasicEffectiveBaseSecurityAdminRule implementation for EffectiveBaseSecurityAdminRule. +func (ebsar EffectiveBaseSecurityAdminRule) AsBasicEffectiveBaseSecurityAdminRule() (BasicEffectiveBaseSecurityAdminRule, bool) { + return &ebsar, true +} + +// EffectiveConnectivityConfiguration the network manager effective connectivity configuration +type EffectiveConnectivityConfiguration struct { + // ID - Connectivity configuration ID. + ID *string `json:"id,omitempty"` + // ConnectivityConfigurationProperties - Properties of a network manager connectivity configuration + *ConnectivityConfigurationProperties `json:"properties,omitempty"` + // ConfigurationGroups - Effective configuration groups. + ConfigurationGroups *[]ConfigurationGroup `json:"configurationGroups,omitempty"` +} + +// MarshalJSON is the custom marshaler for EffectiveConnectivityConfiguration. +func (ecc EffectiveConnectivityConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ecc.ID != nil { + objectMap["id"] = ecc.ID + } + if ecc.ConnectivityConfigurationProperties != nil { + objectMap["properties"] = ecc.ConnectivityConfigurationProperties + } + if ecc.ConfigurationGroups != nil { + objectMap["configurationGroups"] = ecc.ConfigurationGroups + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for EffectiveConnectivityConfiguration struct. +func (ecc *EffectiveConnectivityConfiguration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ecc.ID = &ID + } + case "properties": + if v != nil { + var connectivityConfigurationProperties ConnectivityConfigurationProperties + err = json.Unmarshal(*v, &connectivityConfigurationProperties) + if err != nil { + return err + } + ecc.ConnectivityConfigurationProperties = &connectivityConfigurationProperties + } + case "configurationGroups": + if v != nil { + var configurationGroups []ConfigurationGroup + err = json.Unmarshal(*v, &configurationGroups) + if err != nil { + return err + } + ecc.ConfigurationGroups = &configurationGroups + } + } + } + + return nil +} + +// EffectiveDefaultSecurityAdminRule network default admin rule. +type EffectiveDefaultSecurityAdminRule struct { + // DefaultAdminPropertiesFormat - Indicates the properties of the default security admin rule + *DefaultAdminPropertiesFormat `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // ConfigurationDescription - A description of the security admin configuration. + ConfigurationDescription *string `json:"configurationDescription,omitempty"` + // RuleCollectionDescription - A description of the rule collection. + RuleCollectionDescription *string `json:"ruleCollectionDescription,omitempty"` + // RuleCollectionAppliesToGroups - Groups for rule collection + RuleCollectionAppliesToGroups *[]ManagerSecurityGroupItem `json:"ruleCollectionAppliesToGroups,omitempty"` + // RuleGroups - Effective configuration groups. + RuleGroups *[]ConfigurationGroup `json:"ruleGroups,omitempty"` + // Kind - Possible values include: 'KindBasicEffectiveBaseSecurityAdminRuleKindEffectiveBaseSecurityAdminRule', 'KindBasicEffectiveBaseSecurityAdminRuleKindCustom', 'KindBasicEffectiveBaseSecurityAdminRuleKindDefault' + Kind KindBasicEffectiveBaseSecurityAdminRule `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for EffectiveDefaultSecurityAdminRule. +func (edsar EffectiveDefaultSecurityAdminRule) MarshalJSON() ([]byte, error) { + edsar.Kind = KindBasicEffectiveBaseSecurityAdminRuleKindDefault + objectMap := make(map[string]interface{}) + if edsar.DefaultAdminPropertiesFormat != nil { + objectMap["properties"] = edsar.DefaultAdminPropertiesFormat + } + if edsar.ID != nil { + objectMap["id"] = edsar.ID + } + if edsar.ConfigurationDescription != nil { + objectMap["configurationDescription"] = edsar.ConfigurationDescription + } + if edsar.RuleCollectionDescription != nil { + objectMap["ruleCollectionDescription"] = edsar.RuleCollectionDescription + } + if edsar.RuleCollectionAppliesToGroups != nil { + objectMap["ruleCollectionAppliesToGroups"] = edsar.RuleCollectionAppliesToGroups + } + if edsar.RuleGroups != nil { + objectMap["ruleGroups"] = edsar.RuleGroups + } + if edsar.Kind != "" { + objectMap["kind"] = edsar.Kind + } + return json.Marshal(objectMap) +} + +// AsEffectiveSecurityAdminRule is the BasicEffectiveBaseSecurityAdminRule implementation for EffectiveDefaultSecurityAdminRule. +func (edsar EffectiveDefaultSecurityAdminRule) AsEffectiveSecurityAdminRule() (*EffectiveSecurityAdminRule, bool) { + return nil, false +} + +// AsEffectiveDefaultSecurityAdminRule is the BasicEffectiveBaseSecurityAdminRule implementation for EffectiveDefaultSecurityAdminRule. +func (edsar EffectiveDefaultSecurityAdminRule) AsEffectiveDefaultSecurityAdminRule() (*EffectiveDefaultSecurityAdminRule, bool) { + return &edsar, true +} + +// AsEffectiveBaseSecurityAdminRule is the BasicEffectiveBaseSecurityAdminRule implementation for EffectiveDefaultSecurityAdminRule. +func (edsar EffectiveDefaultSecurityAdminRule) AsEffectiveBaseSecurityAdminRule() (*EffectiveBaseSecurityAdminRule, bool) { + return nil, false +} + +// AsBasicEffectiveBaseSecurityAdminRule is the BasicEffectiveBaseSecurityAdminRule implementation for EffectiveDefaultSecurityAdminRule. +func (edsar EffectiveDefaultSecurityAdminRule) AsBasicEffectiveBaseSecurityAdminRule() (BasicEffectiveBaseSecurityAdminRule, bool) { + return &edsar, true +} + +// UnmarshalJSON is the custom unmarshaler for EffectiveDefaultSecurityAdminRule struct. +func (edsar *EffectiveDefaultSecurityAdminRule) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var defaultAdminPropertiesFormat DefaultAdminPropertiesFormat + err = json.Unmarshal(*v, &defaultAdminPropertiesFormat) + if err != nil { + return err + } + edsar.DefaultAdminPropertiesFormat = &defaultAdminPropertiesFormat + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + edsar.ID = &ID + } + case "configurationDescription": + if v != nil { + var configurationDescription string + err = json.Unmarshal(*v, &configurationDescription) + if err != nil { + return err + } + edsar.ConfigurationDescription = &configurationDescription + } + case "ruleCollectionDescription": + if v != nil { + var ruleCollectionDescription string + err = json.Unmarshal(*v, &ruleCollectionDescription) + if err != nil { + return err + } + edsar.RuleCollectionDescription = &ruleCollectionDescription + } + case "ruleCollectionAppliesToGroups": + if v != nil { + var ruleCollectionAppliesToGroups []ManagerSecurityGroupItem + err = json.Unmarshal(*v, &ruleCollectionAppliesToGroups) + if err != nil { + return err + } + edsar.RuleCollectionAppliesToGroups = &ruleCollectionAppliesToGroups + } + case "ruleGroups": + if v != nil { + var ruleGroups []ConfigurationGroup + err = json.Unmarshal(*v, &ruleGroups) + if err != nil { + return err + } + edsar.RuleGroups = &ruleGroups + } + case "kind": + if v != nil { + var kind KindBasicEffectiveBaseSecurityAdminRule + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + edsar.Kind = kind + } + } + } + + return nil +} + // EffectiveNetworkSecurityGroup effective network security group. type EffectiveNetworkSecurityGroup struct { // NetworkSecurityGroup - The ID of network security group that is applied. @@ -12872,7 +15687,7 @@ type EffectiveRoute struct { DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` // Source - Who created the route. Possible values include: 'EffectiveRouteSourceUnknown', 'EffectiveRouteSourceUser', 'EffectiveRouteSourceVirtualNetworkGateway', 'EffectiveRouteSourceDefault' Source EffectiveRouteSource `json:"source,omitempty"` - // State - The value of effective route. Possible values include: 'EffectiveRouteStateActive', 'EffectiveRouteStateInvalid' + // State - The value of effective route. Possible values include: 'Active', 'Invalid' State EffectiveRouteState `json:"state,omitempty"` // AddressPrefix - The address prefixes of the effective routes in CIDR notation. AddressPrefix *[]string `json:"addressPrefix,omitempty"` @@ -12900,6 +15715,16 @@ func (erlr EffectiveRouteListResult) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// EffectiveRouteMapRoute the effective RouteMap route configured on the connection resource. +type EffectiveRouteMapRoute struct { + // Prefix - The address prefix of the route. + Prefix *[]string `json:"prefix,omitempty"` + // BgpCommunities - BGP communities of the route. + BgpCommunities *string `json:"bgpCommunities,omitempty"` + // AsPath - The ASPath of this route. + AsPath *string `json:"asPath,omitempty"` +} + // EffectiveRoutesParameters the parameters specifying the resource whose effective routes are being // requested. type EffectiveRoutesParameters struct { @@ -12909,6 +15734,150 @@ type EffectiveRoutesParameters struct { VirtualWanResourceType *string `json:"virtualWanResourceType,omitempty"` } +// EffectiveSecurityAdminRule network admin rule. +type EffectiveSecurityAdminRule struct { + // AdminPropertiesFormat - Indicates the properties of the security admin rule + *AdminPropertiesFormat `json:"properties,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // ConfigurationDescription - A description of the security admin configuration. + ConfigurationDescription *string `json:"configurationDescription,omitempty"` + // RuleCollectionDescription - A description of the rule collection. + RuleCollectionDescription *string `json:"ruleCollectionDescription,omitempty"` + // RuleCollectionAppliesToGroups - Groups for rule collection + RuleCollectionAppliesToGroups *[]ManagerSecurityGroupItem `json:"ruleCollectionAppliesToGroups,omitempty"` + // RuleGroups - Effective configuration groups. + RuleGroups *[]ConfigurationGroup `json:"ruleGroups,omitempty"` + // Kind - Possible values include: 'KindBasicEffectiveBaseSecurityAdminRuleKindEffectiveBaseSecurityAdminRule', 'KindBasicEffectiveBaseSecurityAdminRuleKindCustom', 'KindBasicEffectiveBaseSecurityAdminRuleKindDefault' + Kind KindBasicEffectiveBaseSecurityAdminRule `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for EffectiveSecurityAdminRule. +func (esar EffectiveSecurityAdminRule) MarshalJSON() ([]byte, error) { + esar.Kind = KindBasicEffectiveBaseSecurityAdminRuleKindCustom + objectMap := make(map[string]interface{}) + if esar.AdminPropertiesFormat != nil { + objectMap["properties"] = esar.AdminPropertiesFormat + } + if esar.ID != nil { + objectMap["id"] = esar.ID + } + if esar.ConfigurationDescription != nil { + objectMap["configurationDescription"] = esar.ConfigurationDescription + } + if esar.RuleCollectionDescription != nil { + objectMap["ruleCollectionDescription"] = esar.RuleCollectionDescription + } + if esar.RuleCollectionAppliesToGroups != nil { + objectMap["ruleCollectionAppliesToGroups"] = esar.RuleCollectionAppliesToGroups + } + if esar.RuleGroups != nil { + objectMap["ruleGroups"] = esar.RuleGroups + } + if esar.Kind != "" { + objectMap["kind"] = esar.Kind + } + return json.Marshal(objectMap) +} + +// AsEffectiveSecurityAdminRule is the BasicEffectiveBaseSecurityAdminRule implementation for EffectiveSecurityAdminRule. +func (esar EffectiveSecurityAdminRule) AsEffectiveSecurityAdminRule() (*EffectiveSecurityAdminRule, bool) { + return &esar, true +} + +// AsEffectiveDefaultSecurityAdminRule is the BasicEffectiveBaseSecurityAdminRule implementation for EffectiveSecurityAdminRule. +func (esar EffectiveSecurityAdminRule) AsEffectiveDefaultSecurityAdminRule() (*EffectiveDefaultSecurityAdminRule, bool) { + return nil, false +} + +// AsEffectiveBaseSecurityAdminRule is the BasicEffectiveBaseSecurityAdminRule implementation for EffectiveSecurityAdminRule. +func (esar EffectiveSecurityAdminRule) AsEffectiveBaseSecurityAdminRule() (*EffectiveBaseSecurityAdminRule, bool) { + return nil, false +} + +// AsBasicEffectiveBaseSecurityAdminRule is the BasicEffectiveBaseSecurityAdminRule implementation for EffectiveSecurityAdminRule. +func (esar EffectiveSecurityAdminRule) AsBasicEffectiveBaseSecurityAdminRule() (BasicEffectiveBaseSecurityAdminRule, bool) { + return &esar, true +} + +// UnmarshalJSON is the custom unmarshaler for EffectiveSecurityAdminRule struct. +func (esar *EffectiveSecurityAdminRule) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var adminPropertiesFormat AdminPropertiesFormat + err = json.Unmarshal(*v, &adminPropertiesFormat) + if err != nil { + return err + } + esar.AdminPropertiesFormat = &adminPropertiesFormat + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + esar.ID = &ID + } + case "configurationDescription": + if v != nil { + var configurationDescription string + err = json.Unmarshal(*v, &configurationDescription) + if err != nil { + return err + } + esar.ConfigurationDescription = &configurationDescription + } + case "ruleCollectionDescription": + if v != nil { + var ruleCollectionDescription string + err = json.Unmarshal(*v, &ruleCollectionDescription) + if err != nil { + return err + } + esar.RuleCollectionDescription = &ruleCollectionDescription + } + case "ruleCollectionAppliesToGroups": + if v != nil { + var ruleCollectionAppliesToGroups []ManagerSecurityGroupItem + err = json.Unmarshal(*v, &ruleCollectionAppliesToGroups) + if err != nil { + return err + } + esar.RuleCollectionAppliesToGroups = &ruleCollectionAppliesToGroups + } + case "ruleGroups": + if v != nil { + var ruleGroups []ConfigurationGroup + err = json.Unmarshal(*v, &ruleGroups) + if err != nil { + return err + } + esar.RuleGroups = &ruleGroups + } + case "kind": + if v != nil { + var kind KindBasicEffectiveBaseSecurityAdminRule + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + esar.Kind = kind + } + } + } + + return nil +} + // EndpointServiceResult endpoint service. type EndpointServiceResult struct { // Name - READ-ONLY; Name of the endpoint service. @@ -13169,14 +16138,16 @@ type ExclusionManagedRuleSet struct { RuleGroups *[]ExclusionManagedRuleGroup `json:"ruleGroups,omitempty"` } -// ExplicitProxySettings explicit Proxy Settings in Firewall Policy. -type ExplicitProxySettings struct { +// ExplicitProxy explicit Proxy Settings in Firewall Policy. +type ExplicitProxy struct { // EnableExplicitProxy - When set to true, explicit proxy mode is enabled. EnableExplicitProxy *bool `json:"enableExplicitProxy,omitempty"` // HTTPPort - Port number for explicit proxy http protocol, cannot be greater than 64000. HTTPPort *int32 `json:"httpPort,omitempty"` // HTTPSPort - Port number for explicit proxy https protocol, cannot be greater than 64000. HTTPSPort *int32 `json:"httpsPort,omitempty"` + // EnablePacFile - When set to true, pac file port and url needs to be provided. + EnablePacFile *bool `json:"enablePacFile,omitempty"` // PacFilePort - Port number for firewall to serve PAC file. PacFilePort *int32 `json:"pacFilePort,omitempty"` // PacFile - SAS URL for PAC file. @@ -13758,7 +16729,7 @@ type ExpressRouteCircuitConnectionPropertiesFormat struct { AuthorizationKey *string `json:"authorizationKey,omitempty"` // Ipv6CircuitConnectionConfig - IPv6 Address PrefixProperties of the express route circuit connection. Ipv6CircuitConnectionConfig *Ipv6CircuitConnectionConfig `json:"ipv6CircuitConnectionConfig,omitempty"` - // CircuitConnectionStatus - Express Route Circuit connection state. Possible values include: 'CircuitConnectionStatusConnected', 'CircuitConnectionStatusConnecting', 'CircuitConnectionStatusDisconnected' + // CircuitConnectionStatus - Express Route Circuit connection state. Possible values include: 'Connected', 'Connecting', 'Disconnected' CircuitConnectionStatus CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` // ProvisioningState - READ-ONLY; The provisioning state of the express route circuit connection resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` @@ -14124,7 +17095,7 @@ type ExpressRouteCircuitPeeringConfig struct { AdvertisedPublicPrefixes *[]string `json:"advertisedPublicPrefixes,omitempty"` // AdvertisedCommunities - The communities of bgp peering. Specified for microsoft peering. AdvertisedCommunities *[]string `json:"advertisedCommunities,omitempty"` - // AdvertisedPublicPrefixesState - READ-ONLY; The advertised public prefix state of the Peering resource. Possible values include: 'ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured', 'ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring', 'ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured', 'ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded' + // AdvertisedPublicPrefixesState - READ-ONLY; The advertised public prefix state of the Peering resource. Possible values include: 'NotConfigured', 'Configuring', 'Configured', 'ValidationNeeded' AdvertisedPublicPrefixesState ExpressRouteCircuitPeeringAdvertisedPublicPrefixState `json:"advertisedPublicPrefixesState,omitempty"` // LegacyMode - The legacy mode of the peering. LegacyMode *int32 `json:"legacyMode,omitempty"` @@ -14324,7 +17295,7 @@ func NewExpressRouteCircuitPeeringListResultPage(cur ExpressRouteCircuitPeeringL // ExpressRouteCircuitPeeringPropertiesFormat properties of the express route circuit peering. type ExpressRouteCircuitPeeringPropertiesFormat struct { - // PeeringType - The peering type. Possible values include: 'ExpressRoutePeeringTypeAzurePublicPeering', 'ExpressRoutePeeringTypeAzurePrivatePeering', 'ExpressRoutePeeringTypeMicrosoftPeering' + // PeeringType - The peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' PeeringType ExpressRoutePeeringType `json:"peeringType,omitempty"` // State - The peering state. Possible values include: 'ExpressRoutePeeringStateDisabled', 'ExpressRoutePeeringStateEnabled' State ExpressRoutePeeringState `json:"state,omitempty"` @@ -14723,7 +17694,7 @@ type ExpressRouteCircuitSku struct { Name *string `json:"name,omitempty"` // Tier - The tier of the SKU. Possible values include: 'ExpressRouteCircuitSkuTierStandard', 'ExpressRouteCircuitSkuTierPremium', 'ExpressRouteCircuitSkuTierBasic', 'ExpressRouteCircuitSkuTierLocal' Tier ExpressRouteCircuitSkuTier `json:"tier,omitempty"` - // Family - The family of the SKU. Possible values include: 'ExpressRouteCircuitSkuFamilyUnlimitedData', 'ExpressRouteCircuitSkuFamilyMeteredData' + // Family - The family of the SKU. Possible values include: 'UnlimitedData', 'MeteredData' Family ExpressRouteCircuitSkuFamily `json:"family,omitempty"` } @@ -14990,6 +17961,8 @@ type ExpressRouteConnectionProperties struct { EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` // ExpressRouteGatewayBypass - Enable FastPath to vWan Firewall hub. ExpressRouteGatewayBypass *bool `json:"expressRouteGatewayBypass,omitempty"` + // EnablePrivateLinkFastPath - Bypass the ExpressRoute gateway when accessing private-links. ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. + EnablePrivateLinkFastPath *bool `json:"enablePrivateLinkFastPath,omitempty"` // RoutingConfiguration - The Routing Configuration indicating the associated and propagated route tables on this connection. RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` } @@ -15012,6 +17985,9 @@ func (ercp ExpressRouteConnectionProperties) MarshalJSON() ([]byte, error) { if ercp.ExpressRouteGatewayBypass != nil { objectMap["expressRouteGatewayBypass"] = ercp.ExpressRouteGatewayBypass } + if ercp.EnablePrivateLinkFastPath != nil { + objectMap["enablePrivateLinkFastPath"] = ercp.EnablePrivateLinkFastPath + } if ercp.RoutingConfiguration != nil { objectMap["routingConfiguration"] = ercp.RoutingConfiguration } @@ -15633,7 +18609,7 @@ func NewExpressRouteCrossConnectionPeeringListPage(cur ExpressRouteCrossConnecti // ExpressRouteCrossConnectionPeeringProperties properties of express route cross connection peering. type ExpressRouteCrossConnectionPeeringProperties struct { - // PeeringType - The peering type. Possible values include: 'ExpressRoutePeeringTypeAzurePublicPeering', 'ExpressRoutePeeringTypeAzurePrivatePeering', 'ExpressRoutePeeringTypeMicrosoftPeering' + // PeeringType - The peering type. Possible values include: 'AzurePublicPeering', 'AzurePrivatePeering', 'MicrosoftPeering' PeeringType ExpressRoutePeeringType `json:"peeringType,omitempty"` // State - The peering state. Possible values include: 'ExpressRoutePeeringStateDisabled', 'ExpressRoutePeeringStateEnabled' State ExpressRoutePeeringState `json:"state,omitempty"` @@ -16158,6 +19134,8 @@ type ExpressRouteGatewayProperties struct { ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // VirtualHub - The Virtual Hub where the ExpressRoute gateway is or will be deployed. VirtualHub *VirtualHubID `json:"virtualHub,omitempty"` + // AllowNonVirtualWanTraffic - Configures this gateway to accept traffic from non Virtual WAN networks. + AllowNonVirtualWanTraffic *bool `json:"allowNonVirtualWanTraffic,omitempty"` } // MarshalJSON is the custom marshaler for ExpressRouteGatewayProperties. @@ -16172,6 +19150,9 @@ func (ergp ExpressRouteGatewayProperties) MarshalJSON() ([]byte, error) { if ergp.VirtualHub != nil { objectMap["virtualHub"] = ergp.VirtualHub } + if ergp.AllowNonVirtualWanTraffic != nil { + objectMap["allowNonVirtualWanTraffic"] = ergp.AllowNonVirtualWanTraffic + } return json.Marshal(objectMap) } @@ -16557,7 +19538,7 @@ type ExpressRouteLinkMacSecConfig struct { CknSecretIdentifier *string `json:"cknSecretIdentifier,omitempty"` // CakSecretIdentifier - Keyvault Secret Identifier URL containing Mac security CAK key. CakSecretIdentifier *string `json:"cakSecretIdentifier,omitempty"` - // Cipher - Mac security cipher. Possible values include: 'ExpressRouteLinkMacSecCipherGcmAes256', 'ExpressRouteLinkMacSecCipherGcmAes128', 'ExpressRouteLinkMacSecCipherGcmAesXpn128', 'ExpressRouteLinkMacSecCipherGcmAesXpn256' + // Cipher - Mac security cipher. Possible values include: 'GcmAes256', 'GcmAes128', 'GcmAesXpn128', 'GcmAesXpn256' Cipher ExpressRouteLinkMacSecCipher `json:"cipher,omitempty"` // SciState - Sci mode enabled/disabled. Possible values include: 'ExpressRouteLinkMacSecSciStateDisabled', 'ExpressRouteLinkMacSecSciStateEnabled' SciState ExpressRouteLinkMacSecSciState `json:"sciState,omitempty"` @@ -16573,7 +19554,9 @@ type ExpressRouteLinkPropertiesFormat struct { PatchPanelID *string `json:"patchPanelId,omitempty"` // RackID - READ-ONLY; Mapping of physical patch panel to rack. RackID *string `json:"rackId,omitempty"` - // ConnectorType - READ-ONLY; Physical fiber port type. Possible values include: 'ExpressRouteLinkConnectorTypeLC', 'ExpressRouteLinkConnectorTypeSC' + // ColoLocation - READ-ONLY; Cololocation for ExpressRoute Hybrid Direct. + ColoLocation *string `json:"coloLocation,omitempty"` + // ConnectorType - READ-ONLY; Physical fiber port type. Possible values include: 'LC', 'SC' ConnectorType ExpressRouteLinkConnectorType `json:"connectorType,omitempty"` // AdminState - Administrative state of the physical port. Possible values include: 'ExpressRouteLinkAdminStateEnabled', 'ExpressRouteLinkAdminStateDisabled' AdminState ExpressRouteLinkAdminState `json:"adminState,omitempty"` @@ -17242,7 +20225,7 @@ type ExpressRoutePortPropertiesFormat struct { ProvisionedBandwidthInGbps *float64 `json:"provisionedBandwidthInGbps,omitempty"` // Mtu - READ-ONLY; Maximum transmission unit of the physical port pair(s). Mtu *string `json:"mtu,omitempty"` - // Encapsulation - Encapsulation method on physical ports. Possible values include: 'ExpressRoutePortsEncapsulationDot1Q', 'ExpressRoutePortsEncapsulationQinQ' + // Encapsulation - Encapsulation method on physical ports. Possible values include: 'Dot1Q', 'QinQ' Encapsulation ExpressRoutePortsEncapsulation `json:"encapsulation,omitempty"` // EtherType - READ-ONLY; Ether type of the physical port. EtherType *string `json:"etherType,omitempty"` @@ -17256,6 +20239,8 @@ type ExpressRoutePortPropertiesFormat struct { ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // ResourceGUID - READ-ONLY; The resource GUID property of the express route port resource. ResourceGUID *string `json:"resourceGuid,omitempty"` + // BillingType - The billing type of the ExpressRoutePort resource. Possible values include: 'ExpressRoutePortsBillingTypeMeteredData', 'ExpressRoutePortsBillingTypeUnlimitedData' + BillingType ExpressRoutePortsBillingType `json:"billingType,omitempty"` } // MarshalJSON is the custom marshaler for ExpressRoutePortPropertiesFormat. @@ -17273,6 +20258,9 @@ func (erppf ExpressRoutePortPropertiesFormat) MarshalJSON() ([]byte, error) { if erppf.Links != nil { objectMap["links"] = erppf.Links } + if erppf.BillingType != "" { + objectMap["billingType"] = erppf.BillingType + } return json.Marshal(objectMap) } @@ -17656,6 +20644,180 @@ func (erplpf ExpressRoutePortsLocationPropertiesFormat) MarshalJSON() ([]byte, e return json.Marshal(objectMap) } +// ExpressRouteProviderPort expressRouteProviderPort resource. +type ExpressRouteProviderPort struct { + autorest.Response `json:"-"` + // ExpressRouteProviderPortProperties - Properties of the express route Service Provider Port. + *ExpressRouteProviderPortProperties `json:"properties,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ExpressRouteProviderPort. +func (erpp ExpressRouteProviderPort) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if erpp.ExpressRouteProviderPortProperties != nil { + objectMap["properties"] = erpp.ExpressRouteProviderPortProperties + } + if erpp.ID != nil { + objectMap["id"] = erpp.ID + } + if erpp.Location != nil { + objectMap["location"] = erpp.Location + } + if erpp.Tags != nil { + objectMap["tags"] = erpp.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ExpressRouteProviderPort struct. +func (erpp *ExpressRouteProviderPort) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var expressRouteProviderPortProperties ExpressRouteProviderPortProperties + err = json.Unmarshal(*v, &expressRouteProviderPortProperties) + if err != nil { + return err + } + erpp.ExpressRouteProviderPortProperties = &expressRouteProviderPortProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + erpp.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + erpp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + erpp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + erpp.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + erpp.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + erpp.Tags = tags + } + } + } + + return nil +} + +// ExpressRouteProviderPortListResult response for ListExpressRouteProviderPort API service call. +type ExpressRouteProviderPortListResult struct { + autorest.Response `json:"-"` + // Value - A list of ExpressRouteProviderPort resources. + Value *[]ExpressRouteProviderPort `json:"value,omitempty"` + // NextLink - READ-ONLY; The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExpressRouteProviderPortListResult. +func (erpplr ExpressRouteProviderPortListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if erpplr.Value != nil { + objectMap["value"] = erpplr.Value + } + return json.Marshal(objectMap) +} + +// ExpressRouteProviderPortProperties properties of ExpressRouteProviderPort. +type ExpressRouteProviderPortProperties struct { + // PortPairDescriptor - READ-ONLY; The name of the port pair. + PortPairDescriptor *string `json:"portPairDescriptor,omitempty"` + // PrimaryAzurePort - READ-ONLY; The name of the primary port. + PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"` + // SecondaryAzurePort - READ-ONLY; The name of the secondary port. + SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"` + // PeeringLocation - The peering location of the port pair. + PeeringLocation *string `json:"peeringLocation,omitempty"` + // OverprovisionFactor - Overprovisioning factor for the port pair. + OverprovisionFactor *int32 `json:"overprovisionFactor,omitempty"` + // PortBandwidthInMbps - Bandwidth of the port in Mbps + PortBandwidthInMbps *int32 `json:"portBandwidthInMbps,omitempty"` + // UsedBandwidthInMbps - Used Bandwidth of the port in Mbps + UsedBandwidthInMbps *int32 `json:"usedBandwidthInMbps,omitempty"` + // RemainingBandwidthInMbps - Remaining Bandwidth of the port in Mbps + RemainingBandwidthInMbps *int32 `json:"remainingBandwidthInMbps,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExpressRouteProviderPortProperties. +func (erppp ExpressRouteProviderPortProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if erppp.PeeringLocation != nil { + objectMap["peeringLocation"] = erppp.PeeringLocation + } + if erppp.OverprovisionFactor != nil { + objectMap["overprovisionFactor"] = erppp.OverprovisionFactor + } + if erppp.PortBandwidthInMbps != nil { + objectMap["portBandwidthInMbps"] = erppp.PortBandwidthInMbps + } + if erppp.UsedBandwidthInMbps != nil { + objectMap["usedBandwidthInMbps"] = erppp.UsedBandwidthInMbps + } + if erppp.RemainingBandwidthInMbps != nil { + objectMap["remainingBandwidthInMbps"] = erppp.RemainingBandwidthInMbps + } + return json.Marshal(objectMap) +} + // ExpressRouteServiceProvider a ExpressRouteResourceProvider object. type ExpressRouteServiceProvider struct { // ExpressRouteServiceProviderPropertiesFormat - Properties of the express route service provider. @@ -17954,7 +21116,7 @@ func (ersppf ExpressRouteServiceProviderPropertiesFormat) MarshalJSON() ([]byte, type ExtendedLocation struct { // Name - The name of the extended location. Name *string `json:"name,omitempty"` - // Type - The type of the extended location. Possible values include: 'ExtendedLocationTypesEdgeZone' + // Type - The type of the extended location. Possible values include: 'EdgeZone' Type ExtendedLocationTypes `json:"type,omitempty"` } @@ -18654,7 +21816,7 @@ func (fpnrc *FirewallPolicyNatRuleCollection) UnmarshalJSON(body []byte) error { // FirewallPolicyNatRuleCollectionAction properties of the FirewallPolicyNatRuleCollectionAction. type FirewallPolicyNatRuleCollectionAction struct { - // Type - The type of action. Possible values include: 'FirewallPolicyNatRuleCollectionActionTypeDNAT' + // Type - The type of action. Possible values include: 'DNAT' Type FirewallPolicyNatRuleCollectionActionType `json:"type,omitempty"` } @@ -18682,8 +21844,8 @@ type FirewallPolicyPropertiesFormat struct { SQL *FirewallPolicySQL `json:"sql,omitempty"` // DNSSettings - DNS Proxy Settings definition. DNSSettings *DNSSettings `json:"dnsSettings,omitempty"` - // ExplicitProxySettings - Explicit Proxy Settings definition. - ExplicitProxySettings *ExplicitProxySettings `json:"explicitProxySettings,omitempty"` + // ExplicitProxy - Explicit Proxy Settings definition. + ExplicitProxy *ExplicitProxy `json:"explicitProxy,omitempty"` // IntrusionDetection - The configuration for Intrusion detection. IntrusionDetection *FirewallPolicyIntrusionDetection `json:"intrusionDetection,omitempty"` // TransportSecurity - TLS Configuration definition. @@ -18716,8 +21878,8 @@ func (fppf FirewallPolicyPropertiesFormat) MarshalJSON() ([]byte, error) { if fppf.DNSSettings != nil { objectMap["dnsSettings"] = fppf.DNSSettings } - if fppf.ExplicitProxySettings != nil { - objectMap["explicitProxySettings"] = fppf.ExplicitProxySettings + if fppf.ExplicitProxy != nil { + objectMap["explicitProxy"] = fppf.ExplicitProxy } if fppf.IntrusionDetection != nil { objectMap["intrusionDetection"] = fppf.IntrusionDetection @@ -19342,6 +22504,8 @@ type FirewallPolicySku struct { type FirewallPolicySNAT struct { // PrivateRanges - List of private IP addresses/IP address ranges to not be SNAT. PrivateRanges *[]string `json:"privateRanges,omitempty"` + // AutoLearnPrivateRanges - The operation mode for automatically learning private ranges to not be SNAT. Possible values include: 'AutoLearnPrivateRangesModeEnabled', 'AutoLearnPrivateRangesModeDisabled' + AutoLearnPrivateRanges AutoLearnPrivateRangesMode `json:"autoLearnPrivateRanges,omitempty"` } // FirewallPolicySQL SQL Settings in Firewall Policy. @@ -19481,7 +22645,7 @@ func (fl *FlowLog) UnmarshalJSON(body []byte) error { // FlowLogFormatParameters parameters that define the flow log format. type FlowLogFormatParameters struct { - // Type - The file type of flow log. Possible values include: 'FlowLogFormatTypeJSON' + // Type - The file type of flow log. Possible values include: 'JSON' Type FlowLogFormatType `json:"type,omitempty"` // Version - The version (revision) of the flow log. Version *int32 `json:"version,omitempty"` @@ -19982,9 +23146,9 @@ type FrontendIPConfigurationPropertiesFormat struct { LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` // PrivateIPAddress - The private IP address of the IP configuration. PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - // PrivateIPAllocationMethod - The Private IP allocation method. Possible values include: 'IPAllocationMethodStatic', 'IPAllocationMethodDynamic' + // PrivateIPAllocationMethod - The Private IP allocation method. Possible values include: 'Static', 'Dynamic' PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - // PrivateIPAddressVersion - Whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values include: 'IPVersionIPv4', 'IPVersionIPv6' + // PrivateIPAddressVersion - Whether the specific ipconfiguration is IPv4 or IPv6. Default is taken as IPv4. Possible values include: 'IPv4', 'IPv6' PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` // Subnet - The reference to the subnet resource. Subnet *Subnet `json:"subnet,omitempty"` @@ -20220,6 +23384,24 @@ func (future *GetActiveSessionsFuture) result(client BaseClient) (baslrp Bastion return } +// GetInboundRoutesParameters the parameters specifying the connection resource whose inbound routes are +// being requested. +type GetInboundRoutesParameters struct { + // ResourceURI - The connection resource whose inbound routes are being requested. + ResourceURI *string `json:"resourceUri,omitempty"` + // ConnectionType - The type of the specified connection resource like ExpressRouteConnection, HubVirtualNetworkConnection, VpnConnection and P2SConnection. + ConnectionType *string `json:"connectionType,omitempty"` +} + +// GetOutboundRoutesParameters the parameters specifying the connection resource whose outbound routes are +// being requested. +type GetOutboundRoutesParameters struct { + // ResourceURI - The connection resource whose outbound routes are being requested. + ResourceURI *string `json:"resourceUri,omitempty"` + // ConnectionType - The type of the specified connection resource like ExpressRouteConnection, HubVirtualNetworkConnection, VpnConnection and P2SConnection. + ConnectionType *string `json:"connectionType,omitempty"` +} + // GetVpnSitesConfigurationRequest list of Vpn-Sites. type GetVpnSitesConfigurationRequest struct { // VpnSites - List of resource-ids of the vpn-sites for which config is to be downloaded. @@ -20228,6 +23410,314 @@ type GetVpnSitesConfigurationRequest struct { OutputBlobSasURL *string `json:"outputBlobSasUrl,omitempty"` } +// Group the network group resource +type Group struct { + autorest.Response `json:"-"` + // GroupProperties - The Network Group properties + *GroupProperties `json:"properties,omitempty"` + // SystemData - READ-ONLY; The system metadata related to this resource. + SystemData *SystemData `json:"systemData,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for Group. +func (g Group) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if g.GroupProperties != nil { + objectMap["properties"] = g.GroupProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Group struct. +func (g *Group) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var groupProperties GroupProperties + err = json.Unmarshal(*v, &groupProperties) + if err != nil { + return err + } + g.GroupProperties = &groupProperties + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + g.SystemData = &systemData + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + g.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + g.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + g.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + g.Etag = &etag + } + } + } + + return nil +} + +// GroupListResult result of the request to list NetworkGroup. It contains a list of groups and a URL link +// to get the next set of results. +type GroupListResult struct { + autorest.Response `json:"-"` + // Value - Gets a page of NetworkGroup + Value *[]Group `json:"value,omitempty"` + // NextLink - Gets the URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// GroupListResultIterator provides access to a complete listing of Group values. +type GroupListResultIterator struct { + i int + page GroupListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *GroupListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *GroupListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter GroupListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter GroupListResultIterator) Response() GroupListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter GroupListResultIterator) Value() Group { + if !iter.page.NotDone() { + return Group{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the GroupListResultIterator type. +func NewGroupListResultIterator(page GroupListResultPage) GroupListResultIterator { + return GroupListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (glr GroupListResult) IsEmpty() bool { + return glr.Value == nil || len(*glr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (glr GroupListResult) hasNextLink() bool { + return glr.NextLink != nil && len(*glr.NextLink) != 0 +} + +// groupListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (glr GroupListResult) groupListResultPreparer(ctx context.Context) (*http.Request, error) { + if !glr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(glr.NextLink))) +} + +// GroupListResultPage contains a page of Group values. +type GroupListResultPage struct { + fn func(context.Context, GroupListResult) (GroupListResult, error) + glr GroupListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *GroupListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GroupListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.glr) + if err != nil { + return err + } + page.glr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *GroupListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page GroupListResultPage) NotDone() bool { + return !page.glr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page GroupListResultPage) Response() GroupListResult { + return page.glr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page GroupListResultPage) Values() []Group { + if page.glr.IsEmpty() { + return nil + } + return *page.glr.Value +} + +// Creates a new instance of the GroupListResultPage type. +func NewGroupListResultPage(cur GroupListResult, getNextPage func(context.Context, GroupListResult) (GroupListResult, error)) GroupListResultPage { + return GroupListResultPage{ + fn: getNextPage, + glr: cur, + } +} + +// GroupProperties properties of network group +type GroupProperties struct { + // Description - A description of the network group. + Description *string `json:"description,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the scope assignment resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for GroupProperties. +func (gp GroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gp.Description != nil { + objectMap["description"] = gp.Description + } + return json.Marshal(objectMap) +} + +// GroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type GroupsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(GroupsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *GroupsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for GroupsDeleteFuture.Result. +func (future *GroupsDeleteFuture) result(client GroupsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.GroupsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.GroupsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + // HopLink hop link. type HopLink struct { // NextHopID - READ-ONLY; The ID of the next hop. @@ -20356,6 +23846,14 @@ type HTTPHeader struct { Value *string `json:"value,omitempty"` } +// Hub hub Item. +type Hub struct { + // ResourceID - Resource Id. + ResourceID *string `json:"resourceId,omitempty"` + // ResourceType - Resource Type. + ResourceType *string `json:"resourceType,omitempty"` +} + // HubIPAddresses IP addresses associated with azure firewall. type HubIPAddresses struct { // PublicIPs - Public IP addresses associated with azure firewall. @@ -20458,7 +23956,7 @@ func (hic *HubIPConfiguration) UnmarshalJSON(body []byte) error { type HubIPConfigurationPropertiesFormat struct { // PrivateIPAddress - The private IP address of the IP configuration. PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'IPAllocationMethodStatic', 'IPAllocationMethodDynamic' + // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'Static', 'Dynamic' PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` // Subnet - The reference to the subnet resource. Subnet *Subnet `json:"subnet,omitempty"` @@ -22139,9 +25637,9 @@ type InterfaceIPConfigurationPropertiesFormat struct { LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` // PrivateIPAddress - Private IP address of the IP configuration. PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'IPAllocationMethodStatic', 'IPAllocationMethodDynamic' + // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'Static', 'Dynamic' PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - // PrivateIPAddressVersion - Whether the specific IP configuration is IPv4 or IPv6. Default is IPv4. Possible values include: 'IPVersionIPv4', 'IPVersionIPv6' + // PrivateIPAddressVersion - Whether the specific IP configuration is IPv4 or IPv6. Default is IPv4. Possible values include: 'IPv4', 'IPv6' PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` // Subnet - Subnet bound to the IP configuration. Subnet *Subnet `json:"subnet,omitempty"` @@ -22555,8 +26053,10 @@ type InterfacePropertiesFormat struct { Primary *bool `json:"primary,omitempty"` // VnetEncryptionSupported - READ-ONLY; Whether the virtual machine this nic is attached to supports encryption. VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - // EnableAcceleratedNetworking - If the network interface is accelerated networking enabled. + // EnableAcceleratedNetworking - If the network interface is configured for accelerated networking. Not applicable to VM sizes which require accelerated networking. EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` + // DisableTCPStateTracking - Indicates whether to disable tcp state tracking. + DisableTCPStateTracking *bool `json:"disableTcpStateTracking,omitempty"` // EnableIPForwarding - Indicates whether IP forwarding is enabled on this network interface. EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` // HostedWorkloads - READ-ONLY; A list of references to linked BareMetal resources. @@ -22569,7 +26069,7 @@ type InterfacePropertiesFormat struct { ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // WorkloadType - WorkloadType of the NetworkInterface for BareMetal resources WorkloadType *string `json:"workloadType,omitempty"` - // NicType - Type of Network Interface resource. Possible values include: 'InterfaceNicTypeStandard', 'InterfaceNicTypeElastic' + // NicType - Type of Network Interface resource. Possible values include: 'Standard', 'Elastic' NicType InterfaceNicType `json:"nicType,omitempty"` // PrivateLinkService - Privatelinkservice of the network interface resource. PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` @@ -22594,6 +26094,9 @@ func (ipf InterfacePropertiesFormat) MarshalJSON() ([]byte, error) { if ipf.EnableAcceleratedNetworking != nil { objectMap["enableAcceleratedNetworking"] = ipf.EnableAcceleratedNetworking } + if ipf.DisableTCPStateTracking != nil { + objectMap["disableTcpStateTracking"] = ipf.DisableTCPStateTracking + } if ipf.EnableIPForwarding != nil { objectMap["enableIPForwarding"] = ipf.EnableIPForwarding } @@ -23428,13 +26931,13 @@ type IPAllocationPropertiesFormat struct { Subnet *SubResource `json:"subnet,omitempty"` // VirtualNetwork - READ-ONLY; The VirtualNetwork that using the prefix of this IpAllocation resource. VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` - // Type - The type for the IpAllocation. Possible values include: 'IPAllocationTypeUndefined', 'IPAllocationTypeHypernet' + // Type - The type for the IpAllocation. Possible values include: 'Undefined', 'Hypernet' Type IPAllocationType `json:"type,omitempty"` // Prefix - The address prefix for the IpAllocation. Prefix *string `json:"prefix,omitempty"` // PrefixLength - The address prefix length for the IpAllocation. PrefixLength *int32 `json:"prefixLength,omitempty"` - // PrefixType - The address prefix Type for the IpAllocation. Possible values include: 'IPVersionIPv4', 'IPVersionIPv6' + // PrefixType - The address prefix Type for the IpAllocation. Possible values include: 'IPv4', 'IPv6' PrefixType IPVersion `json:"prefixType,omitempty"` // IpamAllocationID - The IPAM allocation ID. IpamAllocationID *string `json:"ipamAllocationId,omitempty"` @@ -23758,7 +27261,7 @@ func (icppf IPConfigurationProfilePropertiesFormat) MarshalJSON() ([]byte, error type IPConfigurationPropertiesFormat struct { // PrivateIPAddress - The private IP address of the IP configuration. PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'IPAllocationMethodStatic', 'IPAllocationMethodDynamic' + // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'Static', 'Dynamic' PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` // Subnet - The reference to the subnet resource. Subnet *Subnet `json:"subnet,omitempty"` @@ -24161,6 +27664,13 @@ func (future *IPGroupsDeleteFuture) result(client IPGroupsClient) (ar autorest.R return } +// IPPrefixesList list of SNAT IP Prefixes learnt by firewall to not SNAT +type IPPrefixesList struct { + autorest.Response `json:"-"` + // IPPrefixes - IP Prefix value. + IPPrefixes *[]string `json:"ipPrefixes,omitempty"` +} + // IpsecPolicy an IPSec Policy configuration for a virtual network gateway connection. type IpsecPolicy struct { // SaLifeTimeSeconds - The IPSec Security Association (also called Quick Mode or Phase 2 SA) lifetime in seconds for a site to site VPN tunnel. @@ -24171,7 +27681,7 @@ type IpsecPolicy struct { IpsecEncryption IpsecEncryption `json:"ipsecEncryption,omitempty"` // IpsecIntegrity - The IPSec integrity algorithm (IKE phase 1). Possible values include: 'IpsecIntegrityMD5', 'IpsecIntegritySHA1', 'IpsecIntegritySHA256', 'IpsecIntegrityGCMAES128', 'IpsecIntegrityGCMAES192', 'IpsecIntegrityGCMAES256' IpsecIntegrity IpsecIntegrity `json:"ipsecIntegrity,omitempty"` - // IkeEncryption - The IKE encryption algorithm (IKE phase 2). Possible values include: 'IkeEncryptionDES', 'IkeEncryptionDES3', 'IkeEncryptionAES128', 'IkeEncryptionAES192', 'IkeEncryptionAES256', 'IkeEncryptionGCMAES256', 'IkeEncryptionGCMAES128' + // IkeEncryption - The IKE encryption algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' IkeEncryption IkeEncryption `json:"ikeEncryption,omitempty"` // IkeIntegrity - The IKE integrity algorithm (IKE phase 2). Possible values include: 'IkeIntegrityMD5', 'IkeIntegritySHA1', 'IkeIntegritySHA256', 'IkeIntegritySHA384', 'IkeIntegrityGCMAES256', 'IkeIntegrityGCMAES128' IkeIntegrity IkeIntegrity `json:"ikeIntegrity,omitempty"` @@ -24193,7 +27703,7 @@ type IPTag struct { type Ipv6CircuitConnectionConfig struct { // AddressPrefix - /125 IP address space to carve out customer addresses for global reach. AddressPrefix *string `json:"addressPrefix,omitempty"` - // CircuitConnectionStatus - READ-ONLY; Express Route Circuit connection state. Possible values include: 'CircuitConnectionStatusConnected', 'CircuitConnectionStatusConnecting', 'CircuitConnectionStatusDisconnected' + // CircuitConnectionStatus - READ-ONLY; Express Route Circuit connection state. Possible values include: 'Connected', 'Connecting', 'Disconnected' CircuitConnectionStatus CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` } @@ -24700,27 +28210,26 @@ func NewListP2SVpnGatewaysResultPage(cur ListP2SVpnGatewaysResult, getNextPage f } } -// ListRoutingIntentResult list of the routing intent result and a URL nextLink to get the next set of -// results. -type ListRoutingIntentResult struct { +// ListRouteMapsResult list of RouteMaps and a URL nextLink to get the next set of results. +type ListRouteMapsResult struct { autorest.Response `json:"-"` - // Value - List of RoutingIntent resource. - Value *[]RoutingIntent `json:"value,omitempty"` + // Value - List of RouteMaps. + Value *[]RouteMap `json:"value,omitempty"` // NextLink - URL to get the next set of operation list results if there are any. NextLink *string `json:"nextLink,omitempty"` } -// ListRoutingIntentResultIterator provides access to a complete listing of RoutingIntent values. -type ListRoutingIntentResultIterator struct { +// ListRouteMapsResultIterator provides access to a complete listing of RouteMap values. +type ListRouteMapsResultIterator struct { i int - page ListRoutingIntentResultPage + page ListRouteMapsResultPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *ListRoutingIntentResultIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *ListRouteMapsResultIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListRoutingIntentResultIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ListRouteMapsResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -24745,67 +28254,67 @@ func (iter *ListRoutingIntentResultIterator) NextWithContext(ctx context.Context // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *ListRoutingIntentResultIterator) Next() error { +func (iter *ListRouteMapsResultIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListRoutingIntentResultIterator) NotDone() bool { +func (iter ListRouteMapsResultIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter ListRoutingIntentResultIterator) Response() ListRoutingIntentResult { +func (iter ListRouteMapsResultIterator) Response() ListRouteMapsResult { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter ListRoutingIntentResultIterator) Value() RoutingIntent { +func (iter ListRouteMapsResultIterator) Value() RouteMap { if !iter.page.NotDone() { - return RoutingIntent{} + return RouteMap{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the ListRoutingIntentResultIterator type. -func NewListRoutingIntentResultIterator(page ListRoutingIntentResultPage) ListRoutingIntentResultIterator { - return ListRoutingIntentResultIterator{page: page} +// Creates a new instance of the ListRouteMapsResultIterator type. +func NewListRouteMapsResultIterator(page ListRouteMapsResultPage) ListRouteMapsResultIterator { + return ListRouteMapsResultIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (lrir ListRoutingIntentResult) IsEmpty() bool { - return lrir.Value == nil || len(*lrir.Value) == 0 +func (lrmr ListRouteMapsResult) IsEmpty() bool { + return lrmr.Value == nil || len(*lrmr.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (lrir ListRoutingIntentResult) hasNextLink() bool { - return lrir.NextLink != nil && len(*lrir.NextLink) != 0 +func (lrmr ListRouteMapsResult) hasNextLink() bool { + return lrmr.NextLink != nil && len(*lrmr.NextLink) != 0 } -// listRoutingIntentResultPreparer prepares a request to retrieve the next set of results. +// listRouteMapsResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (lrir ListRoutingIntentResult) listRoutingIntentResultPreparer(ctx context.Context) (*http.Request, error) { - if !lrir.hasNextLink() { +func (lrmr ListRouteMapsResult) listRouteMapsResultPreparer(ctx context.Context) (*http.Request, error) { + if !lrmr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(lrir.NextLink))) + autorest.WithBaseURL(to.String(lrmr.NextLink))) } -// ListRoutingIntentResultPage contains a page of RoutingIntent values. -type ListRoutingIntentResultPage struct { - fn func(context.Context, ListRoutingIntentResult) (ListRoutingIntentResult, error) - lrir ListRoutingIntentResult +// ListRouteMapsResultPage contains a page of RouteMap values. +type ListRouteMapsResultPage struct { + fn func(context.Context, ListRouteMapsResult) (ListRouteMapsResult, error) + lrmr ListRouteMapsResult } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *ListRoutingIntentResultPage) NextWithContext(ctx context.Context) (err error) { +func (page *ListRouteMapsResultPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListRoutingIntentResultPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ListRouteMapsResultPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -24815,11 +28324,11 @@ func (page *ListRoutingIntentResultPage) NextWithContext(ctx context.Context) (e }() } for { - next, err := page.fn(ctx, page.lrir) + next, err := page.fn(ctx, page.lrmr) if err != nil { return err } - page.lrir = next + page.lrmr = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -24830,63 +28339,57 @@ func (page *ListRoutingIntentResultPage) NextWithContext(ctx context.Context) (e // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *ListRoutingIntentResultPage) Next() error { +func (page *ListRouteMapsResultPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListRoutingIntentResultPage) NotDone() bool { - return !page.lrir.IsEmpty() +func (page ListRouteMapsResultPage) NotDone() bool { + return !page.lrmr.IsEmpty() } // Response returns the raw server response from the last page request. -func (page ListRoutingIntentResultPage) Response() ListRoutingIntentResult { - return page.lrir +func (page ListRouteMapsResultPage) Response() ListRouteMapsResult { + return page.lrmr } // Values returns the slice of values for the current page or nil if there are no values. -func (page ListRoutingIntentResultPage) Values() []RoutingIntent { - if page.lrir.IsEmpty() { +func (page ListRouteMapsResultPage) Values() []RouteMap { + if page.lrmr.IsEmpty() { return nil } - return *page.lrir.Value + return *page.lrmr.Value } -// Creates a new instance of the ListRoutingIntentResultPage type. -func NewListRoutingIntentResultPage(cur ListRoutingIntentResult, getNextPage func(context.Context, ListRoutingIntentResult) (ListRoutingIntentResult, error)) ListRoutingIntentResultPage { - return ListRoutingIntentResultPage{ +// Creates a new instance of the ListRouteMapsResultPage type. +func NewListRouteMapsResultPage(cur ListRouteMapsResult, getNextPage func(context.Context, ListRouteMapsResult) (ListRouteMapsResult, error)) ListRouteMapsResultPage { + return ListRouteMapsResultPage{ fn: getNextPage, - lrir: cur, + lrmr: cur, } } -// ListString ... -type ListString struct { - autorest.Response `json:"-"` - Value *[]string `json:"value,omitempty"` -} - -// ListVirtualHubBgpConnectionResults virtualHubBgpConnections list. -type ListVirtualHubBgpConnectionResults struct { +// ListRoutingIntentResult list of the routing intent result and a URL nextLink to get the next set of +// results. +type ListRoutingIntentResult struct { autorest.Response `json:"-"` - // Value - The list of VirtualHubBgpConnections. - Value *[]BgpConnection `json:"value,omitempty"` - // NextLink - URL to get the next set of results. + // Value - List of RoutingIntent resource. + Value *[]RoutingIntent `json:"value,omitempty"` + // NextLink - URL to get the next set of operation list results if there are any. NextLink *string `json:"nextLink,omitempty"` } -// ListVirtualHubBgpConnectionResultsIterator provides access to a complete listing of BgpConnection -// values. -type ListVirtualHubBgpConnectionResultsIterator struct { +// ListRoutingIntentResultIterator provides access to a complete listing of RoutingIntent values. +type ListRoutingIntentResultIterator struct { i int - page ListVirtualHubBgpConnectionResultsPage + page ListRoutingIntentResultPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *ListVirtualHubBgpConnectionResultsIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *ListRoutingIntentResultIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualHubBgpConnectionResultsIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ListRoutingIntentResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -24911,67 +28414,67 @@ func (iter *ListVirtualHubBgpConnectionResultsIterator) NextWithContext(ctx cont // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *ListVirtualHubBgpConnectionResultsIterator) Next() error { +func (iter *ListRoutingIntentResultIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListVirtualHubBgpConnectionResultsIterator) NotDone() bool { +func (iter ListRoutingIntentResultIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter ListVirtualHubBgpConnectionResultsIterator) Response() ListVirtualHubBgpConnectionResults { +func (iter ListRoutingIntentResultIterator) Response() ListRoutingIntentResult { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter ListVirtualHubBgpConnectionResultsIterator) Value() BgpConnection { +func (iter ListRoutingIntentResultIterator) Value() RoutingIntent { if !iter.page.NotDone() { - return BgpConnection{} + return RoutingIntent{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the ListVirtualHubBgpConnectionResultsIterator type. -func NewListVirtualHubBgpConnectionResultsIterator(page ListVirtualHubBgpConnectionResultsPage) ListVirtualHubBgpConnectionResultsIterator { - return ListVirtualHubBgpConnectionResultsIterator{page: page} +// Creates a new instance of the ListRoutingIntentResultIterator type. +func NewListRoutingIntentResultIterator(page ListRoutingIntentResultPage) ListRoutingIntentResultIterator { + return ListRoutingIntentResultIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (lvhbcr ListVirtualHubBgpConnectionResults) IsEmpty() bool { - return lvhbcr.Value == nil || len(*lvhbcr.Value) == 0 +func (lrir ListRoutingIntentResult) IsEmpty() bool { + return lrir.Value == nil || len(*lrir.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (lvhbcr ListVirtualHubBgpConnectionResults) hasNextLink() bool { - return lvhbcr.NextLink != nil && len(*lvhbcr.NextLink) != 0 +func (lrir ListRoutingIntentResult) hasNextLink() bool { + return lrir.NextLink != nil && len(*lrir.NextLink) != 0 } -// listVirtualHubBgpConnectionResultsPreparer prepares a request to retrieve the next set of results. +// listRoutingIntentResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (lvhbcr ListVirtualHubBgpConnectionResults) listVirtualHubBgpConnectionResultsPreparer(ctx context.Context) (*http.Request, error) { - if !lvhbcr.hasNextLink() { +func (lrir ListRoutingIntentResult) listRoutingIntentResultPreparer(ctx context.Context) (*http.Request, error) { + if !lrir.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(lvhbcr.NextLink))) + autorest.WithBaseURL(to.String(lrir.NextLink))) } -// ListVirtualHubBgpConnectionResultsPage contains a page of BgpConnection values. -type ListVirtualHubBgpConnectionResultsPage struct { - fn func(context.Context, ListVirtualHubBgpConnectionResults) (ListVirtualHubBgpConnectionResults, error) - lvhbcr ListVirtualHubBgpConnectionResults +// ListRoutingIntentResultPage contains a page of RoutingIntent values. +type ListRoutingIntentResultPage struct { + fn func(context.Context, ListRoutingIntentResult) (ListRoutingIntentResult, error) + lrir ListRoutingIntentResult } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *ListVirtualHubBgpConnectionResultsPage) NextWithContext(ctx context.Context) (err error) { +func (page *ListRoutingIntentResultPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualHubBgpConnectionResultsPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ListRoutingIntentResultPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -24981,11 +28484,11 @@ func (page *ListVirtualHubBgpConnectionResultsPage) NextWithContext(ctx context. }() } for { - next, err := page.fn(ctx, page.lvhbcr) + next, err := page.fn(ctx, page.lrir) if err != nil { return err } - page.lvhbcr = next + page.lrir = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -24996,57 +28499,63 @@ func (page *ListVirtualHubBgpConnectionResultsPage) NextWithContext(ctx context. // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *ListVirtualHubBgpConnectionResultsPage) Next() error { +func (page *ListRoutingIntentResultPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListVirtualHubBgpConnectionResultsPage) NotDone() bool { - return !page.lvhbcr.IsEmpty() +func (page ListRoutingIntentResultPage) NotDone() bool { + return !page.lrir.IsEmpty() } // Response returns the raw server response from the last page request. -func (page ListVirtualHubBgpConnectionResultsPage) Response() ListVirtualHubBgpConnectionResults { - return page.lvhbcr +func (page ListRoutingIntentResultPage) Response() ListRoutingIntentResult { + return page.lrir } // Values returns the slice of values for the current page or nil if there are no values. -func (page ListVirtualHubBgpConnectionResultsPage) Values() []BgpConnection { - if page.lvhbcr.IsEmpty() { +func (page ListRoutingIntentResultPage) Values() []RoutingIntent { + if page.lrir.IsEmpty() { return nil } - return *page.lvhbcr.Value + return *page.lrir.Value } -// Creates a new instance of the ListVirtualHubBgpConnectionResultsPage type. -func NewListVirtualHubBgpConnectionResultsPage(cur ListVirtualHubBgpConnectionResults, getNextPage func(context.Context, ListVirtualHubBgpConnectionResults) (ListVirtualHubBgpConnectionResults, error)) ListVirtualHubBgpConnectionResultsPage { - return ListVirtualHubBgpConnectionResultsPage{ - fn: getNextPage, - lvhbcr: cur, +// Creates a new instance of the ListRoutingIntentResultPage type. +func NewListRoutingIntentResultPage(cur ListRoutingIntentResult, getNextPage func(context.Context, ListRoutingIntentResult) (ListRoutingIntentResult, error)) ListRoutingIntentResultPage { + return ListRoutingIntentResultPage{ + fn: getNextPage, + lrir: cur, } } -// ListVirtualHubIPConfigurationResults virtualHubIpConfigurations list. -type ListVirtualHubIPConfigurationResults struct { +// ListString ... +type ListString struct { autorest.Response `json:"-"` - // Value - The list of VirtualHubIpConfigurations. - Value *[]HubIPConfiguration `json:"value,omitempty"` + Value *[]string `json:"value,omitempty"` +} + +// ListVirtualHubBgpConnectionResults virtualHubBgpConnections list. +type ListVirtualHubBgpConnectionResults struct { + autorest.Response `json:"-"` + // Value - The list of VirtualHubBgpConnections. + Value *[]BgpConnection `json:"value,omitempty"` // NextLink - URL to get the next set of results. NextLink *string `json:"nextLink,omitempty"` } -// ListVirtualHubIPConfigurationResultsIterator provides access to a complete listing of HubIPConfiguration +// ListVirtualHubBgpConnectionResultsIterator provides access to a complete listing of BgpConnection // values. -type ListVirtualHubIPConfigurationResultsIterator struct { +type ListVirtualHubBgpConnectionResultsIterator struct { i int - page ListVirtualHubIPConfigurationResultsPage + page ListVirtualHubBgpConnectionResultsPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *ListVirtualHubIPConfigurationResultsIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *ListVirtualHubBgpConnectionResultsIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualHubIPConfigurationResultsIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualHubBgpConnectionResultsIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -25071,67 +28580,67 @@ func (iter *ListVirtualHubIPConfigurationResultsIterator) NextWithContext(ctx co // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *ListVirtualHubIPConfigurationResultsIterator) Next() error { +func (iter *ListVirtualHubBgpConnectionResultsIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ListVirtualHubIPConfigurationResultsIterator) NotDone() bool { +func (iter ListVirtualHubBgpConnectionResultsIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter ListVirtualHubIPConfigurationResultsIterator) Response() ListVirtualHubIPConfigurationResults { +func (iter ListVirtualHubBgpConnectionResultsIterator) Response() ListVirtualHubBgpConnectionResults { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter ListVirtualHubIPConfigurationResultsIterator) Value() HubIPConfiguration { +func (iter ListVirtualHubBgpConnectionResultsIterator) Value() BgpConnection { if !iter.page.NotDone() { - return HubIPConfiguration{} + return BgpConnection{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the ListVirtualHubIPConfigurationResultsIterator type. -func NewListVirtualHubIPConfigurationResultsIterator(page ListVirtualHubIPConfigurationResultsPage) ListVirtualHubIPConfigurationResultsIterator { - return ListVirtualHubIPConfigurationResultsIterator{page: page} +// Creates a new instance of the ListVirtualHubBgpConnectionResultsIterator type. +func NewListVirtualHubBgpConnectionResultsIterator(page ListVirtualHubBgpConnectionResultsPage) ListVirtualHubBgpConnectionResultsIterator { + return ListVirtualHubBgpConnectionResultsIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (lvhicr ListVirtualHubIPConfigurationResults) IsEmpty() bool { - return lvhicr.Value == nil || len(*lvhicr.Value) == 0 +func (lvhbcr ListVirtualHubBgpConnectionResults) IsEmpty() bool { + return lvhbcr.Value == nil || len(*lvhbcr.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (lvhicr ListVirtualHubIPConfigurationResults) hasNextLink() bool { - return lvhicr.NextLink != nil && len(*lvhicr.NextLink) != 0 +func (lvhbcr ListVirtualHubBgpConnectionResults) hasNextLink() bool { + return lvhbcr.NextLink != nil && len(*lvhbcr.NextLink) != 0 } -// listVirtualHubIPConfigurationResultsPreparer prepares a request to retrieve the next set of results. +// listVirtualHubBgpConnectionResultsPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (lvhicr ListVirtualHubIPConfigurationResults) listVirtualHubIPConfigurationResultsPreparer(ctx context.Context) (*http.Request, error) { - if !lvhicr.hasNextLink() { +func (lvhbcr ListVirtualHubBgpConnectionResults) listVirtualHubBgpConnectionResultsPreparer(ctx context.Context) (*http.Request, error) { + if !lvhbcr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(lvhicr.NextLink))) + autorest.WithBaseURL(to.String(lvhbcr.NextLink))) } -// ListVirtualHubIPConfigurationResultsPage contains a page of HubIPConfiguration values. -type ListVirtualHubIPConfigurationResultsPage struct { - fn func(context.Context, ListVirtualHubIPConfigurationResults) (ListVirtualHubIPConfigurationResults, error) - lvhicr ListVirtualHubIPConfigurationResults +// ListVirtualHubBgpConnectionResultsPage contains a page of BgpConnection values. +type ListVirtualHubBgpConnectionResultsPage struct { + fn func(context.Context, ListVirtualHubBgpConnectionResults) (ListVirtualHubBgpConnectionResults, error) + lvhbcr ListVirtualHubBgpConnectionResults } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *ListVirtualHubIPConfigurationResultsPage) NextWithContext(ctx context.Context) (err error) { +func (page *ListVirtualHubBgpConnectionResultsPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualHubIPConfigurationResultsPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualHubBgpConnectionResultsPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -25141,11 +28650,11 @@ func (page *ListVirtualHubIPConfigurationResultsPage) NextWithContext(ctx contex }() } for { - next, err := page.fn(ctx, page.lvhicr) + next, err := page.fn(ctx, page.lvhbcr) if err != nil { return err } - page.lvhicr = next + page.lvhbcr = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -25156,58 +28665,218 @@ func (page *ListVirtualHubIPConfigurationResultsPage) NextWithContext(ctx contex // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *ListVirtualHubIPConfigurationResultsPage) Next() error { +func (page *ListVirtualHubBgpConnectionResultsPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ListVirtualHubIPConfigurationResultsPage) NotDone() bool { - return !page.lvhicr.IsEmpty() +func (page ListVirtualHubBgpConnectionResultsPage) NotDone() bool { + return !page.lvhbcr.IsEmpty() } // Response returns the raw server response from the last page request. -func (page ListVirtualHubIPConfigurationResultsPage) Response() ListVirtualHubIPConfigurationResults { - return page.lvhicr +func (page ListVirtualHubBgpConnectionResultsPage) Response() ListVirtualHubBgpConnectionResults { + return page.lvhbcr } // Values returns the slice of values for the current page or nil if there are no values. -func (page ListVirtualHubIPConfigurationResultsPage) Values() []HubIPConfiguration { - if page.lvhicr.IsEmpty() { +func (page ListVirtualHubBgpConnectionResultsPage) Values() []BgpConnection { + if page.lvhbcr.IsEmpty() { return nil } - return *page.lvhicr.Value + return *page.lvhbcr.Value } -// Creates a new instance of the ListVirtualHubIPConfigurationResultsPage type. -func NewListVirtualHubIPConfigurationResultsPage(cur ListVirtualHubIPConfigurationResults, getNextPage func(context.Context, ListVirtualHubIPConfigurationResults) (ListVirtualHubIPConfigurationResults, error)) ListVirtualHubIPConfigurationResultsPage { - return ListVirtualHubIPConfigurationResultsPage{ +// Creates a new instance of the ListVirtualHubBgpConnectionResultsPage type. +func NewListVirtualHubBgpConnectionResultsPage(cur ListVirtualHubBgpConnectionResults, getNextPage func(context.Context, ListVirtualHubBgpConnectionResults) (ListVirtualHubBgpConnectionResults, error)) ListVirtualHubBgpConnectionResultsPage { + return ListVirtualHubBgpConnectionResultsPage{ fn: getNextPage, - lvhicr: cur, + lvhbcr: cur, } } -// ListVirtualHubRouteTableV2sResult list of VirtualHubRouteTableV2s and a URL nextLink to get the next set -// of results. -type ListVirtualHubRouteTableV2sResult struct { +// ListVirtualHubIPConfigurationResults virtualHubIpConfigurations list. +type ListVirtualHubIPConfigurationResults struct { autorest.Response `json:"-"` - // Value - List of VirtualHubRouteTableV2s. - Value *[]VirtualHubRouteTableV2 `json:"value,omitempty"` - // NextLink - URL to get the next set of operation list results if there are any. + // Value - The list of VirtualHubIpConfigurations. + Value *[]HubIPConfiguration `json:"value,omitempty"` + // NextLink - URL to get the next set of results. NextLink *string `json:"nextLink,omitempty"` } -// ListVirtualHubRouteTableV2sResultIterator provides access to a complete listing of -// VirtualHubRouteTableV2 values. -type ListVirtualHubRouteTableV2sResultIterator struct { +// ListVirtualHubIPConfigurationResultsIterator provides access to a complete listing of HubIPConfiguration +// values. +type ListVirtualHubIPConfigurationResultsIterator struct { i int - page ListVirtualHubRouteTableV2sResultPage + page ListVirtualHubIPConfigurationResultsPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *ListVirtualHubRouteTableV2sResultIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *ListVirtualHubIPConfigurationResultsIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualHubRouteTableV2sResultIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualHubIPConfigurationResultsIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ListVirtualHubIPConfigurationResultsIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ListVirtualHubIPConfigurationResultsIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ListVirtualHubIPConfigurationResultsIterator) Response() ListVirtualHubIPConfigurationResults { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ListVirtualHubIPConfigurationResultsIterator) Value() HubIPConfiguration { + if !iter.page.NotDone() { + return HubIPConfiguration{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ListVirtualHubIPConfigurationResultsIterator type. +func NewListVirtualHubIPConfigurationResultsIterator(page ListVirtualHubIPConfigurationResultsPage) ListVirtualHubIPConfigurationResultsIterator { + return ListVirtualHubIPConfigurationResultsIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (lvhicr ListVirtualHubIPConfigurationResults) IsEmpty() bool { + return lvhicr.Value == nil || len(*lvhicr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (lvhicr ListVirtualHubIPConfigurationResults) hasNextLink() bool { + return lvhicr.NextLink != nil && len(*lvhicr.NextLink) != 0 +} + +// listVirtualHubIPConfigurationResultsPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lvhicr ListVirtualHubIPConfigurationResults) listVirtualHubIPConfigurationResultsPreparer(ctx context.Context) (*http.Request, error) { + if !lvhicr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lvhicr.NextLink))) +} + +// ListVirtualHubIPConfigurationResultsPage contains a page of HubIPConfiguration values. +type ListVirtualHubIPConfigurationResultsPage struct { + fn func(context.Context, ListVirtualHubIPConfigurationResults) (ListVirtualHubIPConfigurationResults, error) + lvhicr ListVirtualHubIPConfigurationResults +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ListVirtualHubIPConfigurationResultsPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualHubIPConfigurationResultsPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.lvhicr) + if err != nil { + return err + } + page.lvhicr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ListVirtualHubIPConfigurationResultsPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ListVirtualHubIPConfigurationResultsPage) NotDone() bool { + return !page.lvhicr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ListVirtualHubIPConfigurationResultsPage) Response() ListVirtualHubIPConfigurationResults { + return page.lvhicr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ListVirtualHubIPConfigurationResultsPage) Values() []HubIPConfiguration { + if page.lvhicr.IsEmpty() { + return nil + } + return *page.lvhicr.Value +} + +// Creates a new instance of the ListVirtualHubIPConfigurationResultsPage type. +func NewListVirtualHubIPConfigurationResultsPage(cur ListVirtualHubIPConfigurationResults, getNextPage func(context.Context, ListVirtualHubIPConfigurationResults) (ListVirtualHubIPConfigurationResults, error)) ListVirtualHubIPConfigurationResultsPage { + return ListVirtualHubIPConfigurationResultsPage{ + fn: getNextPage, + lvhicr: cur, + } +} + +// ListVirtualHubRouteTableV2sResult list of VirtualHubRouteTableV2s and a URL nextLink to get the next set +// of results. +type ListVirtualHubRouteTableV2sResult struct { + autorest.Response `json:"-"` + // Value - List of VirtualHubRouteTableV2s. + Value *[]VirtualHubRouteTableV2 `json:"value,omitempty"` + // NextLink - URL to get the next set of operation list results if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// ListVirtualHubRouteTableV2sResultIterator provides access to a complete listing of +// VirtualHubRouteTableV2 values. +type ListVirtualHubRouteTableV2sResultIterator struct { + i int + page ListVirtualHubRouteTableV2sResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ListVirtualHubRouteTableV2sResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListVirtualHubRouteTableV2sResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -28121,185 +31790,914 @@ func (lborlr LoadBalancerOutboundRuleListResult) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// LoadBalancerOutboundRuleListResultIterator provides access to a complete listing of OutboundRule values. -type LoadBalancerOutboundRuleListResultIterator struct { - i int - page LoadBalancerOutboundRuleListResultPage +// LoadBalancerOutboundRuleListResultIterator provides access to a complete listing of OutboundRule values. +type LoadBalancerOutboundRuleListResultIterator struct { + i int + page LoadBalancerOutboundRuleListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *LoadBalancerOutboundRuleListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerOutboundRuleListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *LoadBalancerOutboundRuleListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter LoadBalancerOutboundRuleListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter LoadBalancerOutboundRuleListResultIterator) Response() LoadBalancerOutboundRuleListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter LoadBalancerOutboundRuleListResultIterator) Value() OutboundRule { + if !iter.page.NotDone() { + return OutboundRule{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the LoadBalancerOutboundRuleListResultIterator type. +func NewLoadBalancerOutboundRuleListResultIterator(page LoadBalancerOutboundRuleListResultPage) LoadBalancerOutboundRuleListResultIterator { + return LoadBalancerOutboundRuleListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (lborlr LoadBalancerOutboundRuleListResult) IsEmpty() bool { + return lborlr.Value == nil || len(*lborlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (lborlr LoadBalancerOutboundRuleListResult) hasNextLink() bool { + return lborlr.NextLink != nil && len(*lborlr.NextLink) != 0 +} + +// loadBalancerOutboundRuleListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lborlr LoadBalancerOutboundRuleListResult) loadBalancerOutboundRuleListResultPreparer(ctx context.Context) (*http.Request, error) { + if !lborlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lborlr.NextLink))) +} + +// LoadBalancerOutboundRuleListResultPage contains a page of OutboundRule values. +type LoadBalancerOutboundRuleListResultPage struct { + fn func(context.Context, LoadBalancerOutboundRuleListResult) (LoadBalancerOutboundRuleListResult, error) + lborlr LoadBalancerOutboundRuleListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *LoadBalancerOutboundRuleListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerOutboundRuleListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.lborlr) + if err != nil { + return err + } + page.lborlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *LoadBalancerOutboundRuleListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page LoadBalancerOutboundRuleListResultPage) NotDone() bool { + return !page.lborlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page LoadBalancerOutboundRuleListResultPage) Response() LoadBalancerOutboundRuleListResult { + return page.lborlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page LoadBalancerOutboundRuleListResultPage) Values() []OutboundRule { + if page.lborlr.IsEmpty() { + return nil + } + return *page.lborlr.Value +} + +// Creates a new instance of the LoadBalancerOutboundRuleListResultPage type. +func NewLoadBalancerOutboundRuleListResultPage(cur LoadBalancerOutboundRuleListResult, getNextPage func(context.Context, LoadBalancerOutboundRuleListResult) (LoadBalancerOutboundRuleListResult, error)) LoadBalancerOutboundRuleListResultPage { + return LoadBalancerOutboundRuleListResultPage{ + fn: getNextPage, + lborlr: cur, + } +} + +// LoadBalancerProbeListResult response for ListProbe API service call. +type LoadBalancerProbeListResult struct { + autorest.Response `json:"-"` + // Value - A list of probes in a load balancer. + Value *[]Probe `json:"value,omitempty"` + // NextLink - READ-ONLY; The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for LoadBalancerProbeListResult. +func (lbplr LoadBalancerProbeListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lbplr.Value != nil { + objectMap["value"] = lbplr.Value + } + return json.Marshal(objectMap) +} + +// LoadBalancerProbeListResultIterator provides access to a complete listing of Probe values. +type LoadBalancerProbeListResultIterator struct { + i int + page LoadBalancerProbeListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *LoadBalancerProbeListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerProbeListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *LoadBalancerProbeListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter LoadBalancerProbeListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter LoadBalancerProbeListResultIterator) Response() LoadBalancerProbeListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter LoadBalancerProbeListResultIterator) Value() Probe { + if !iter.page.NotDone() { + return Probe{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the LoadBalancerProbeListResultIterator type. +func NewLoadBalancerProbeListResultIterator(page LoadBalancerProbeListResultPage) LoadBalancerProbeListResultIterator { + return LoadBalancerProbeListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (lbplr LoadBalancerProbeListResult) IsEmpty() bool { + return lbplr.Value == nil || len(*lbplr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (lbplr LoadBalancerProbeListResult) hasNextLink() bool { + return lbplr.NextLink != nil && len(*lbplr.NextLink) != 0 +} + +// loadBalancerProbeListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lbplr LoadBalancerProbeListResult) loadBalancerProbeListResultPreparer(ctx context.Context) (*http.Request, error) { + if !lbplr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lbplr.NextLink))) +} + +// LoadBalancerProbeListResultPage contains a page of Probe values. +type LoadBalancerProbeListResultPage struct { + fn func(context.Context, LoadBalancerProbeListResult) (LoadBalancerProbeListResult, error) + lbplr LoadBalancerProbeListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *LoadBalancerProbeListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerProbeListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.lbplr) + if err != nil { + return err + } + page.lbplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *LoadBalancerProbeListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page LoadBalancerProbeListResultPage) NotDone() bool { + return !page.lbplr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page LoadBalancerProbeListResultPage) Response() LoadBalancerProbeListResult { + return page.lbplr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page LoadBalancerProbeListResultPage) Values() []Probe { + if page.lbplr.IsEmpty() { + return nil + } + return *page.lbplr.Value +} + +// Creates a new instance of the LoadBalancerProbeListResultPage type. +func NewLoadBalancerProbeListResultPage(cur LoadBalancerProbeListResult, getNextPage func(context.Context, LoadBalancerProbeListResult) (LoadBalancerProbeListResult, error)) LoadBalancerProbeListResultPage { + return LoadBalancerProbeListResultPage{ + fn: getNextPage, + lbplr: cur, + } +} + +// LoadBalancerPropertiesFormat properties of the load balancer. +type LoadBalancerPropertiesFormat struct { + // FrontendIPConfigurations - Object representing the frontend IPs to be used for the load balancer. + FrontendIPConfigurations *[]FrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` + // BackendAddressPools - Collection of backend address pools used by a load balancer. + BackendAddressPools *[]BackendAddressPool `json:"backendAddressPools,omitempty"` + // LoadBalancingRules - Object collection representing the load balancing rules Gets the provisioning. + LoadBalancingRules *[]LoadBalancingRule `json:"loadBalancingRules,omitempty"` + // Probes - Collection of probe objects used in the load balancer. + Probes *[]Probe `json:"probes,omitempty"` + // InboundNatRules - Collection of inbound NAT Rules used by a load balancer. Defining inbound NAT rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an Inbound NAT pool. They have to reference individual inbound NAT rules. + InboundNatRules *[]InboundNatRule `json:"inboundNatRules,omitempty"` + // InboundNatPools - Defines an external port range for inbound NAT to a single backend port on NICs associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound NAT rules. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have to reference individual inbound NAT rules. + InboundNatPools *[]InboundNatPool `json:"inboundNatPools,omitempty"` + // OutboundRules - The outbound rules. + OutboundRules *[]OutboundRule `json:"outboundRules,omitempty"` + // ResourceGUID - READ-ONLY; The resource GUID property of the load balancer resource. + ResourceGUID *string `json:"resourceGuid,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the load balancer resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for LoadBalancerPropertiesFormat. +func (lbpf LoadBalancerPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lbpf.FrontendIPConfigurations != nil { + objectMap["frontendIPConfigurations"] = lbpf.FrontendIPConfigurations + } + if lbpf.BackendAddressPools != nil { + objectMap["backendAddressPools"] = lbpf.BackendAddressPools + } + if lbpf.LoadBalancingRules != nil { + objectMap["loadBalancingRules"] = lbpf.LoadBalancingRules + } + if lbpf.Probes != nil { + objectMap["probes"] = lbpf.Probes + } + if lbpf.InboundNatRules != nil { + objectMap["inboundNatRules"] = lbpf.InboundNatRules + } + if lbpf.InboundNatPools != nil { + objectMap["inboundNatPools"] = lbpf.InboundNatPools + } + if lbpf.OutboundRules != nil { + objectMap["outboundRules"] = lbpf.OutboundRules + } + return json.Marshal(objectMap) +} + +// LoadBalancersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type LoadBalancersCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LoadBalancersClient) (LoadBalancer, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LoadBalancersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for LoadBalancersCreateOrUpdateFuture.Result. +func (future *LoadBalancersCreateOrUpdateFuture) result(client LoadBalancersClient) (lb LoadBalancer, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + lb.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.LoadBalancersCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if lb.Response.Response, err = future.GetResult(sender); err == nil && lb.Response.Response.StatusCode != http.StatusNoContent { + lb, err = client.CreateOrUpdateResponder(lb.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancersCreateOrUpdateFuture", "Result", lb.Response.Response, "Failure responding to request") + } + } + return +} + +// LoadBalancersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type LoadBalancersDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LoadBalancersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LoadBalancersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for LoadBalancersDeleteFuture.Result. +func (future *LoadBalancersDeleteFuture) result(client LoadBalancersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.LoadBalancersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// LoadBalancerSku SKU of a load balancer. +type LoadBalancerSku struct { + // Name - Name of a load balancer SKU. Possible values include: 'LoadBalancerSkuNameBasic', 'LoadBalancerSkuNameStandard', 'LoadBalancerSkuNameGateway' + Name LoadBalancerSkuName `json:"name,omitempty"` + // Tier - Tier of a load balancer SKU. Possible values include: 'Regional', 'Global' + Tier LoadBalancerSkuTier `json:"tier,omitempty"` +} + +// LoadBalancersListInboundNatRulePortMappingsFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type LoadBalancersListInboundNatRulePortMappingsFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LoadBalancersClient) (BackendAddressInboundNatRulePortMappings, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LoadBalancersListInboundNatRulePortMappingsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for LoadBalancersListInboundNatRulePortMappingsFuture.Result. +func (future *LoadBalancersListInboundNatRulePortMappingsFuture) result(client LoadBalancersClient) (bainrpm BackendAddressInboundNatRulePortMappings, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancersListInboundNatRulePortMappingsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + bainrpm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.LoadBalancersListInboundNatRulePortMappingsFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if bainrpm.Response.Response, err = future.GetResult(sender); err == nil && bainrpm.Response.Response.StatusCode != http.StatusNoContent { + bainrpm, err = client.ListInboundNatRulePortMappingsResponder(bainrpm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancersListInboundNatRulePortMappingsFuture", "Result", bainrpm.Response.Response, "Failure responding to request") + } + } + return +} + +// LoadBalancersSwapPublicIPAddressesFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type LoadBalancersSwapPublicIPAddressesFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LoadBalancersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LoadBalancersSwapPublicIPAddressesFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for LoadBalancersSwapPublicIPAddressesFuture.Result. +func (future *LoadBalancersSwapPublicIPAddressesFuture) result(client LoadBalancersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancersSwapPublicIPAddressesFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.LoadBalancersSwapPublicIPAddressesFuture") + return + } + ar.Response = future.Response() + return +} + +// LoadBalancerVipSwapRequest the request for a VIP swap. +type LoadBalancerVipSwapRequest struct { + // FrontendIPConfigurations - A list of frontend IP configuration resources that should swap VIPs. + FrontendIPConfigurations *[]LoadBalancerVipSwapRequestFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` +} + +// LoadBalancerVipSwapRequestFrontendIPConfiguration VIP swap request's frontend IP configuration object. +type LoadBalancerVipSwapRequestFrontendIPConfiguration struct { + // ID - The ID of frontend IP configuration resource. + ID *string `json:"id,omitempty"` + // LoadBalancerVipSwapRequestFrontendIPConfigurationProperties - The properties of VIP swap request's frontend IP configuration object. + *LoadBalancerVipSwapRequestFrontendIPConfigurationProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for LoadBalancerVipSwapRequestFrontendIPConfiguration. +func (lbvsrfic LoadBalancerVipSwapRequestFrontendIPConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lbvsrfic.ID != nil { + objectMap["id"] = lbvsrfic.ID + } + if lbvsrfic.LoadBalancerVipSwapRequestFrontendIPConfigurationProperties != nil { + objectMap["properties"] = lbvsrfic.LoadBalancerVipSwapRequestFrontendIPConfigurationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for LoadBalancerVipSwapRequestFrontendIPConfiguration struct. +func (lbvsrfic *LoadBalancerVipSwapRequestFrontendIPConfiguration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + lbvsrfic.ID = &ID + } + case "properties": + if v != nil { + var loadBalancerVipSwapRequestFrontendIPConfigurationProperties LoadBalancerVipSwapRequestFrontendIPConfigurationProperties + err = json.Unmarshal(*v, &loadBalancerVipSwapRequestFrontendIPConfigurationProperties) + if err != nil { + return err + } + lbvsrfic.LoadBalancerVipSwapRequestFrontendIPConfigurationProperties = &loadBalancerVipSwapRequestFrontendIPConfigurationProperties + } + } + } + + return nil +} + +// LoadBalancerVipSwapRequestFrontendIPConfigurationProperties the properties of VIP swap request's +// frontend IP configuration object. +type LoadBalancerVipSwapRequestFrontendIPConfigurationProperties struct { + // PublicIPAddress - A reference to public IP address resource. + PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` +} + +// LoadBalancingRule a load balancing rule for a load balancer. +type LoadBalancingRule struct { + autorest.Response `json:"-"` + // LoadBalancingRulePropertiesFormat - Properties of load balancer load balancing rule. + *LoadBalancingRulePropertiesFormat `json:"properties,omitempty"` + // Name - The name of the resource that is unique within the set of load balancing rules used by the load balancer. This name can be used to access the resource. + Name *string `json:"name,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // Type - READ-ONLY; Type of the resource. + Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for LoadBalancingRule. +func (lbr LoadBalancingRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lbr.LoadBalancingRulePropertiesFormat != nil { + objectMap["properties"] = lbr.LoadBalancingRulePropertiesFormat + } + if lbr.Name != nil { + objectMap["name"] = lbr.Name + } + if lbr.ID != nil { + objectMap["id"] = lbr.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for LoadBalancingRule struct. +func (lbr *LoadBalancingRule) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var loadBalancingRulePropertiesFormat LoadBalancingRulePropertiesFormat + err = json.Unmarshal(*v, &loadBalancingRulePropertiesFormat) + if err != nil { + return err + } + lbr.LoadBalancingRulePropertiesFormat = &loadBalancingRulePropertiesFormat + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + lbr.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + lbr.Etag = &etag + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + lbr.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + lbr.ID = &ID + } + } + } + + return nil +} + +// LoadBalancingRulePropertiesFormat properties of the load balancer. +type LoadBalancingRulePropertiesFormat struct { + // FrontendIPConfiguration - A reference to frontend IP addresses. + FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` + // BackendAddressPool - A reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs. + BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` + // BackendAddressPools - An array of references to pool of DIPs. + BackendAddressPools *[]SubResource `json:"backendAddressPools,omitempty"` + // Probe - The reference to the load balancer probe used by the load balancing rule. + Probe *SubResource `json:"probe,omitempty"` + // Protocol - The reference to the transport protocol used by the load balancing rule. Possible values include: 'TransportProtocolUDP', 'TransportProtocolTCP', 'TransportProtocolAll' + Protocol TransportProtocol `json:"protocol,omitempty"` + // LoadDistribution - The load distribution policy for this rule. Possible values include: 'LoadDistributionDefault', 'LoadDistributionSourceIP', 'LoadDistributionSourceIPProtocol' + LoadDistribution LoadDistribution `json:"loadDistribution,omitempty"` + // FrontendPort - The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables "Any Port". + FrontendPort *int32 `json:"frontendPort,omitempty"` + // BackendPort - The port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables "Any Port". + BackendPort *int32 `json:"backendPort,omitempty"` + // IdleTimeoutInMinutes - The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. + IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` + // EnableFloatingIP - Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. + EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` + // EnableTCPReset - Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. + EnableTCPReset *bool `json:"enableTcpReset,omitempty"` + // DisableOutboundSnat - Configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing rule. + DisableOutboundSnat *bool `json:"disableOutboundSnat,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the load balancing rule resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for LoadBalancingRulePropertiesFormat. +func (lbrpf LoadBalancingRulePropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lbrpf.FrontendIPConfiguration != nil { + objectMap["frontendIPConfiguration"] = lbrpf.FrontendIPConfiguration + } + if lbrpf.BackendAddressPool != nil { + objectMap["backendAddressPool"] = lbrpf.BackendAddressPool + } + if lbrpf.BackendAddressPools != nil { + objectMap["backendAddressPools"] = lbrpf.BackendAddressPools + } + if lbrpf.Probe != nil { + objectMap["probe"] = lbrpf.Probe + } + if lbrpf.Protocol != "" { + objectMap["protocol"] = lbrpf.Protocol + } + if lbrpf.LoadDistribution != "" { + objectMap["loadDistribution"] = lbrpf.LoadDistribution + } + if lbrpf.FrontendPort != nil { + objectMap["frontendPort"] = lbrpf.FrontendPort + } + if lbrpf.BackendPort != nil { + objectMap["backendPort"] = lbrpf.BackendPort + } + if lbrpf.IdleTimeoutInMinutes != nil { + objectMap["idleTimeoutInMinutes"] = lbrpf.IdleTimeoutInMinutes + } + if lbrpf.EnableFloatingIP != nil { + objectMap["enableFloatingIP"] = lbrpf.EnableFloatingIP + } + if lbrpf.EnableTCPReset != nil { + objectMap["enableTcpReset"] = lbrpf.EnableTCPReset + } + if lbrpf.DisableOutboundSnat != nil { + objectMap["disableOutboundSnat"] = lbrpf.DisableOutboundSnat + } + return json.Marshal(objectMap) +} + +// LocalNetworkGateway a common class for general resource information. +type LocalNetworkGateway struct { + autorest.Response `json:"-"` + // LocalNetworkGatewayPropertiesFormat - Properties of the local network gateway. + *LocalNetworkGatewayPropertiesFormat `json:"properties,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` } -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *LoadBalancerOutboundRuleListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerOutboundRuleListResultIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() +// MarshalJSON is the custom marshaler for LocalNetworkGateway. +func (lng LocalNetworkGateway) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lng.LocalNetworkGatewayPropertiesFormat != nil { + objectMap["properties"] = lng.LocalNetworkGatewayPropertiesFormat } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil + if lng.ID != nil { + objectMap["id"] = lng.ID } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err + if lng.Location != nil { + objectMap["location"] = lng.Location } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *LoadBalancerOutboundRuleListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter LoadBalancerOutboundRuleListResultIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter LoadBalancerOutboundRuleListResultIterator) Response() LoadBalancerOutboundRuleListResult { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter LoadBalancerOutboundRuleListResultIterator) Value() OutboundRule { - if !iter.page.NotDone() { - return OutboundRule{} + if lng.Tags != nil { + objectMap["tags"] = lng.Tags } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the LoadBalancerOutboundRuleListResultIterator type. -func NewLoadBalancerOutboundRuleListResultIterator(page LoadBalancerOutboundRuleListResultPage) LoadBalancerOutboundRuleListResultIterator { - return LoadBalancerOutboundRuleListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (lborlr LoadBalancerOutboundRuleListResult) IsEmpty() bool { - return lborlr.Value == nil || len(*lborlr.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (lborlr LoadBalancerOutboundRuleListResult) hasNextLink() bool { - return lborlr.NextLink != nil && len(*lborlr.NextLink) != 0 + return json.Marshal(objectMap) } -// loadBalancerOutboundRuleListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (lborlr LoadBalancerOutboundRuleListResult) loadBalancerOutboundRuleListResultPreparer(ctx context.Context) (*http.Request, error) { - if !lborlr.hasNextLink() { - return nil, nil +// UnmarshalJSON is the custom unmarshaler for LocalNetworkGateway struct. +func (lng *LocalNetworkGateway) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(lborlr.NextLink))) -} - -// LoadBalancerOutboundRuleListResultPage contains a page of OutboundRule values. -type LoadBalancerOutboundRuleListResultPage struct { - fn func(context.Context, LoadBalancerOutboundRuleListResult) (LoadBalancerOutboundRuleListResult, error) - lborlr LoadBalancerOutboundRuleListResult -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *LoadBalancerOutboundRuleListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerOutboundRuleListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode + for k, v := range m { + switch k { + case "properties": + if v != nil { + var localNetworkGatewayPropertiesFormat LocalNetworkGatewayPropertiesFormat + err = json.Unmarshal(*v, &localNetworkGatewayPropertiesFormat) + if err != nil { + return err + } + lng.LocalNetworkGatewayPropertiesFormat = &localNetworkGatewayPropertiesFormat + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + lng.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + lng.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + lng.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + lng.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + lng.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + lng.Tags = tags } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.lborlr) - if err != nil { - return err - } - page.lborlr = next - if !next.hasNextLink() || !next.IsEmpty() { - break } } - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *LoadBalancerOutboundRuleListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page LoadBalancerOutboundRuleListResultPage) NotDone() bool { - return !page.lborlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page LoadBalancerOutboundRuleListResultPage) Response() LoadBalancerOutboundRuleListResult { - return page.lborlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page LoadBalancerOutboundRuleListResultPage) Values() []OutboundRule { - if page.lborlr.IsEmpty() { - return nil - } - return *page.lborlr.Value -} -// Creates a new instance of the LoadBalancerOutboundRuleListResultPage type. -func NewLoadBalancerOutboundRuleListResultPage(cur LoadBalancerOutboundRuleListResult, getNextPage func(context.Context, LoadBalancerOutboundRuleListResult) (LoadBalancerOutboundRuleListResult, error)) LoadBalancerOutboundRuleListResultPage { - return LoadBalancerOutboundRuleListResultPage{ - fn: getNextPage, - lborlr: cur, - } + return nil } -// LoadBalancerProbeListResult response for ListProbe API service call. -type LoadBalancerProbeListResult struct { +// LocalNetworkGatewayListResult response for ListLocalNetworkGateways API service call. +type LocalNetworkGatewayListResult struct { autorest.Response `json:"-"` - // Value - A list of probes in a load balancer. - Value *[]Probe `json:"value,omitempty"` + // Value - A list of local network gateways that exists in a resource group. + Value *[]LocalNetworkGateway `json:"value,omitempty"` // NextLink - READ-ONLY; The URL to get the next set of results. NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for LoadBalancerProbeListResult. -func (lbplr LoadBalancerProbeListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for LocalNetworkGatewayListResult. +func (lnglr LocalNetworkGatewayListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if lbplr.Value != nil { - objectMap["value"] = lbplr.Value + if lnglr.Value != nil { + objectMap["value"] = lnglr.Value } return json.Marshal(objectMap) } -// LoadBalancerProbeListResultIterator provides access to a complete listing of Probe values. -type LoadBalancerProbeListResultIterator struct { +// LocalNetworkGatewayListResultIterator provides access to a complete listing of LocalNetworkGateway +// values. +type LocalNetworkGatewayListResultIterator struct { i int - page LoadBalancerProbeListResultPage + page LocalNetworkGatewayListResultPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *LoadBalancerProbeListResultIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *LocalNetworkGatewayListResultIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerProbeListResultIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/LocalNetworkGatewayListResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -28324,67 +32722,67 @@ func (iter *LoadBalancerProbeListResultIterator) NextWithContext(ctx context.Con // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *LoadBalancerProbeListResultIterator) Next() error { +func (iter *LocalNetworkGatewayListResultIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter LoadBalancerProbeListResultIterator) NotDone() bool { +func (iter LocalNetworkGatewayListResultIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter LoadBalancerProbeListResultIterator) Response() LoadBalancerProbeListResult { +func (iter LocalNetworkGatewayListResultIterator) Response() LocalNetworkGatewayListResult { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter LoadBalancerProbeListResultIterator) Value() Probe { +func (iter LocalNetworkGatewayListResultIterator) Value() LocalNetworkGateway { if !iter.page.NotDone() { - return Probe{} + return LocalNetworkGateway{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the LoadBalancerProbeListResultIterator type. -func NewLoadBalancerProbeListResultIterator(page LoadBalancerProbeListResultPage) LoadBalancerProbeListResultIterator { - return LoadBalancerProbeListResultIterator{page: page} +// Creates a new instance of the LocalNetworkGatewayListResultIterator type. +func NewLocalNetworkGatewayListResultIterator(page LocalNetworkGatewayListResultPage) LocalNetworkGatewayListResultIterator { + return LocalNetworkGatewayListResultIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (lbplr LoadBalancerProbeListResult) IsEmpty() bool { - return lbplr.Value == nil || len(*lbplr.Value) == 0 +func (lnglr LocalNetworkGatewayListResult) IsEmpty() bool { + return lnglr.Value == nil || len(*lnglr.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (lbplr LoadBalancerProbeListResult) hasNextLink() bool { - return lbplr.NextLink != nil && len(*lbplr.NextLink) != 0 +func (lnglr LocalNetworkGatewayListResult) hasNextLink() bool { + return lnglr.NextLink != nil && len(*lnglr.NextLink) != 0 } -// loadBalancerProbeListResultPreparer prepares a request to retrieve the next set of results. +// localNetworkGatewayListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (lbplr LoadBalancerProbeListResult) loadBalancerProbeListResultPreparer(ctx context.Context) (*http.Request, error) { - if !lbplr.hasNextLink() { +func (lnglr LocalNetworkGatewayListResult) localNetworkGatewayListResultPreparer(ctx context.Context) (*http.Request, error) { + if !lnglr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(lbplr.NextLink))) + autorest.WithBaseURL(to.String(lnglr.NextLink))) } -// LoadBalancerProbeListResultPage contains a page of Probe values. -type LoadBalancerProbeListResultPage struct { - fn func(context.Context, LoadBalancerProbeListResult) (LoadBalancerProbeListResult, error) - lbplr LoadBalancerProbeListResult +// LocalNetworkGatewayListResultPage contains a page of LocalNetworkGateway values. +type LocalNetworkGatewayListResultPage struct { + fn func(context.Context, LocalNetworkGatewayListResult) (LocalNetworkGatewayListResult, error) + lnglr LocalNetworkGatewayListResult } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *LoadBalancerProbeListResultPage) NextWithContext(ctx context.Context) (err error) { +func (page *LocalNetworkGatewayListResultPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoadBalancerProbeListResultPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/LocalNetworkGatewayListResultPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -28394,11 +32792,11 @@ func (page *LoadBalancerProbeListResultPage) NextWithContext(ctx context.Context }() } for { - next, err := page.fn(ctx, page.lbplr) + next, err := page.fn(ctx, page.lnglr) if err != nil { return err } - page.lbplr = next + page.lnglr = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -28409,184 +32807,81 @@ func (page *LoadBalancerProbeListResultPage) NextWithContext(ctx context.Context // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *LoadBalancerProbeListResultPage) Next() error { +func (page *LocalNetworkGatewayListResultPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page LoadBalancerProbeListResultPage) NotDone() bool { - return !page.lbplr.IsEmpty() +func (page LocalNetworkGatewayListResultPage) NotDone() bool { + return !page.lnglr.IsEmpty() } // Response returns the raw server response from the last page request. -func (page LoadBalancerProbeListResultPage) Response() LoadBalancerProbeListResult { - return page.lbplr +func (page LocalNetworkGatewayListResultPage) Response() LocalNetworkGatewayListResult { + return page.lnglr } // Values returns the slice of values for the current page or nil if there are no values. -func (page LoadBalancerProbeListResultPage) Values() []Probe { - if page.lbplr.IsEmpty() { +func (page LocalNetworkGatewayListResultPage) Values() []LocalNetworkGateway { + if page.lnglr.IsEmpty() { return nil } - return *page.lbplr.Value + return *page.lnglr.Value } -// Creates a new instance of the LoadBalancerProbeListResultPage type. -func NewLoadBalancerProbeListResultPage(cur LoadBalancerProbeListResult, getNextPage func(context.Context, LoadBalancerProbeListResult) (LoadBalancerProbeListResult, error)) LoadBalancerProbeListResultPage { - return LoadBalancerProbeListResultPage{ +// Creates a new instance of the LocalNetworkGatewayListResultPage type. +func NewLocalNetworkGatewayListResultPage(cur LocalNetworkGatewayListResult, getNextPage func(context.Context, LocalNetworkGatewayListResult) (LocalNetworkGatewayListResult, error)) LocalNetworkGatewayListResultPage { + return LocalNetworkGatewayListResultPage{ fn: getNextPage, - lbplr: cur, + lnglr: cur, } } -// LoadBalancerPropertiesFormat properties of the load balancer. -type LoadBalancerPropertiesFormat struct { - // FrontendIPConfigurations - Object representing the frontend IPs to be used for the load balancer. - FrontendIPConfigurations *[]FrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` - // BackendAddressPools - Collection of backend address pools used by a load balancer. - BackendAddressPools *[]BackendAddressPool `json:"backendAddressPools,omitempty"` - // LoadBalancingRules - Object collection representing the load balancing rules Gets the provisioning. - LoadBalancingRules *[]LoadBalancingRule `json:"loadBalancingRules,omitempty"` - // Probes - Collection of probe objects used in the load balancer. - Probes *[]Probe `json:"probes,omitempty"` - // InboundNatRules - Collection of inbound NAT Rules used by a load balancer. Defining inbound NAT rules on your load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an Inbound NAT pool. They have to reference individual inbound NAT rules. - InboundNatRules *[]InboundNatRule `json:"inboundNatRules,omitempty"` - // InboundNatPools - Defines an external port range for inbound NAT to a single backend port on NICs associated with a load balancer. Inbound NAT rules are created automatically for each NIC associated with the Load Balancer using an external port from this range. Defining an Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound NAT rules. Inbound NAT pools are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an inbound NAT pool. They have to reference individual inbound NAT rules. - InboundNatPools *[]InboundNatPool `json:"inboundNatPools,omitempty"` - // OutboundRules - The outbound rules. - OutboundRules *[]OutboundRule `json:"outboundRules,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the load balancer resource. +// LocalNetworkGatewayPropertiesFormat localNetworkGateway properties. +type LocalNetworkGatewayPropertiesFormat struct { + // LocalNetworkAddressSpace - Local network site address space. + LocalNetworkAddressSpace *AddressSpace `json:"localNetworkAddressSpace,omitempty"` + // GatewayIPAddress - IP address of local network gateway. + GatewayIPAddress *string `json:"gatewayIpAddress,omitempty"` + // Fqdn - FQDN of local network gateway. + Fqdn *string `json:"fqdn,omitempty"` + // BgpSettings - Local network gateway's BGP speaker settings. + BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` + // ResourceGUID - READ-ONLY; The resource GUID property of the local network gateway resource. ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the load balancer resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' + // ProvisioningState - READ-ONLY; The provisioning state of the local network gateway resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } -// MarshalJSON is the custom marshaler for LoadBalancerPropertiesFormat. -func (lbpf LoadBalancerPropertiesFormat) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for LocalNetworkGatewayPropertiesFormat. +func (lngpf LocalNetworkGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if lbpf.FrontendIPConfigurations != nil { - objectMap["frontendIPConfigurations"] = lbpf.FrontendIPConfigurations - } - if lbpf.BackendAddressPools != nil { - objectMap["backendAddressPools"] = lbpf.BackendAddressPools - } - if lbpf.LoadBalancingRules != nil { - objectMap["loadBalancingRules"] = lbpf.LoadBalancingRules - } - if lbpf.Probes != nil { - objectMap["probes"] = lbpf.Probes + if lngpf.LocalNetworkAddressSpace != nil { + objectMap["localNetworkAddressSpace"] = lngpf.LocalNetworkAddressSpace } - if lbpf.InboundNatRules != nil { - objectMap["inboundNatRules"] = lbpf.InboundNatRules + if lngpf.GatewayIPAddress != nil { + objectMap["gatewayIpAddress"] = lngpf.GatewayIPAddress } - if lbpf.InboundNatPools != nil { - objectMap["inboundNatPools"] = lbpf.InboundNatPools + if lngpf.Fqdn != nil { + objectMap["fqdn"] = lngpf.Fqdn } - if lbpf.OutboundRules != nil { - objectMap["outboundRules"] = lbpf.OutboundRules + if lngpf.BgpSettings != nil { + objectMap["bgpSettings"] = lngpf.BgpSettings } return json.Marshal(objectMap) } -// LoadBalancersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// LocalNetworkGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. -type LoadBalancersCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(LoadBalancersClient) (LoadBalancer, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *LoadBalancersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for LoadBalancersCreateOrUpdateFuture.Result. -func (future *LoadBalancersCreateOrUpdateFuture) result(client LoadBalancersClient) (lb LoadBalancer, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - lb.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.LoadBalancersCreateOrUpdateFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if lb.Response.Response, err = future.GetResult(sender); err == nil && lb.Response.Response.StatusCode != http.StatusNoContent { - lb, err = client.CreateOrUpdateResponder(lb.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersCreateOrUpdateFuture", "Result", lb.Response.Response, "Failure responding to request") - } - } - return -} - -// LoadBalancersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type LoadBalancersDeleteFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(LoadBalancersClient) (autorest.Response, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *LoadBalancersDeleteFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil -} - -// result is the default implementation for LoadBalancersDeleteFuture.Result. -func (future *LoadBalancersDeleteFuture) result(client LoadBalancersClient) (ar autorest.Response, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.LoadBalancersDeleteFuture") - return - } - ar.Response = future.Response() - return -} - -// LoadBalancerSku SKU of a load balancer. -type LoadBalancerSku struct { - // Name - Name of a load balancer SKU. Possible values include: 'LoadBalancerSkuNameBasic', 'LoadBalancerSkuNameStandard', 'LoadBalancerSkuNameGateway' - Name LoadBalancerSkuName `json:"name,omitempty"` - // Tier - Tier of a load balancer SKU. Possible values include: 'LoadBalancerSkuTierRegional', 'LoadBalancerSkuTierGlobal' - Tier LoadBalancerSkuTier `json:"tier,omitempty"` -} - -// LoadBalancersListInboundNatRulePortMappingsFuture an abstraction for monitoring and retrieving the -// results of a long-running operation. -type LoadBalancersListInboundNatRulePortMappingsFuture struct { +type LocalNetworkGatewaysCreateOrUpdateFuture struct { azure.FutureAPI // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. - Result func(LoadBalancersClient) (BackendAddressInboundNatRulePortMappings, error) + Result func(LocalNetworkGatewaysClient) (LocalNetworkGateway, error) } // UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *LoadBalancersListInboundNatRulePortMappingsFuture) UnmarshalJSON(body []byte) error { +func (future *LocalNetworkGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { var azFuture azure.Future if err := json.Unmarshal(body, &azFuture); err != nil { return err @@ -28596,40 +32891,40 @@ func (future *LoadBalancersListInboundNatRulePortMappingsFuture) UnmarshalJSON(b return nil } -// result is the default implementation for LoadBalancersListInboundNatRulePortMappingsFuture.Result. -func (future *LoadBalancersListInboundNatRulePortMappingsFuture) result(client LoadBalancersClient) (bainrpm BackendAddressInboundNatRulePortMappings, err error) { +// result is the default implementation for LocalNetworkGatewaysCreateOrUpdateFuture.Result. +func (future *LocalNetworkGatewaysCreateOrUpdateFuture) result(client LocalNetworkGatewaysClient) (lng LocalNetworkGateway, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersListInboundNatRulePortMappingsFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - bainrpm.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.LoadBalancersListInboundNatRulePortMappingsFuture") + lng.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.LocalNetworkGatewaysCreateOrUpdateFuture") return } sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if bainrpm.Response.Response, err = future.GetResult(sender); err == nil && bainrpm.Response.Response.StatusCode != http.StatusNoContent { - bainrpm, err = client.ListInboundNatRulePortMappingsResponder(bainrpm.Response.Response) + if lng.Response.Response, err = future.GetResult(sender); err == nil && lng.Response.Response.StatusCode != http.StatusNoContent { + lng, err = client.CreateOrUpdateResponder(lng.Response.Response) if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersListInboundNatRulePortMappingsFuture", "Result", bainrpm.Response.Response, "Failure responding to request") + err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysCreateOrUpdateFuture", "Result", lng.Response.Response, "Failure responding to request") } } return } -// LoadBalancersSwapPublicIPAddressesFuture an abstraction for monitoring and retrieving the results of a +// LocalNetworkGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a // long-running operation. -type LoadBalancersSwapPublicIPAddressesFuture struct { +type LocalNetworkGatewaysDeleteFuture struct { azure.FutureAPI // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. - Result func(LoadBalancersClient) (autorest.Response, error) + Result func(LocalNetworkGatewaysClient) (autorest.Response, error) } // UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *LoadBalancersSwapPublicIPAddressesFuture) UnmarshalJSON(body []byte) error { +func (future *LocalNetworkGatewaysDeleteFuture) UnmarshalJSON(body []byte) error { var azFuture azure.Future if err := json.Unmarshal(body, &azFuture); err != nil { return err @@ -28639,121 +32934,148 @@ func (future *LoadBalancersSwapPublicIPAddressesFuture) UnmarshalJSON(body []byt return nil } -// result is the default implementation for LoadBalancersSwapPublicIPAddressesFuture.Result. -func (future *LoadBalancersSwapPublicIPAddressesFuture) result(client LoadBalancersClient) (ar autorest.Response, err error) { +// result is the default implementation for LocalNetworkGatewaysDeleteFuture.Result. +func (future *LocalNetworkGatewaysDeleteFuture) result(client LocalNetworkGatewaysClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "network.LoadBalancersSwapPublicIPAddressesFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.LoadBalancersSwapPublicIPAddressesFuture") + err = azure.NewAsyncOpIncompleteError("network.LocalNetworkGatewaysDeleteFuture") return } ar.Response = future.Response() return } -// LoadBalancerVipSwapRequest the request for a VIP swap. -type LoadBalancerVipSwapRequest struct { - // FrontendIPConfigurations - A list of frontend IP configuration resources that should swap VIPs. - FrontendIPConfigurations *[]LoadBalancerVipSwapRequestFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` +// LogSpecification description of logging specification. +type LogSpecification struct { + // Name - The name of the specification. + Name *string `json:"name,omitempty"` + // DisplayName - The display name of the specification. + DisplayName *string `json:"displayName,omitempty"` + // BlobDuration - Duration of the blob. + BlobDuration *string `json:"blobDuration,omitempty"` } -// LoadBalancerVipSwapRequestFrontendIPConfiguration VIP swap request's frontend IP configuration object. -type LoadBalancerVipSwapRequestFrontendIPConfiguration struct { - // ID - The ID of frontend IP configuration resource. - ID *string `json:"id,omitempty"` - // LoadBalancerVipSwapRequestFrontendIPConfigurationProperties - The properties of VIP swap request's frontend IP configuration object. - *LoadBalancerVipSwapRequestFrontendIPConfigurationProperties `json:"properties,omitempty"` +// ManagedRuleGroupOverride defines a managed rule group override setting. +type ManagedRuleGroupOverride struct { + // RuleGroupName - The managed rule group to override. + RuleGroupName *string `json:"ruleGroupName,omitempty"` + // Rules - List of rules that will be disabled. If none specified, all rules in the group will be disabled. + Rules *[]ManagedRuleOverride `json:"rules,omitempty"` } -// MarshalJSON is the custom marshaler for LoadBalancerVipSwapRequestFrontendIPConfiguration. -func (lbvsrfic LoadBalancerVipSwapRequestFrontendIPConfiguration) MarshalJSON() ([]byte, error) { +// ManagedRuleOverride defines a managed rule group override setting. +type ManagedRuleOverride struct { + // RuleID - Identifier for the managed rule. + RuleID *string `json:"ruleId,omitempty"` + // State - The state of the managed rule. Defaults to Disabled if not specified. Possible values include: 'ManagedRuleEnabledStateDisabled', 'ManagedRuleEnabledStateEnabled' + State ManagedRuleEnabledState `json:"state,omitempty"` + // Action - Describes the override action to be applied when rule matches. Possible values include: 'ActionTypeAnomalyScoring', 'ActionTypeAllow', 'ActionTypeBlock', 'ActionTypeLog' + Action ActionType `json:"action,omitempty"` +} + +// ManagedRulesDefinition allow to exclude some variable satisfy the condition for the WAF check. +type ManagedRulesDefinition struct { + // Exclusions - The Exclusions that are applied on the policy. + Exclusions *[]OwaspCrsExclusionEntry `json:"exclusions,omitempty"` + // ManagedRuleSets - The managed rule sets that are associated with the policy. + ManagedRuleSets *[]ManagedRuleSet `json:"managedRuleSets,omitempty"` +} + +// ManagedRuleSet defines a managed rule set. +type ManagedRuleSet struct { + // RuleSetType - Defines the rule set type to use. + RuleSetType *string `json:"ruleSetType,omitempty"` + // RuleSetVersion - Defines the version of the rule set to use. + RuleSetVersion *string `json:"ruleSetVersion,omitempty"` + // RuleGroupOverrides - Defines the rule group overrides to apply to the rule set. + RuleGroupOverrides *[]ManagedRuleGroupOverride `json:"ruleGroupOverrides,omitempty"` +} + +// ManagedServiceIdentity identity for the resource. +type ManagedServiceIdentity struct { + // PrincipalID - READ-ONLY; The principal id of the system assigned identity. This property will only be provided for a system assigned identity. + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - READ-ONLY; The tenant id of the system assigned identity. This property will only be provided for a system assigned identity. + TenantID *string `json:"tenantId,omitempty"` + // Type - The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone' + Type ResourceIdentityType `json:"type,omitempty"` + // UserAssignedIdentities - The list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + UserAssignedIdentities map[string]*ManagedServiceIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` +} + +// MarshalJSON is the custom marshaler for ManagedServiceIdentity. +func (msi ManagedServiceIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if lbvsrfic.ID != nil { - objectMap["id"] = lbvsrfic.ID + if msi.Type != "" { + objectMap["type"] = msi.Type } - if lbvsrfic.LoadBalancerVipSwapRequestFrontendIPConfigurationProperties != nil { - objectMap["properties"] = lbvsrfic.LoadBalancerVipSwapRequestFrontendIPConfigurationProperties + if msi.UserAssignedIdentities != nil { + objectMap["userAssignedIdentities"] = msi.UserAssignedIdentities } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for LoadBalancerVipSwapRequestFrontendIPConfiguration struct. -func (lbvsrfic *LoadBalancerVipSwapRequestFrontendIPConfiguration) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - lbvsrfic.ID = &ID - } - case "properties": - if v != nil { - var loadBalancerVipSwapRequestFrontendIPConfigurationProperties LoadBalancerVipSwapRequestFrontendIPConfigurationProperties - err = json.Unmarshal(*v, &loadBalancerVipSwapRequestFrontendIPConfigurationProperties) - if err != nil { - return err - } - lbvsrfic.LoadBalancerVipSwapRequestFrontendIPConfigurationProperties = &loadBalancerVipSwapRequestFrontendIPConfigurationProperties - } - } - } - - return nil +// ManagedServiceIdentityUserAssignedIdentitiesValue ... +type ManagedServiceIdentityUserAssignedIdentitiesValue struct { + // PrincipalID - READ-ONLY; The principal id of user assigned identity. + PrincipalID *string `json:"principalId,omitempty"` + // ClientID - READ-ONLY; The client id of user assigned identity. + ClientID *string `json:"clientId,omitempty"` } -// LoadBalancerVipSwapRequestFrontendIPConfigurationProperties the properties of VIP swap request's -// frontend IP configuration object. -type LoadBalancerVipSwapRequestFrontendIPConfigurationProperties struct { - // PublicIPAddress - A reference to public IP address resource. - PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` +// MarshalJSON is the custom marshaler for ManagedServiceIdentityUserAssignedIdentitiesValue. +func (msiAiv ManagedServiceIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) } -// LoadBalancingRule a load balancing rule for a load balancer. -type LoadBalancingRule struct { +// Manager the Managed Network resource +type Manager struct { autorest.Response `json:"-"` - // LoadBalancingRulePropertiesFormat - Properties of load balancer load balancing rule. - *LoadBalancingRulePropertiesFormat `json:"properties,omitempty"` - // Name - The name of the resource that is unique within the set of load balancing rules used by the load balancer. This name can be used to access the resource. - Name *string `json:"name,omitempty"` + // ManagerProperties - The network manager properties + *ManagerProperties `json:"properties,omitempty"` // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. Etag *string `json:"etag,omitempty"` - // Type - READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty"` + // SystemData - READ-ONLY; The system metadata related to this resource. + SystemData *SystemData `json:"systemData,omitempty"` // ID - Resource ID. ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` } -// MarshalJSON is the custom marshaler for LoadBalancingRule. -func (lbr LoadBalancingRule) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for Manager. +func (mVar Manager) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if lbr.LoadBalancingRulePropertiesFormat != nil { - objectMap["properties"] = lbr.LoadBalancingRulePropertiesFormat + if mVar.ManagerProperties != nil { + objectMap["properties"] = mVar.ManagerProperties } - if lbr.Name != nil { - objectMap["name"] = lbr.Name + if mVar.ID != nil { + objectMap["id"] = mVar.ID } - if lbr.ID != nil { - objectMap["id"] = lbr.ID + if mVar.Location != nil { + objectMap["location"] = mVar.Location + } + if mVar.Tags != nil { + objectMap["tags"] = mVar.Tags } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for LoadBalancingRule struct. -func (lbr *LoadBalancingRule) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for Manager struct. +func (mVar *Manager) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -28763,30 +33085,48 @@ func (lbr *LoadBalancingRule) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var loadBalancingRulePropertiesFormat LoadBalancingRulePropertiesFormat - err = json.Unmarshal(*v, &loadBalancingRulePropertiesFormat) + var managerProperties ManagerProperties + err = json.Unmarshal(*v, &managerProperties) if err != nil { return err } - lbr.LoadBalancingRulePropertiesFormat = &loadBalancingRulePropertiesFormat + mVar.ManagerProperties = &managerProperties } - case "name": + case "etag": if v != nil { - var name string - err = json.Unmarshal(*v, &name) + var etag string + err = json.Unmarshal(*v, &etag) if err != nil { return err } - lbr.Name = &name + mVar.Etag = &etag } - case "etag": + case "systemData": if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) + var systemData SystemData + err = json.Unmarshal(*v, &systemData) if err != nil { return err } - lbr.Etag = &etag + mVar.SystemData = &systemData + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mVar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mVar.Name = &name } case "type": if v != nil { @@ -28795,16 +33135,25 @@ func (lbr *LoadBalancingRule) UnmarshalJSON(body []byte) error { if err != nil { return err } - lbr.Type = &typeVar + mVar.Type = &typeVar } - case "id": + case "location": if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) + var location string + err = json.Unmarshal(*v, &location) if err != nil { return err } - lbr.ID = &ID + mVar.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mVar.Tags = tags } } } @@ -28812,117 +33161,105 @@ func (lbr *LoadBalancingRule) UnmarshalJSON(body []byte) error { return nil } -// LoadBalancingRulePropertiesFormat properties of the load balancer. -type LoadBalancingRulePropertiesFormat struct { - // FrontendIPConfiguration - A reference to frontend IP addresses. - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - // BackendAddressPool - A reference to a pool of DIPs. Inbound traffic is randomly load balanced across IPs in the backend IPs. - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - // BackendAddressPools - An array of references to pool of DIPs. - BackendAddressPools *[]SubResource `json:"backendAddressPools,omitempty"` - // Probe - The reference to the load balancer probe used by the load balancing rule. - Probe *SubResource `json:"probe,omitempty"` - // Protocol - The reference to the transport protocol used by the load balancing rule. Possible values include: 'TransportProtocolUDP', 'TransportProtocolTCP', 'TransportProtocolAll' - Protocol TransportProtocol `json:"protocol,omitempty"` - // LoadDistribution - The load distribution policy for this rule. Possible values include: 'LoadDistributionDefault', 'LoadDistributionSourceIP', 'LoadDistributionSourceIPProtocol' - LoadDistribution LoadDistribution `json:"loadDistribution,omitempty"` - // FrontendPort - The port for the external endpoint. Port numbers for each rule must be unique within the Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables "Any Port". - FrontendPort *int32 `json:"frontendPort,omitempty"` - // BackendPort - The port used for internal connections on the endpoint. Acceptable values are between 0 and 65535. Note that value 0 enables "Any Port". - BackendPort *int32 `json:"backendPort,omitempty"` - // IdleTimeoutInMinutes - The timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP. - IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` - // EnableFloatingIP - Configures a virtual machine's endpoint for the floating IP capability required to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn Availability Groups in SQL server. This setting can't be changed after you create the endpoint. - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - // EnableTCPReset - Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP. - EnableTCPReset *bool `json:"enableTcpReset,omitempty"` - // DisableOutboundSnat - Configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing rule. - DisableOutboundSnat *bool `json:"disableOutboundSnat,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the load balancing rule resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' - ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +// ManagerCommit network Manager Commit. +type ManagerCommit struct { + autorest.Response `json:"-"` + // CommitID - READ-ONLY; Commit Id. + CommitID *string `json:"commitId,omitempty"` + // TargetLocations - List of target locations. + TargetLocations *[]string `json:"targetLocations,omitempty"` + // ConfigurationIds - List of configuration ids. + ConfigurationIds *[]string `json:"configurationIds,omitempty"` + // CommitType - Commit Type. Possible values include: 'SecurityAdmin', 'Connectivity' + CommitType ConfigurationType `json:"commitType,omitempty"` } -// MarshalJSON is the custom marshaler for LoadBalancingRulePropertiesFormat. -func (lbrpf LoadBalancingRulePropertiesFormat) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ManagerCommit. +func (mc ManagerCommit) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if lbrpf.FrontendIPConfiguration != nil { - objectMap["frontendIPConfiguration"] = lbrpf.FrontendIPConfiguration - } - if lbrpf.BackendAddressPool != nil { - objectMap["backendAddressPool"] = lbrpf.BackendAddressPool - } - if lbrpf.BackendAddressPools != nil { - objectMap["backendAddressPools"] = lbrpf.BackendAddressPools - } - if lbrpf.Probe != nil { - objectMap["probe"] = lbrpf.Probe - } - if lbrpf.Protocol != "" { - objectMap["protocol"] = lbrpf.Protocol - } - if lbrpf.LoadDistribution != "" { - objectMap["loadDistribution"] = lbrpf.LoadDistribution + if mc.TargetLocations != nil { + objectMap["targetLocations"] = mc.TargetLocations } - if lbrpf.FrontendPort != nil { - objectMap["frontendPort"] = lbrpf.FrontendPort + if mc.ConfigurationIds != nil { + objectMap["configurationIds"] = mc.ConfigurationIds } - if lbrpf.BackendPort != nil { - objectMap["backendPort"] = lbrpf.BackendPort + if mc.CommitType != "" { + objectMap["commitType"] = mc.CommitType } - if lbrpf.IdleTimeoutInMinutes != nil { - objectMap["idleTimeoutInMinutes"] = lbrpf.IdleTimeoutInMinutes + return json.Marshal(objectMap) +} + +// ManagerCommitsPostFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ManagerCommitsPostFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ManagerCommitsClient) (ManagerCommit, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ManagerCommitsPostFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err } - if lbrpf.EnableFloatingIP != nil { - objectMap["enableFloatingIP"] = lbrpf.EnableFloatingIP + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ManagerCommitsPostFuture.Result. +func (future *ManagerCommitsPostFuture) result(client ManagerCommitsClient) (mc ManagerCommit, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ManagerCommitsPostFuture", "Result", future.Response(), "Polling failure") + return } - if lbrpf.EnableTCPReset != nil { - objectMap["enableTcpReset"] = lbrpf.EnableTCPReset + if !done { + mc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.ManagerCommitsPostFuture") + return } - if lbrpf.DisableOutboundSnat != nil { - objectMap["disableOutboundSnat"] = lbrpf.DisableOutboundSnat + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mc.Response.Response, err = future.GetResult(sender); err == nil && mc.Response.Response.StatusCode != http.StatusNoContent { + mc, err = client.PostResponder(mc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ManagerCommitsPostFuture", "Result", mc.Response.Response, "Failure responding to request") + } } - return json.Marshal(objectMap) + return } -// LocalNetworkGateway a common class for general resource information. -type LocalNetworkGateway struct { +// ManagerConnection the Network Manager Connection resource +type ManagerConnection struct { autorest.Response `json:"-"` - // LocalNetworkGatewayPropertiesFormat - Properties of the local network gateway. - *LocalNetworkGatewayPropertiesFormat `json:"properties,omitempty"` - // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. - Etag *string `json:"etag,omitempty"` - // ID - Resource ID. + // ManagerConnectionProperties - The scope connection properties + *ManagerConnectionProperties `json:"properties,omitempty"` + // SystemData - READ-ONLY; The system metadata related to this resource. + SystemData *SystemData `json:"systemData,omitempty"` + // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type. Type *string `json:"type,omitempty"` - // Location - Resource location. - Location *string `json:"location,omitempty"` - // Tags - Resource tags. - Tags map[string]*string `json:"tags"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` } -// MarshalJSON is the custom marshaler for LocalNetworkGateway. -func (lng LocalNetworkGateway) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ManagerConnection. +func (mc ManagerConnection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if lng.LocalNetworkGatewayPropertiesFormat != nil { - objectMap["properties"] = lng.LocalNetworkGatewayPropertiesFormat - } - if lng.ID != nil { - objectMap["id"] = lng.ID - } - if lng.Location != nil { - objectMap["location"] = lng.Location - } - if lng.Tags != nil { - objectMap["tags"] = lng.Tags + if mc.ManagerConnectionProperties != nil { + objectMap["properties"] = mc.ManagerConnectionProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for LocalNetworkGateway struct. -func (lng *LocalNetworkGateway) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ManagerConnection struct. +func (mc *ManagerConnection) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -28932,21 +33269,21 @@ func (lng *LocalNetworkGateway) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var localNetworkGatewayPropertiesFormat LocalNetworkGatewayPropertiesFormat - err = json.Unmarshal(*v, &localNetworkGatewayPropertiesFormat) + var managerConnectionProperties ManagerConnectionProperties + err = json.Unmarshal(*v, &managerConnectionProperties) if err != nil { return err } - lng.LocalNetworkGatewayPropertiesFormat = &localNetworkGatewayPropertiesFormat + mc.ManagerConnectionProperties = &managerConnectionProperties } - case "etag": + case "systemData": if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) + var systemData SystemData + err = json.Unmarshal(*v, &systemData) if err != nil { return err } - lng.Etag = &etag + mc.SystemData = &systemData } case "id": if v != nil { @@ -28955,7 +33292,7 @@ func (lng *LocalNetworkGateway) UnmarshalJSON(body []byte) error { if err != nil { return err } - lng.ID = &ID + mc.ID = &ID } case "name": if v != nil { @@ -28964,7 +33301,7 @@ func (lng *LocalNetworkGateway) UnmarshalJSON(body []byte) error { if err != nil { return err } - lng.Name = &name + mc.Name = &name } case "type": if v != nil { @@ -28973,25 +33310,274 @@ func (lng *LocalNetworkGateway) UnmarshalJSON(body []byte) error { if err != nil { return err } - lng.Type = &typeVar + mc.Type = &typeVar } - case "location": + case "etag": if v != nil { - var location string - err = json.Unmarshal(*v, &location) + var etag string + err = json.Unmarshal(*v, &etag) if err != nil { return err } - lng.Location = &location + mc.Etag = &etag } - case "tags": + } + } + + return nil +} + +// ManagerConnectionListResult list of network manager connections. +type ManagerConnectionListResult struct { + autorest.Response `json:"-"` + // Value - List of network manager connections. + Value *[]ManagerConnection `json:"value,omitempty"` + // NextLink - Gets the URL to get the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ManagerConnectionListResultIterator provides access to a complete listing of ManagerConnection values. +type ManagerConnectionListResultIterator struct { + i int + page ManagerConnectionListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ManagerConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagerConnectionListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ManagerConnectionListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ManagerConnectionListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ManagerConnectionListResultIterator) Response() ManagerConnectionListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ManagerConnectionListResultIterator) Value() ManagerConnection { + if !iter.page.NotDone() { + return ManagerConnection{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ManagerConnectionListResultIterator type. +func NewManagerConnectionListResultIterator(page ManagerConnectionListResultPage) ManagerConnectionListResultIterator { + return ManagerConnectionListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (mclr ManagerConnectionListResult) IsEmpty() bool { + return mclr.Value == nil || len(*mclr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (mclr ManagerConnectionListResult) hasNextLink() bool { + return mclr.NextLink != nil && len(*mclr.NextLink) != 0 +} + +// managerConnectionListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mclr ManagerConnectionListResult) managerConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { + if !mclr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mclr.NextLink))) +} + +// ManagerConnectionListResultPage contains a page of ManagerConnection values. +type ManagerConnectionListResultPage struct { + fn func(context.Context, ManagerConnectionListResult) (ManagerConnectionListResult, error) + mclr ManagerConnectionListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ManagerConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagerConnectionListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.mclr) + if err != nil { + return err + } + page.mclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ManagerConnectionListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ManagerConnectionListResultPage) NotDone() bool { + return !page.mclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ManagerConnectionListResultPage) Response() ManagerConnectionListResult { + return page.mclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ManagerConnectionListResultPage) Values() []ManagerConnection { + if page.mclr.IsEmpty() { + return nil + } + return *page.mclr.Value +} + +// Creates a new instance of the ManagerConnectionListResultPage type. +func NewManagerConnectionListResultPage(cur ManagerConnectionListResult, getNextPage func(context.Context, ManagerConnectionListResult) (ManagerConnectionListResult, error)) ManagerConnectionListResultPage { + return ManagerConnectionListResultPage{ + fn: getNextPage, + mclr: cur, + } +} + +// ManagerConnectionProperties information about the network manager connection. +type ManagerConnectionProperties struct { + // NetworkManagerID - Network Manager Id. + NetworkManagerID *string `json:"networkManagerId,omitempty"` + // ConnectionState - Connection state. Possible values include: 'ScopeConnectionStateConnected', 'ScopeConnectionStatePending', 'ScopeConnectionStateConflict', 'ScopeConnectionStateRevoked', 'ScopeConnectionStateRejected' + ConnectionState ScopeConnectionState `json:"connectionState,omitempty"` + // Description - A description of the network manager connection. + Description *string `json:"description,omitempty"` +} + +// ManagerDeploymentStatus network Manager Deployment Status. +type ManagerDeploymentStatus struct { + // CommitTime - Commit Time. + CommitTime *date.Time `json:"commitTime,omitempty"` + // Region - Region Name. + Region *string `json:"region,omitempty"` + // DeploymentStatus - Deployment Status. Possible values include: 'NotStarted', 'Deploying', 'Deployed', 'Failed' + DeploymentStatus DeploymentStatus `json:"deploymentStatus,omitempty"` + // ConfigurationIds - List of configuration ids. + ConfigurationIds *[]string `json:"configurationIds,omitempty"` + // DeploymentType - Possible values include: 'SecurityAdmin', 'Connectivity' + DeploymentType ConfigurationType `json:"deploymentType,omitempty"` + // ErrorMessage - Error Message. + ErrorMessage *string `json:"errorMessage,omitempty"` +} + +// ManagerDeploymentStatusListResult a list of Network Manager Deployment Status +type ManagerDeploymentStatusListResult struct { + autorest.Response `json:"-"` + // Value - Gets a page of Network Manager Deployment Status + Value *[]ManagerDeploymentStatus `json:"value,omitempty"` + // SkipToken - When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current request) to retrieve the next page of data. + SkipToken *string `json:"skipToken,omitempty"` +} + +// ManagerDeploymentStatusParameter network Manager Deployment Status Parameter. +type ManagerDeploymentStatusParameter struct { + // Regions - List of locations. + Regions *[]string `json:"regions,omitempty"` + // DeploymentTypes - List of deployment types. + DeploymentTypes *[]ConfigurationType `json:"deploymentTypes,omitempty"` + // SkipToken - Continuation token for pagination, capturing the next page size and offset, as well as the context of the query. + SkipToken *string `json:"skipToken,omitempty"` +} + +// ManagerEffectiveConnectivityConfigurationListResult result of the request to list +// networkManagerEffectiveConnectivityConfiguration. It contains a list of groups and a skiptoken to get +// the next set of results. +type ManagerEffectiveConnectivityConfigurationListResult struct { + autorest.Response `json:"-"` + // Value - Gets a page of NetworkManagerEffectiveConnectivityConfiguration + Value *[]EffectiveConnectivityConfiguration `json:"value,omitempty"` + // SkipToken - When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current request) to retrieve the next page of data. + SkipToken *string `json:"skipToken,omitempty"` +} + +// ManagerEffectiveSecurityAdminRulesListResult result of the request to list +// networkManagerEffectiveSecurityAdminRules. It contains a list of groups and a skiptoken to get the next +// set of results. +type ManagerEffectiveSecurityAdminRulesListResult struct { + autorest.Response `json:"-"` + // Value - Gets a page of NetworkManagerEffectiveSecurityAdminRules + Value *[]BasicEffectiveBaseSecurityAdminRule `json:"value,omitempty"` + // SkipToken - When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current request) to retrieve the next page of data. + SkipToken *string `json:"skipToken,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ManagerEffectiveSecurityAdminRulesListResult struct. +func (mesarlr *ManagerEffectiveSecurityAdminRulesListResult) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "value": if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) + value, err := unmarshalBasicEffectiveBaseSecurityAdminRuleArray(*v) if err != nil { return err } - lng.Tags = tags + mesarlr.Value = &value + } + case "skipToken": + if v != nil { + var skipToken string + err = json.Unmarshal(*v, &skipToken) + if err != nil { + return err + } + mesarlr.SkipToken = &skipToken } } } @@ -28999,36 +33585,27 @@ func (lng *LocalNetworkGateway) UnmarshalJSON(body []byte) error { return nil } -// LocalNetworkGatewayListResult response for ListLocalNetworkGateways API service call. -type LocalNetworkGatewayListResult struct { +// ManagerListResult result of the request to list NetworkManager. It contains a list of network managers +// and a URL link to get the next set of results. +type ManagerListResult struct { autorest.Response `json:"-"` - // Value - A list of local network gateways that exists in a resource group. - Value *[]LocalNetworkGateway `json:"value,omitempty"` - // NextLink - READ-ONLY; The URL to get the next set of results. + // Value - Gets a page of NetworkManager + Value *[]Manager `json:"value,omitempty"` + // NextLink - Gets the URL to get the next page of results. NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for LocalNetworkGatewayListResult. -func (lnglr LocalNetworkGatewayListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lnglr.Value != nil { - objectMap["value"] = lnglr.Value - } - return json.Marshal(objectMap) -} - -// LocalNetworkGatewayListResultIterator provides access to a complete listing of LocalNetworkGateway -// values. -type LocalNetworkGatewayListResultIterator struct { +// ManagerListResultIterator provides access to a complete listing of Manager values. +type ManagerListResultIterator struct { i int - page LocalNetworkGatewayListResultPage + page ManagerListResultPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *LocalNetworkGatewayListResultIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *ManagerListResultIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LocalNetworkGatewayListResultIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ManagerListResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -29053,67 +33630,67 @@ func (iter *LocalNetworkGatewayListResultIterator) NextWithContext(ctx context.C // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *LocalNetworkGatewayListResultIterator) Next() error { +func (iter *ManagerListResultIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter LocalNetworkGatewayListResultIterator) NotDone() bool { +func (iter ManagerListResultIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter LocalNetworkGatewayListResultIterator) Response() LocalNetworkGatewayListResult { +func (iter ManagerListResultIterator) Response() ManagerListResult { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter LocalNetworkGatewayListResultIterator) Value() LocalNetworkGateway { +func (iter ManagerListResultIterator) Value() Manager { if !iter.page.NotDone() { - return LocalNetworkGateway{} + return Manager{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the LocalNetworkGatewayListResultIterator type. -func NewLocalNetworkGatewayListResultIterator(page LocalNetworkGatewayListResultPage) LocalNetworkGatewayListResultIterator { - return LocalNetworkGatewayListResultIterator{page: page} +// Creates a new instance of the ManagerListResultIterator type. +func NewManagerListResultIterator(page ManagerListResultPage) ManagerListResultIterator { + return ManagerListResultIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (lnglr LocalNetworkGatewayListResult) IsEmpty() bool { - return lnglr.Value == nil || len(*lnglr.Value) == 0 +func (mlr ManagerListResult) IsEmpty() bool { + return mlr.Value == nil || len(*mlr.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (lnglr LocalNetworkGatewayListResult) hasNextLink() bool { - return lnglr.NextLink != nil && len(*lnglr.NextLink) != 0 +func (mlr ManagerListResult) hasNextLink() bool { + return mlr.NextLink != nil && len(*mlr.NextLink) != 0 } -// localNetworkGatewayListResultPreparer prepares a request to retrieve the next set of results. +// managerListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (lnglr LocalNetworkGatewayListResult) localNetworkGatewayListResultPreparer(ctx context.Context) (*http.Request, error) { - if !lnglr.hasNextLink() { +func (mlr ManagerListResult) managerListResultPreparer(ctx context.Context) (*http.Request, error) { + if !mlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(lnglr.NextLink))) + autorest.WithBaseURL(to.String(mlr.NextLink))) } -// LocalNetworkGatewayListResultPage contains a page of LocalNetworkGateway values. -type LocalNetworkGatewayListResultPage struct { - fn func(context.Context, LocalNetworkGatewayListResult) (LocalNetworkGatewayListResult, error) - lnglr LocalNetworkGatewayListResult +// ManagerListResultPage contains a page of Manager values. +type ManagerListResultPage struct { + fn func(context.Context, ManagerListResult) (ManagerListResult, error) + mlr ManagerListResult } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *LocalNetworkGatewayListResultPage) NextWithContext(ctx context.Context) (err error) { +func (page *ManagerListResultPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LocalNetworkGatewayListResultPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ManagerListResultPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -29123,11 +33700,11 @@ func (page *LocalNetworkGatewayListResultPage) NextWithContext(ctx context.Conte }() } for { - next, err := page.fn(ctx, page.lnglr) + next, err := page.fn(ctx, page.mlr) if err != nil { return err } - page.lnglr = next + page.mlr = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -29138,124 +33715,96 @@ func (page *LocalNetworkGatewayListResultPage) NextWithContext(ctx context.Conte // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *LocalNetworkGatewayListResultPage) Next() error { +func (page *ManagerListResultPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page LocalNetworkGatewayListResultPage) NotDone() bool { - return !page.lnglr.IsEmpty() +func (page ManagerListResultPage) NotDone() bool { + return !page.mlr.IsEmpty() } // Response returns the raw server response from the last page request. -func (page LocalNetworkGatewayListResultPage) Response() LocalNetworkGatewayListResult { - return page.lnglr +func (page ManagerListResultPage) Response() ManagerListResult { + return page.mlr } // Values returns the slice of values for the current page or nil if there are no values. -func (page LocalNetworkGatewayListResultPage) Values() []LocalNetworkGateway { - if page.lnglr.IsEmpty() { +func (page ManagerListResultPage) Values() []Manager { + if page.mlr.IsEmpty() { return nil } - return *page.lnglr.Value + return *page.mlr.Value } -// Creates a new instance of the LocalNetworkGatewayListResultPage type. -func NewLocalNetworkGatewayListResultPage(cur LocalNetworkGatewayListResult, getNextPage func(context.Context, LocalNetworkGatewayListResult) (LocalNetworkGatewayListResult, error)) LocalNetworkGatewayListResultPage { - return LocalNetworkGatewayListResultPage{ - fn: getNextPage, - lnglr: cur, +// Creates a new instance of the ManagerListResultPage type. +func NewManagerListResultPage(cur ManagerListResult, getNextPage func(context.Context, ManagerListResult) (ManagerListResult, error)) ManagerListResultPage { + return ManagerListResultPage{ + fn: getNextPage, + mlr: cur, } } -// LocalNetworkGatewayPropertiesFormat localNetworkGateway properties. -type LocalNetworkGatewayPropertiesFormat struct { - // LocalNetworkAddressSpace - Local network site address space. - LocalNetworkAddressSpace *AddressSpace `json:"localNetworkAddressSpace,omitempty"` - // GatewayIPAddress - IP address of local network gateway. - GatewayIPAddress *string `json:"gatewayIpAddress,omitempty"` - // Fqdn - FQDN of local network gateway. - Fqdn *string `json:"fqdn,omitempty"` - // BgpSettings - Local network gateway's BGP speaker settings. - BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` - // ResourceGUID - READ-ONLY; The resource GUID property of the local network gateway resource. - ResourceGUID *string `json:"resourceGuid,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the local network gateway resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' +// ManagerProperties properties of Managed Network +type ManagerProperties struct { + // Description - A description of the network manager. + Description *string `json:"description,omitempty"` + // NetworkManagerScopes - Scope of Network Manager. + NetworkManagerScopes *ManagerPropertiesNetworkManagerScopes `json:"networkManagerScopes,omitempty"` + // NetworkManagerScopeAccesses - Scope Access. + NetworkManagerScopeAccesses *[]ConfigurationType `json:"networkManagerScopeAccesses,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the network manager resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } -// MarshalJSON is the custom marshaler for LocalNetworkGatewayPropertiesFormat. -func (lngpf LocalNetworkGatewayPropertiesFormat) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ManagerProperties. +func (mp ManagerProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if lngpf.LocalNetworkAddressSpace != nil { - objectMap["localNetworkAddressSpace"] = lngpf.LocalNetworkAddressSpace + if mp.Description != nil { + objectMap["description"] = mp.Description } - if lngpf.GatewayIPAddress != nil { - objectMap["gatewayIpAddress"] = lngpf.GatewayIPAddress - } - if lngpf.Fqdn != nil { - objectMap["fqdn"] = lngpf.Fqdn + if mp.NetworkManagerScopes != nil { + objectMap["networkManagerScopes"] = mp.NetworkManagerScopes } - if lngpf.BgpSettings != nil { - objectMap["bgpSettings"] = lngpf.BgpSettings + if mp.NetworkManagerScopeAccesses != nil { + objectMap["networkManagerScopeAccesses"] = mp.NetworkManagerScopeAccesses } return json.Marshal(objectMap) } -// LocalNetworkGatewaysCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type LocalNetworkGatewaysCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(LocalNetworkGatewaysClient) (LocalNetworkGateway, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *LocalNetworkGatewaysCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil +// ManagerPropertiesNetworkManagerScopes scope of Network Manager. +type ManagerPropertiesNetworkManagerScopes struct { + // ManagementGroups - List of management groups. + ManagementGroups *[]string `json:"managementGroups,omitempty"` + // Subscriptions - List of subscriptions. + Subscriptions *[]string `json:"subscriptions,omitempty"` + // CrossTenantScopes - READ-ONLY; List of cross tenant scopes. + CrossTenantScopes *[]CrossTenantScopes `json:"crossTenantScopes,omitempty"` } -// result is the default implementation for LocalNetworkGatewaysCreateOrUpdateFuture.Result. -func (future *LocalNetworkGatewaysCreateOrUpdateFuture) result(client LocalNetworkGatewaysClient) (lng LocalNetworkGateway, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - lng.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.LocalNetworkGatewaysCreateOrUpdateFuture") - return +// MarshalJSON is the custom marshaler for ManagerPropertiesNetworkManagerScopes. +func (mpMs ManagerPropertiesNetworkManagerScopes) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mpMs.ManagementGroups != nil { + objectMap["managementGroups"] = mpMs.ManagementGroups } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if lng.Response.Response, err = future.GetResult(sender); err == nil && lng.Response.Response.StatusCode != http.StatusNoContent { - lng, err = client.CreateOrUpdateResponder(lng.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysCreateOrUpdateFuture", "Result", lng.Response.Response, "Failure responding to request") - } + if mpMs.Subscriptions != nil { + objectMap["subscriptions"] = mpMs.Subscriptions } - return + return json.Marshal(objectMap) } -// LocalNetworkGatewaysDeleteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type LocalNetworkGatewaysDeleteFuture struct { +// ManagersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ManagersDeleteFuture struct { azure.FutureAPI // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. - Result func(LocalNetworkGatewaysClient) (autorest.Response, error) + Result func(ManagersClient) (autorest.Response, error) } // UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *LocalNetworkGatewaysDeleteFuture) UnmarshalJSON(body []byte) error { +func (future *ManagersDeleteFuture) UnmarshalJSON(body []byte) error { var azFuture azure.Future if err := json.Unmarshal(body, &azFuture); err != nil { return err @@ -29265,110 +33814,34 @@ func (future *LocalNetworkGatewaysDeleteFuture) UnmarshalJSON(body []byte) error return nil } -// result is the default implementation for LocalNetworkGatewaysDeleteFuture.Result. -func (future *LocalNetworkGatewaysDeleteFuture) result(client LocalNetworkGatewaysClient) (ar autorest.Response, err error) { +// result is the default implementation for ManagersDeleteFuture.Result. +func (future *ManagersDeleteFuture) result(client ManagersClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysDeleteFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "network.ManagersDeleteFuture", "Result", future.Response(), "Polling failure") return } if !done { ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("network.LocalNetworkGatewaysDeleteFuture") + err = azure.NewAsyncOpIncompleteError("network.ManagersDeleteFuture") return } ar.Response = future.Response() return } -// LogSpecification description of logging specification. -type LogSpecification struct { - // Name - The name of the specification. - Name *string `json:"name,omitempty"` - // DisplayName - The display name of the specification. - DisplayName *string `json:"displayName,omitempty"` - // BlobDuration - Duration of the blob. - BlobDuration *string `json:"blobDuration,omitempty"` -} - -// ManagedRuleGroupOverride defines a managed rule group override setting. -type ManagedRuleGroupOverride struct { - // RuleGroupName - The managed rule group to override. - RuleGroupName *string `json:"ruleGroupName,omitempty"` - // Rules - List of rules that will be disabled. If none specified, all rules in the group will be disabled. - Rules *[]ManagedRuleOverride `json:"rules,omitempty"` -} - -// ManagedRuleOverride defines a managed rule group override setting. -type ManagedRuleOverride struct { - // RuleID - Identifier for the managed rule. - RuleID *string `json:"ruleId,omitempty"` - // State - The state of the managed rule. Defaults to Disabled if not specified. Possible values include: 'ManagedRuleEnabledStateDisabled' - State ManagedRuleEnabledState `json:"state,omitempty"` -} - -// ManagedRulesDefinition allow to exclude some variable satisfy the condition for the WAF check. -type ManagedRulesDefinition struct { - // Exclusions - The Exclusions that are applied on the policy. - Exclusions *[]OwaspCrsExclusionEntry `json:"exclusions,omitempty"` - // ManagedRuleSets - The managed rule sets that are associated with the policy. - ManagedRuleSets *[]ManagedRuleSet `json:"managedRuleSets,omitempty"` -} - -// ManagedRuleSet defines a managed rule set. -type ManagedRuleSet struct { - // RuleSetType - Defines the rule set type to use. - RuleSetType *string `json:"ruleSetType,omitempty"` - // RuleSetVersion - Defines the version of the rule set to use. - RuleSetVersion *string `json:"ruleSetVersion,omitempty"` - // RuleGroupOverrides - Defines the rule group overrides to apply to the rule set. - RuleGroupOverrides *[]ManagedRuleGroupOverride `json:"ruleGroupOverrides,omitempty"` -} - -// ManagedServiceIdentity identity for the resource. -type ManagedServiceIdentity struct { - // PrincipalID - READ-ONLY; The principal id of the system assigned identity. This property will only be provided for a system assigned identity. - PrincipalID *string `json:"principalId,omitempty"` - // TenantID - READ-ONLY; The tenant id of the system assigned identity. This property will only be provided for a system assigned identity. - TenantID *string `json:"tenantId,omitempty"` - // Type - The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone' - Type ResourceIdentityType `json:"type,omitempty"` - // UserAssignedIdentities - The list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - UserAssignedIdentities map[string]*ManagedServiceIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` -} - -// MarshalJSON is the custom marshaler for ManagedServiceIdentity. -func (msi ManagedServiceIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if msi.Type != "" { - objectMap["type"] = msi.Type - } - if msi.UserAssignedIdentities != nil { - objectMap["userAssignedIdentities"] = msi.UserAssignedIdentities - } - return json.Marshal(objectMap) -} - -// ManagedServiceIdentityUserAssignedIdentitiesValue ... -type ManagedServiceIdentityUserAssignedIdentitiesValue struct { - // PrincipalID - READ-ONLY; The principal id of user assigned identity. - PrincipalID *string `json:"principalId,omitempty"` - // ClientID - READ-ONLY; The client id of user assigned identity. - ClientID *string `json:"clientId,omitempty"` -} - -// MarshalJSON is the custom marshaler for ManagedServiceIdentityUserAssignedIdentitiesValue. -func (msiAiv ManagedServiceIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) +// ManagerSecurityGroupItem network manager security group item. +type ManagerSecurityGroupItem struct { + // NetworkGroupID - Network manager group Id. + NetworkGroupID *string `json:"networkGroupId,omitempty"` } // MatchCondition define match conditions. type MatchCondition struct { // MatchVariables - List of match variables. MatchVariables *[]MatchVariable `json:"matchVariables,omitempty"` - // Operator - The operator to be matched. Possible values include: 'WebApplicationFirewallOperatorIPMatch', 'WebApplicationFirewallOperatorEqual', 'WebApplicationFirewallOperatorContains', 'WebApplicationFirewallOperatorLessThan', 'WebApplicationFirewallOperatorGreaterThan', 'WebApplicationFirewallOperatorLessThanOrEqual', 'WebApplicationFirewallOperatorGreaterThanOrEqual', 'WebApplicationFirewallOperatorBeginsWith', 'WebApplicationFirewallOperatorEndsWith', 'WebApplicationFirewallOperatorRegex', 'WebApplicationFirewallOperatorGeoMatch' + // Operator - The operator to be matched. Possible values include: 'WebApplicationFirewallOperatorIPMatch', 'WebApplicationFirewallOperatorEqual', 'WebApplicationFirewallOperatorContains', 'WebApplicationFirewallOperatorLessThan', 'WebApplicationFirewallOperatorGreaterThan', 'WebApplicationFirewallOperatorLessThanOrEqual', 'WebApplicationFirewallOperatorGreaterThanOrEqual', 'WebApplicationFirewallOperatorBeginsWith', 'WebApplicationFirewallOperatorEndsWith', 'WebApplicationFirewallOperatorRegex', 'WebApplicationFirewallOperatorGeoMatch', 'WebApplicationFirewallOperatorAny' Operator WebApplicationFirewallOperator `json:"operator,omitempty"` // NegationConditon - Whether this is negate condition or not. NegationConditon *bool `json:"negationConditon,omitempty"` @@ -29388,7 +33861,7 @@ type MatchedRule struct { // MatchVariable define match variables. type MatchVariable struct { - // VariableName - Match Variable. Possible values include: 'WebApplicationFirewallMatchVariableRemoteAddr', 'WebApplicationFirewallMatchVariableRequestMethod', 'WebApplicationFirewallMatchVariableQueryString', 'WebApplicationFirewallMatchVariablePostArgs', 'WebApplicationFirewallMatchVariableRequestURI', 'WebApplicationFirewallMatchVariableRequestHeaders', 'WebApplicationFirewallMatchVariableRequestBody', 'WebApplicationFirewallMatchVariableRequestCookies' + // VariableName - Match Variable. Possible values include: 'RemoteAddr', 'RequestMethod', 'QueryString', 'PostArgs', 'RequestURI', 'RequestHeaders', 'RequestBody', 'RequestCookies' VariableName WebApplicationFirewallMatchVariable `json:"variableName,omitempty"` // Selector - The selector of match variable. Selector *string `json:"selector,omitempty"` @@ -30342,7 +34815,7 @@ type OperationPropertiesFormatServiceSpecification struct { type OrderBy struct { // Field - Describes the actual column name to sort by Field *string `json:"field,omitempty"` - // Order - Describes if results should be in ascending/descending order. Possible values include: 'FirewallPolicyIDPSQuerySortOrderAscending', 'FirewallPolicyIDPSQuerySortOrderDescending' + // Order - Describes if results should be in ascending/descending order. Possible values include: 'Ascending', 'Descending' Order FirewallPolicyIDPSQuerySortOrder `json:"order,omitempty"` } @@ -30480,7 +34953,7 @@ func (orpf OutboundRulePropertiesFormat) MarshalJSON() ([]byte, error) { // OwaspCrsExclusionEntry allow to exclude some variable satisfy the condition for the WAF check. type OwaspCrsExclusionEntry struct { - // MatchVariable - The variable to be excluded. Possible values include: 'OwaspCrsExclusionEntryMatchVariableRequestHeaderNames', 'OwaspCrsExclusionEntryMatchVariableRequestCookieNames', 'OwaspCrsExclusionEntryMatchVariableRequestArgNames', 'OwaspCrsExclusionEntryMatchVariableRequestHeaderKeys', 'OwaspCrsExclusionEntryMatchVariableRequestHeaderValues', 'OwaspCrsExclusionEntryMatchVariableRequestCookieKeys', 'OwaspCrsExclusionEntryMatchVariableRequestCookieValues', 'OwaspCrsExclusionEntryMatchVariableRequestArgKeys', 'OwaspCrsExclusionEntryMatchVariableRequestArgValues' + // MatchVariable - The variable to be excluded. Possible values include: 'RequestHeaderNames', 'RequestCookieNames', 'RequestArgNames', 'RequestHeaderKeys', 'RequestHeaderValues', 'RequestCookieKeys', 'RequestCookieValues', 'RequestArgKeys', 'RequestArgValues' MatchVariable OwaspCrsExclusionEntryMatchVariable `json:"matchVariable,omitempty"` // SelectorMatchOperator - When matchVariable is a collection, operate on the selector to specify which elements in the collection this exclusion applies to. Possible values include: 'OwaspCrsExclusionEntrySelectorMatchOperatorEquals', 'OwaspCrsExclusionEntrySelectorMatchOperatorContains', 'OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith', 'OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith', 'OwaspCrsExclusionEntrySelectorMatchOperatorEqualsAny' SelectorMatchOperator OwaspCrsExclusionEntrySelectorMatchOperator `json:"selectorMatchOperator,omitempty"` @@ -31113,7 +35586,7 @@ func (future *P2sVpnGatewaysUpdateTagsFuture) result(client P2sVpnGatewaysClient // P2SVpnProfileParameters vpn Client Parameters for package generation. type P2SVpnProfileParameters struct { - // AuthenticationMethod - VPN client authentication method. Possible values include: 'AuthenticationMethodEAPTLS', 'AuthenticationMethodEAPMSCHAPv2' + // AuthenticationMethod - VPN client authentication method. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' AuthenticationMethod AuthenticationMethod `json:"authenticationMethod,omitempty"` } @@ -31177,10 +35650,24 @@ type PacketCaptureListResult struct { Value *[]PacketCaptureResult `json:"value,omitempty"` } +// PacketCaptureMachineScope a list of AzureVMSS instances which can be included or excluded to run packet +// capture. If both included and excluded are empty, then the packet capture will run on all instances of +// AzureVMSS. +type PacketCaptureMachineScope struct { + // Include - List of AzureVMSS instances to run packet capture on. + Include *[]string `json:"include,omitempty"` + // Exclude - List of AzureVMSS instances which has to be excluded from the AzureVMSS from running packet capture. + Exclude *[]string `json:"exclude,omitempty"` +} + // PacketCaptureParameters parameters that define the create packet capture operation. type PacketCaptureParameters struct { - // Target - The ID of the targeted resource, only VM is currently supported. + // Target - The ID of the targeted resource, only AzureVM and AzureVMSS as target type are currently supported. Target *string `json:"target,omitempty"` + // Scope - A list of AzureVMSS instances which can be included or excluded to run packet capture. If both included and excluded are empty, then the packet capture will run on all instances of AzureVMSS. + Scope *PacketCaptureMachineScope `json:"scope,omitempty"` + // TargetType - Target type of the resource provided. Possible values include: 'PacketCaptureTargetTypeAzureVM', 'PacketCaptureTargetTypeAzureVMSS' + TargetType PacketCaptureTargetType `json:"targetType,omitempty"` // BytesToCapturePerPacket - Number of bytes captured per packet, the remaining bytes are truncated. BytesToCapturePerPacket *int64 `json:"bytesToCapturePerPacket,omitempty"` // TotalBytesPerSession - Maximum size of the capture output. @@ -31287,8 +35774,12 @@ func (pcr *PacketCaptureResult) UnmarshalJSON(body []byte) error { type PacketCaptureResultProperties struct { // ProvisioningState - READ-ONLY; The provisioning state of the packet capture session. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // Target - The ID of the targeted resource, only VM is currently supported. + // Target - The ID of the targeted resource, only AzureVM and AzureVMSS as target type are currently supported. Target *string `json:"target,omitempty"` + // Scope - A list of AzureVMSS instances which can be included or excluded to run packet capture. If both included and excluded are empty, then the packet capture will run on all instances of AzureVMSS. + Scope *PacketCaptureMachineScope `json:"scope,omitempty"` + // TargetType - Target type of the resource provided. Possible values include: 'PacketCaptureTargetTypeAzureVM', 'PacketCaptureTargetTypeAzureVMSS' + TargetType PacketCaptureTargetType `json:"targetType,omitempty"` // BytesToCapturePerPacket - Number of bytes captured per packet, the remaining bytes are truncated. BytesToCapturePerPacket *int64 `json:"bytesToCapturePerPacket,omitempty"` // TotalBytesPerSession - Maximum size of the capture output. @@ -31307,6 +35798,12 @@ func (pcrp PacketCaptureResultProperties) MarshalJSON() ([]byte, error) { if pcrp.Target != nil { objectMap["target"] = pcrp.Target } + if pcrp.Scope != nil { + objectMap["scope"] = pcrp.Scope + } + if pcrp.TargetType != "" { + objectMap["targetType"] = pcrp.TargetType + } if pcrp.BytesToCapturePerPacket != nil { objectMap["bytesToCapturePerPacket"] = pcrp.BytesToCapturePerPacket } @@ -31495,6 +35992,47 @@ type PacketCaptureStorageLocation struct { FilePath *string `json:"filePath,omitempty"` } +// Parameter parameters for an Action. +type Parameter struct { + // RoutePrefix - List of route prefixes. + RoutePrefix *[]string `json:"routePrefix,omitempty"` + // Community - List of BGP communities. + Community *[]string `json:"community,omitempty"` + // AsPath - List of AS paths. + AsPath *[]string `json:"asPath,omitempty"` +} + +// PartnerManagedResourceProperties properties of the partner managed resource. +type PartnerManagedResourceProperties struct { + // ID - READ-ONLY; The partner managed resource id. + ID *string `json:"id,omitempty"` + // InternalLoadBalancerID - READ-ONLY; The partner managed ILB resource id + InternalLoadBalancerID *string `json:"internalLoadBalancerId,omitempty"` + // StandardLoadBalancerID - READ-ONLY; The partner managed SLB resource id + StandardLoadBalancerID *string `json:"standardLoadBalancerId,omitempty"` +} + +// MarshalJSON is the custom marshaler for PartnerManagedResourceProperties. +func (pmrp PartnerManagedResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PatchObject object for patch operations. +type PatchObject struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for PatchObject. +func (po PatchObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if po.Tags != nil { + objectMap["tags"] = po.Tags + } + return json.Marshal(objectMap) +} + // PatchRouteFilter route Filter Resource. type PatchRouteFilter struct { // RouteFilterPropertiesFormat - Properties of the route filter. @@ -31933,7 +36471,7 @@ type PeerExpressRouteCircuitConnectionPropertiesFormat struct { PeerExpressRouteCircuitPeering *SubResource `json:"peerExpressRouteCircuitPeering,omitempty"` // AddressPrefix - /29 IP address space to carve out Customer addresses for tunnels. AddressPrefix *string `json:"addressPrefix,omitempty"` - // CircuitConnectionStatus - Express Route Circuit connection state. Possible values include: 'CircuitConnectionStatusConnected', 'CircuitConnectionStatusConnecting', 'CircuitConnectionStatusDisconnected' + // CircuitConnectionStatus - Express Route Circuit connection state. Possible values include: 'Connected', 'Connecting', 'Disconnected' CircuitConnectionStatus CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` // ConnectionName - The name of the express route circuit connection resource. ConnectionName *string `json:"connectionName,omitempty"` @@ -32010,6 +36548,10 @@ type PolicySettings struct { MaxRequestBodySizeInKb *int32 `json:"maxRequestBodySizeInKb,omitempty"` // FileUploadLimitInMb - Maximum file upload size in Mb for WAF. FileUploadLimitInMb *int32 `json:"fileUploadLimitInMb,omitempty"` + // CustomBlockResponseStatusCode - If the action type is block, customer can override the response status code. + CustomBlockResponseStatusCode *int32 `json:"customBlockResponseStatusCode,omitempty"` + // CustomBlockResponseBody - If the action type is block, customer can override the response body. The body must be specified in base64 encoding. + CustomBlockResponseBody *string `json:"customBlockResponseBody,omitempty"` } // PrepareNetworkPoliciesRequest details of PrepareNetworkPolicies for Subnet. @@ -33580,7 +38122,7 @@ func (plsic *PrivateLinkServiceIPConfiguration) UnmarshalJSON(body []byte) error type PrivateLinkServiceIPConfigurationProperties struct { // PrivateIPAddress - The private IP address of the IP configuration. PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'IPAllocationMethodStatic', 'IPAllocationMethodDynamic' + // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'Static', 'Dynamic' PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` // Subnet - The reference to the subnet resource. Subnet *Subnet `json:"subnet,omitempty"` @@ -33588,7 +38130,7 @@ type PrivateLinkServiceIPConfigurationProperties struct { Primary *bool `json:"primary,omitempty"` // ProvisioningState - READ-ONLY; The provisioning state of the private link service IP configuration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // PrivateIPAddressVersion - Whether the specific IP configuration is IPv4 or IPv6. Default is IPv4. Possible values include: 'IPVersionIPv4', 'IPVersionIPv6' + // PrivateIPAddressVersion - Whether the specific IP configuration is IPv4 or IPv6. Default is IPv4. Possible values include: 'IPv4', 'IPv6' PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` } @@ -34153,6 +38695,8 @@ type ProbePropertiesFormat struct { IntervalInSeconds *int32 `json:"intervalInSeconds,omitempty"` // NumberOfProbes - The number of probes where if no response, will result in stopping further traffic from being delivered to the endpoint. This values allows endpoints to be taken out of rotation faster or slower than the typical times used in Azure. NumberOfProbes *int32 `json:"numberOfProbes,omitempty"` + // ProbeThreshold - The number of consecutive successful or failed probes in order to allow or deny traffic from being delivered to this endpoint. After failing the number of consecutive probes equal to this value, the endpoint will be taken out of rotation and require the same number of successful consecutive probes to be placed back in rotation. + ProbeThreshold *int32 `json:"probeThreshold,omitempty"` // RequestPath - The URI used for requesting health status from the VM. Path is required if a protocol is set to http. Otherwise, it is not allowed. There is no default value. RequestPath *string `json:"requestPath,omitempty"` // ProvisioningState - READ-ONLY; The provisioning state of the probe resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' @@ -34174,6 +38718,9 @@ func (ppf ProbePropertiesFormat) MarshalJSON() ([]byte, error) { if ppf.NumberOfProbes != nil { objectMap["numberOfProbes"] = ppf.NumberOfProbes } + if ppf.ProbeThreshold != nil { + objectMap["probeThreshold"] = ppf.ProbeThreshold + } if ppf.RequestPath != nil { objectMap["requestPath"] = ppf.RequestPath } @@ -34526,18 +39073,6 @@ type ProtocolConfiguration struct { HTTPConfiguration *HTTPConfiguration `json:"HTTPConfiguration,omitempty"` } -// ProtocolCustomSettingsFormat dDoS custom policy properties. -type ProtocolCustomSettingsFormat struct { - // Protocol - The protocol for which the DDoS protection policy is being customized. Possible values include: 'DdosCustomPolicyProtocolTCP', 'DdosCustomPolicyProtocolUDP', 'DdosCustomPolicyProtocolSyn' - Protocol DdosCustomPolicyProtocol `json:"protocol,omitempty"` - // TriggerRateOverride - The customized DDoS protection trigger rate. - TriggerRateOverride *string `json:"triggerRateOverride,omitempty"` - // SourceRateOverride - The customized DDoS protection source rate. - SourceRateOverride *string `json:"sourceRateOverride,omitempty"` - // TriggerSensitivityOverride - The customized DDoS protection trigger rate sensitivity degrees. High: Trigger rate set with most sensitivity w.r.t. normal traffic. Default: Trigger rate set with moderate sensitivity w.r.t. normal traffic. Low: Trigger rate set with less sensitivity w.r.t. normal traffic. Relaxed: Trigger rate set with least sensitivity w.r.t. normal traffic. Possible values include: 'DdosCustomPolicyTriggerSensitivityOverrideRelaxed', 'DdosCustomPolicyTriggerSensitivityOverrideLow', 'DdosCustomPolicyTriggerSensitivityOverrideDefault', 'DdosCustomPolicyTriggerSensitivityOverrideHigh' - TriggerSensitivityOverride DdosCustomPolicyTriggerSensitivityOverride `json:"triggerSensitivityOverride,omitempty"` -} - // PublicIPAddress public IP address resource. type PublicIPAddress struct { autorest.Response `json:"-"` @@ -34748,6 +39283,49 @@ func (future *PublicIPAddressesCreateOrUpdateFuture) result(client PublicIPAddre return } +// PublicIPAddressesDdosProtectionStatusFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type PublicIPAddressesDdosProtectionStatusFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PublicIPAddressesClient) (PublicIPDdosProtectionStatusResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PublicIPAddressesDdosProtectionStatusFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for PublicIPAddressesDdosProtectionStatusFuture.Result. +func (future *PublicIPAddressesDdosProtectionStatusFuture) result(client PublicIPAddressesClient) (pidpsr PublicIPDdosProtectionStatusResult, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.PublicIPAddressesDdosProtectionStatusFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pidpsr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.PublicIPAddressesDdosProtectionStatusFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pidpsr.Response.Response, err = future.GetResult(sender); err == nil && pidpsr.Response.Response.StatusCode != http.StatusNoContent { + pidpsr, err = client.DdosProtectionStatusResponder(pidpsr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "network.PublicIPAddressesDdosProtectionStatusFuture", "Result", pidpsr.Response.Response, "Failure responding to request") + } + } + return +} + // PublicIPAddressesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type PublicIPAddressesDeleteFuture struct { @@ -34946,9 +39524,9 @@ func NewPublicIPAddressListResultPage(cur PublicIPAddressListResult, getNextPage // PublicIPAddressPropertiesFormat public IP address properties. type PublicIPAddressPropertiesFormat struct { - // PublicIPAllocationMethod - The public IP address allocation method. Possible values include: 'IPAllocationMethodStatic', 'IPAllocationMethodDynamic' + // PublicIPAllocationMethod - The public IP address allocation method. Possible values include: 'Static', 'Dynamic' PublicIPAllocationMethod IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - // PublicIPAddressVersion - The public IP address version. Possible values include: 'IPVersionIPv4', 'IPVersionIPv6' + // PublicIPAddressVersion - The public IP address version. Possible values include: 'IPv4', 'IPv6' PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"` // IPConfiguration - READ-ONLY; The IP configuration associated with the public IP address. IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` @@ -34976,7 +39554,7 @@ type PublicIPAddressPropertiesFormat struct { MigrationPhase PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` // LinkedPublicIPAddress - The linked public IP address of the public IP address resource. LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - // DeleteOption - Specify what happens to the public IP address when the VM using it is deleted. Possible values include: 'DeleteOptionsDelete', 'DeleteOptionsDetach' + // DeleteOption - Specify what happens to the public IP address when the VM using it is deleted. Possible values include: 'Delete', 'Detach' DeleteOption DeleteOptions `json:"deleteOption,omitempty"` } @@ -35033,6 +39611,20 @@ type PublicIPAddressSku struct { Tier PublicIPAddressSkuTier `json:"tier,omitempty"` } +// PublicIPDdosProtectionStatusResult response for GetPublicIpAddressDdosProtectionStatusOperation API +// service call. +type PublicIPDdosProtectionStatusResult struct { + autorest.Response `json:"-"` + // PublicIPAddressID - Public IP ARM resource ID + PublicIPAddressID *string `json:"publicIpAddressId,omitempty"` + // PublicIPAddress - IP Address of the Public IP Resource + PublicIPAddress *string `json:"publicIpAddress,omitempty"` + // IsWorkloadProtected - Value indicating whether the IP address is DDoS workload protected or not. Possible values include: 'IsWorkloadProtectedFalse', 'IsWorkloadProtectedTrue' + IsWorkloadProtected IsWorkloadProtected `json:"isWorkloadProtected,omitempty"` + // DdosProtectionPlanID - DDoS protection plan Resource Id of a if IP address is protected through a plan. + DdosProtectionPlanID *string `json:"ddosProtectionPlanId,omitempty"` +} + // PublicIPPrefix public IP prefix resource. type PublicIPPrefix struct { autorest.Response `json:"-"` @@ -35431,7 +40023,7 @@ func NewPublicIPPrefixListResultPage(cur PublicIPPrefixListResult, getNextPage f // PublicIPPrefixPropertiesFormat public IP prefix properties. type PublicIPPrefixPropertiesFormat struct { - // PublicIPAddressVersion - The public IP address version. Possible values include: 'IPVersionIPv4', 'IPVersionIPv6' + // PublicIPAddressVersion - The public IP address version. Possible values include: 'IPv4', 'IPv6' PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"` // IPTags - The list of tags associated with the public IP prefix. IPTags *[]IPTag `json:"ipTags,omitempty"` @@ -35610,6 +40202,12 @@ type QueryInboundNatRulePortMappingRequest struct { IPAddress *string `json:"ipAddress,omitempty"` } +// QueryRequestOptions query Request Options +type QueryRequestOptions struct { + // SkipToken - When present, the value can be passed to a subsequent query call (together with the same query and scopes used in the current request) to retrieve the next page of data. + SkipToken *string `json:"skipToken,omitempty"` +} + // QueryResults query result type QueryResults struct { autorest.Response `json:"-"` @@ -36492,7 +41090,7 @@ func NewRouteFilterRuleListResultPage(cur RouteFilterRuleListResult, getNextPage // RouteFilterRulePropertiesFormat route Filter Rule Resource. type RouteFilterRulePropertiesFormat struct { - // Access - The access type of the rule. Possible values include: 'AccessAllow', 'AccessDeny' + // Access - The access type of the rule. Possible values include: 'Allow', 'Deny' Access Access `json:"access,omitempty"` // RouteFilterRuleType - The rule type of the rule. RouteFilterRuleType *string `json:"routeFilterRuleType,omitempty"` @@ -36836,6 +41434,212 @@ func NewRouteListResultPage(cur RouteListResult, getNextPage func(context.Contex } } +// RouteMap the RouteMap child resource of a Virtual hub. +type RouteMap struct { + autorest.Response `json:"-"` + // RouteMapProperties - Properties of the RouteMap resource. + *RouteMapProperties `json:"properties,omitempty"` + // Name - READ-ONLY; The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string `json:"name,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for RouteMap. +func (rm RouteMap) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rm.RouteMapProperties != nil { + objectMap["properties"] = rm.RouteMapProperties + } + if rm.ID != nil { + objectMap["id"] = rm.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RouteMap struct. +func (rm *RouteMap) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var routeMapProperties RouteMapProperties + err = json.Unmarshal(*v, &routeMapProperties) + if err != nil { + return err + } + rm.RouteMapProperties = &routeMapProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rm.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + rm.Etag = &etag + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rm.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rm.ID = &ID + } + } + } + + return nil +} + +// RouteMapProperties properties of RouteMap resource +type RouteMapProperties struct { + // AssociatedInboundConnections - List of connections which have this RoutMap associated for inbound traffic. + AssociatedInboundConnections *[]string `json:"associatedInboundConnections,omitempty"` + // AssociatedOutboundConnections - List of connections which have this RoutMap associated for outbound traffic. + AssociatedOutboundConnections *[]string `json:"associatedOutboundConnections,omitempty"` + // Rules - List of RouteMap rules to be applied. + Rules *[]RouteMapRule `json:"rules,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the RouteMap resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for RouteMapProperties. +func (rmp RouteMapProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rmp.AssociatedInboundConnections != nil { + objectMap["associatedInboundConnections"] = rmp.AssociatedInboundConnections + } + if rmp.AssociatedOutboundConnections != nil { + objectMap["associatedOutboundConnections"] = rmp.AssociatedOutboundConnections + } + if rmp.Rules != nil { + objectMap["rules"] = rmp.Rules + } + return json.Marshal(objectMap) +} + +// RouteMapRule a RouteMap Rule. +type RouteMapRule struct { + // Name - The unique name for the rule. + Name *string `json:"name,omitempty"` + // MatchCriteria - List of matching criterion which will be applied to traffic. + MatchCriteria *[]Criterion `json:"matchCriteria,omitempty"` + // Actions - List of actions which will be applied on a match. + Actions *[]Action `json:"actions,omitempty"` + // NextStepIfMatched - Next step after rule is evaluated. Current supported behaviors are 'Continue'(to next rule) and 'Terminate'. Possible values include: 'NextStepUnknown', 'NextStepContinue', 'NextStepTerminate' + NextStepIfMatched NextStep `json:"nextStepIfMatched,omitempty"` +} + +// RouteMapsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type RouteMapsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RouteMapsClient) (RouteMap, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RouteMapsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for RouteMapsCreateOrUpdateFuture.Result. +func (future *RouteMapsCreateOrUpdateFuture) result(client RouteMapsClient) (rm RouteMap, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteMapsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.RouteMapsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rm.Response.Response, err = future.GetResult(sender); err == nil && rm.Response.Response.StatusCode != http.StatusNoContent { + rm, err = client.CreateOrUpdateResponder(rm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteMapsCreateOrUpdateFuture", "Result", rm.Response.Response, "Failure responding to request") + } + } + return +} + +// RouteMapsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type RouteMapsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RouteMapsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RouteMapsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for RouteMapsDeleteFuture.Result. +func (future *RouteMapsDeleteFuture) result(client RouteMapsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteMapsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.RouteMapsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + // RoutePropertiesFormat route resource. type RoutePropertiesFormat struct { // AddressPrefix - The destination CIDR to which the route applies. @@ -37336,6 +42140,10 @@ type RoutingConfiguration struct { PropagatedRouteTables *PropagatedRouteTable `json:"propagatedRouteTables,omitempty"` // VnetRoutes - List of routes that control routing from VirtualHub into a virtual network connection. VnetRoutes *VnetRoute `json:"vnetRoutes,omitempty"` + // InboundRouteMap - The resource id of the RouteMap associated with this RoutingConfiguration for inbound learned routes. + InboundRouteMap *SubResource `json:"inboundRouteMap,omitempty"` + // OutboundRouteMap - The resource id of theRouteMap associated with this RoutingConfiguration for outbound advertised routes. + OutboundRouteMap *SubResource `json:"outboundRouteMap,omitempty"` } // RoutingIntent the routing intent child resource of a Virtual hub. @@ -37621,6 +42429,586 @@ func (r Rule) AsBasicFirewallPolicyRule() (BasicFirewallPolicyRule, bool) { return &r, true } +// ScopeConnection the Scope Connections resource +type ScopeConnection struct { + autorest.Response `json:"-"` + // ScopeConnectionProperties - The scope connection properties + *ScopeConnectionProperties `json:"properties,omitempty"` + // SystemData - READ-ONLY; The system metadata related to this resource. + SystemData *SystemData `json:"systemData,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScopeConnection. +func (sc ScopeConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sc.ScopeConnectionProperties != nil { + objectMap["properties"] = sc.ScopeConnectionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ScopeConnection struct. +func (sc *ScopeConnection) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var scopeConnectionProperties ScopeConnectionProperties + err = json.Unmarshal(*v, &scopeConnectionProperties) + if err != nil { + return err + } + sc.ScopeConnectionProperties = &scopeConnectionProperties + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + sc.SystemData = &systemData + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sc.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + sc.Etag = &etag + } + } + } + + return nil +} + +// ScopeConnectionListResult list of scope connections. +type ScopeConnectionListResult struct { + autorest.Response `json:"-"` + // Value - List of scope connections. + Value *[]ScopeConnection `json:"value,omitempty"` + // NextLink - Gets the URL to get the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ScopeConnectionListResultIterator provides access to a complete listing of ScopeConnection values. +type ScopeConnectionListResultIterator struct { + i int + page ScopeConnectionListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ScopeConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ScopeConnectionListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ScopeConnectionListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ScopeConnectionListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ScopeConnectionListResultIterator) Response() ScopeConnectionListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ScopeConnectionListResultIterator) Value() ScopeConnection { + if !iter.page.NotDone() { + return ScopeConnection{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ScopeConnectionListResultIterator type. +func NewScopeConnectionListResultIterator(page ScopeConnectionListResultPage) ScopeConnectionListResultIterator { + return ScopeConnectionListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sclr ScopeConnectionListResult) IsEmpty() bool { + return sclr.Value == nil || len(*sclr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (sclr ScopeConnectionListResult) hasNextLink() bool { + return sclr.NextLink != nil && len(*sclr.NextLink) != 0 +} + +// scopeConnectionListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sclr ScopeConnectionListResult) scopeConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { + if !sclr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sclr.NextLink))) +} + +// ScopeConnectionListResultPage contains a page of ScopeConnection values. +type ScopeConnectionListResultPage struct { + fn func(context.Context, ScopeConnectionListResult) (ScopeConnectionListResult, error) + sclr ScopeConnectionListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ScopeConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ScopeConnectionListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.sclr) + if err != nil { + return err + } + page.sclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ScopeConnectionListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ScopeConnectionListResultPage) NotDone() bool { + return !page.sclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ScopeConnectionListResultPage) Response() ScopeConnectionListResult { + return page.sclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ScopeConnectionListResultPage) Values() []ScopeConnection { + if page.sclr.IsEmpty() { + return nil + } + return *page.sclr.Value +} + +// Creates a new instance of the ScopeConnectionListResultPage type. +func NewScopeConnectionListResultPage(cur ScopeConnectionListResult, getNextPage func(context.Context, ScopeConnectionListResult) (ScopeConnectionListResult, error)) ScopeConnectionListResultPage { + return ScopeConnectionListResultPage{ + fn: getNextPage, + sclr: cur, + } +} + +// ScopeConnectionProperties scope connection. +type ScopeConnectionProperties struct { + // TenantID - Tenant ID. + TenantID *string `json:"tenantId,omitempty"` + // ResourceID - Resource ID. + ResourceID *string `json:"resourceId,omitempty"` + // ConnectionState - Connection State. Possible values include: 'ScopeConnectionStateConnected', 'ScopeConnectionStatePending', 'ScopeConnectionStateConflict', 'ScopeConnectionStateRevoked', 'ScopeConnectionStateRejected' + ConnectionState ScopeConnectionState `json:"connectionState,omitempty"` + // Description - A description of the scope connection. + Description *string `json:"description,omitempty"` +} + +// SecurityAdminConfiguration defines the security admin configuration +type SecurityAdminConfiguration struct { + autorest.Response `json:"-"` + // SecurityAdminConfigurationPropertiesFormat - Indicates the properties for the network manager security admin configuration. + *SecurityAdminConfigurationPropertiesFormat `json:"properties,omitempty"` + // SystemData - READ-ONLY; The system metadata related to this resource. + SystemData *SystemData `json:"systemData,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for SecurityAdminConfiguration. +func (sac SecurityAdminConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sac.SecurityAdminConfigurationPropertiesFormat != nil { + objectMap["properties"] = sac.SecurityAdminConfigurationPropertiesFormat + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SecurityAdminConfiguration struct. +func (sac *SecurityAdminConfiguration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var securityAdminConfigurationPropertiesFormat SecurityAdminConfigurationPropertiesFormat + err = json.Unmarshal(*v, &securityAdminConfigurationPropertiesFormat) + if err != nil { + return err + } + sac.SecurityAdminConfigurationPropertiesFormat = &securityAdminConfigurationPropertiesFormat + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + sac.SystemData = &systemData + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sac.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sac.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sac.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + sac.Etag = &etag + } + } + } + + return nil +} + +// SecurityAdminConfigurationListResult a list of network manager security admin configurations +type SecurityAdminConfigurationListResult struct { + autorest.Response `json:"-"` + // Value - Gets a page of security admin configurations + Value *[]SecurityAdminConfiguration `json:"value,omitempty"` + // NextLink - Gets the URL to get the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// SecurityAdminConfigurationListResultIterator provides access to a complete listing of +// SecurityAdminConfiguration values. +type SecurityAdminConfigurationListResultIterator struct { + i int + page SecurityAdminConfigurationListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SecurityAdminConfigurationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecurityAdminConfigurationListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *SecurityAdminConfigurationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SecurityAdminConfigurationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SecurityAdminConfigurationListResultIterator) Response() SecurityAdminConfigurationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SecurityAdminConfigurationListResultIterator) Value() SecurityAdminConfiguration { + if !iter.page.NotDone() { + return SecurityAdminConfiguration{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SecurityAdminConfigurationListResultIterator type. +func NewSecurityAdminConfigurationListResultIterator(page SecurityAdminConfigurationListResultPage) SecurityAdminConfigurationListResultIterator { + return SecurityAdminConfigurationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (saclr SecurityAdminConfigurationListResult) IsEmpty() bool { + return saclr.Value == nil || len(*saclr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (saclr SecurityAdminConfigurationListResult) hasNextLink() bool { + return saclr.NextLink != nil && len(*saclr.NextLink) != 0 +} + +// securityAdminConfigurationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (saclr SecurityAdminConfigurationListResult) securityAdminConfigurationListResultPreparer(ctx context.Context) (*http.Request, error) { + if !saclr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(saclr.NextLink))) +} + +// SecurityAdminConfigurationListResultPage contains a page of SecurityAdminConfiguration values. +type SecurityAdminConfigurationListResultPage struct { + fn func(context.Context, SecurityAdminConfigurationListResult) (SecurityAdminConfigurationListResult, error) + saclr SecurityAdminConfigurationListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SecurityAdminConfigurationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecurityAdminConfigurationListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.saclr) + if err != nil { + return err + } + page.saclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *SecurityAdminConfigurationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SecurityAdminConfigurationListResultPage) NotDone() bool { + return !page.saclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SecurityAdminConfigurationListResultPage) Response() SecurityAdminConfigurationListResult { + return page.saclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SecurityAdminConfigurationListResultPage) Values() []SecurityAdminConfiguration { + if page.saclr.IsEmpty() { + return nil + } + return *page.saclr.Value +} + +// Creates a new instance of the SecurityAdminConfigurationListResultPage type. +func NewSecurityAdminConfigurationListResultPage(cur SecurityAdminConfigurationListResult, getNextPage func(context.Context, SecurityAdminConfigurationListResult) (SecurityAdminConfigurationListResult, error)) SecurityAdminConfigurationListResultPage { + return SecurityAdminConfigurationListResultPage{ + fn: getNextPage, + saclr: cur, + } +} + +// SecurityAdminConfigurationPropertiesFormat defines the security admin configuration properties. +type SecurityAdminConfigurationPropertiesFormat struct { + // Description - A description of the security configuration. + Description *string `json:"description,omitempty"` + // ApplyOnNetworkIntentPolicyBasedServices - Enum list of network intent policy based services. + ApplyOnNetworkIntentPolicyBasedServices *[]IntentPolicyBasedService `json:"applyOnNetworkIntentPolicyBasedServices,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for SecurityAdminConfigurationPropertiesFormat. +func (sacpf SecurityAdminConfigurationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sacpf.Description != nil { + objectMap["description"] = sacpf.Description + } + if sacpf.ApplyOnNetworkIntentPolicyBasedServices != nil { + objectMap["applyOnNetworkIntentPolicyBasedServices"] = sacpf.ApplyOnNetworkIntentPolicyBasedServices + } + return json.Marshal(objectMap) +} + +// SecurityAdminConfigurationsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type SecurityAdminConfigurationsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SecurityAdminConfigurationsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SecurityAdminConfigurationsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SecurityAdminConfigurationsDeleteFuture.Result. +func (future *SecurityAdminConfigurationsDeleteFuture) result(client SecurityAdminConfigurationsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.SecurityAdminConfigurationsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.SecurityAdminConfigurationsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + // SecurityGroup networkSecurityGroup resource. type SecurityGroup struct { autorest.Response `json:"-"` @@ -37905,6 +43293,8 @@ type SecurityGroupNetworkInterface struct { // SecurityGroupPropertiesFormat network Security Group resource. type SecurityGroupPropertiesFormat struct { + // FlushConnection - When enabled, flows created from Network Security Group connections will be re-evaluated when rules are updates. Initial enablement will trigger re-evaluation. + FlushConnection *bool `json:"flushConnection,omitempty"` // SecurityRules - A collection of security rules of the network security group. SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` // DefaultSecurityRules - READ-ONLY; The default security rules of network security group. @@ -37924,6 +43314,9 @@ type SecurityGroupPropertiesFormat struct { // MarshalJSON is the custom marshaler for SecurityGroupPropertiesFormat. func (sgpf SecurityGroupPropertiesFormat) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + if sgpf.FlushConnection != nil { + objectMap["flushConnection"] = sgpf.FlushConnection + } if sgpf.SecurityRules != nil { objectMap["securityRules"] = sgpf.SecurityRules } @@ -38319,7 +43712,7 @@ func NewSecurityPartnerProviderListResultPage(cur SecurityPartnerProviderListRes type SecurityPartnerProviderPropertiesFormat struct { // ProvisioningState - READ-ONLY; The provisioning state of the Security Partner Provider resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` - // SecurityProviderName - The security provider name. Possible values include: 'SecurityProviderNameZScaler', 'SecurityProviderNameIBoss', 'SecurityProviderNameCheckpoint' + // SecurityProviderName - The security provider name. Possible values include: 'ZScaler', 'IBoss', 'Checkpoint' SecurityProviderName SecurityProviderName `json:"securityProviderName,omitempty"` // ConnectionStatus - READ-ONLY; The connection status with the Security Partner Provider. Possible values include: 'SecurityPartnerProviderConnectionStatusUnknown', 'SecurityPartnerProviderConnectionStatusPartiallyConnected', 'SecurityPartnerProviderConnectionStatusConnected', 'SecurityPartnerProviderConnectionStatusNotConnected' ConnectionStatus SecurityPartnerProviderConnectionStatus `json:"connectionStatus,omitempty"` @@ -39887,67 +45280,454 @@ func (iter *ServiceTagInformationListResultIterator) NextWithContext(ctx context // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *ServiceTagInformationListResultIterator) Next() error { +func (iter *ServiceTagInformationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ServiceTagInformationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ServiceTagInformationListResultIterator) Response() ServiceTagInformationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ServiceTagInformationListResultIterator) Value() ServiceTagInformation { + if !iter.page.NotDone() { + return ServiceTagInformation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ServiceTagInformationListResultIterator type. +func NewServiceTagInformationListResultIterator(page ServiceTagInformationListResultPage) ServiceTagInformationListResultIterator { + return ServiceTagInformationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (stilr ServiceTagInformationListResult) IsEmpty() bool { + return stilr.Value == nil || len(*stilr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (stilr ServiceTagInformationListResult) hasNextLink() bool { + return stilr.NextLink != nil && len(*stilr.NextLink) != 0 +} + +// serviceTagInformationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (stilr ServiceTagInformationListResult) serviceTagInformationListResultPreparer(ctx context.Context) (*http.Request, error) { + if !stilr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(stilr.NextLink))) +} + +// ServiceTagInformationListResultPage contains a page of ServiceTagInformation values. +type ServiceTagInformationListResultPage struct { + fn func(context.Context, ServiceTagInformationListResult) (ServiceTagInformationListResult, error) + stilr ServiceTagInformationListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ServiceTagInformationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceTagInformationListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.stilr) + if err != nil { + return err + } + page.stilr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ServiceTagInformationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ServiceTagInformationListResultPage) NotDone() bool { + return !page.stilr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ServiceTagInformationListResultPage) Response() ServiceTagInformationListResult { + return page.stilr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ServiceTagInformationListResultPage) Values() []ServiceTagInformation { + if page.stilr.IsEmpty() { + return nil + } + return *page.stilr.Value +} + +// Creates a new instance of the ServiceTagInformationListResultPage type. +func NewServiceTagInformationListResultPage(cur ServiceTagInformationListResult, getNextPage func(context.Context, ServiceTagInformationListResult) (ServiceTagInformationListResult, error)) ServiceTagInformationListResultPage { + return ServiceTagInformationListResultPage{ + fn: getNextPage, + stilr: cur, + } +} + +// ServiceTagInformationPropertiesFormat properties of the service tag information. +type ServiceTagInformationPropertiesFormat struct { + // ChangeNumber - READ-ONLY; The iteration number of service tag. + ChangeNumber *string `json:"changeNumber,omitempty"` + // Region - READ-ONLY; The region of service tag. + Region *string `json:"region,omitempty"` + // SystemService - READ-ONLY; The name of system service. + SystemService *string `json:"systemService,omitempty"` + // AddressPrefixes - READ-ONLY; The list of IP address prefixes. + AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` + // State - READ-ONLY; The state of the service tag. + State *string `json:"state,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServiceTagInformationPropertiesFormat. +func (stipf ServiceTagInformationPropertiesFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ServiceTagsListResult response for the ListServiceTags API service call. +type ServiceTagsListResult struct { + autorest.Response `json:"-"` + // Name - READ-ONLY; The name of the cloud. + Name *string `json:"name,omitempty"` + // ID - READ-ONLY; The ID of the cloud. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; The azure resource type. + Type *string `json:"type,omitempty"` + // ChangeNumber - READ-ONLY; The iteration number. + ChangeNumber *string `json:"changeNumber,omitempty"` + // Cloud - READ-ONLY; The name of the cloud. + Cloud *string `json:"cloud,omitempty"` + // Values - READ-ONLY; The list of service tag information resources. + Values *[]ServiceTagInformation `json:"values,omitempty"` + // NextLink - READ-ONLY; The URL to get next page of service tag information resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServiceTagsListResult. +func (stlr ServiceTagsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SessionIds list of session IDs. +type SessionIds struct { + // SessionIds - List of session IDs. + SessionIds *[]string `json:"sessionIds,omitempty"` +} + +// SignatureOverridesFilterValuesQuery describes the filter values possibles for a given column +type SignatureOverridesFilterValuesQuery struct { + // FilterName - Describes the name of the column which values will be returned + FilterName *string `json:"filterName,omitempty"` +} + +// SignatureOverridesFilterValuesResponse describes the list of all possible values for a specific filter +// value +type SignatureOverridesFilterValuesResponse struct { + autorest.Response `json:"-"` + // FilterValues - Describes the possible values + FilterValues *[]string `json:"filterValues,omitempty"` +} + +// SignaturesOverrides contains all specific policy signatures overrides for the IDPS +type SignaturesOverrides struct { + autorest.Response `json:"-"` + // Name - Contains the name of the resource (default) + Name *string `json:"name,omitempty"` + // ID - Will contain the resource id of the signature override resource + ID *string `json:"id,omitempty"` + // Type - Will contain the type of the resource: Microsoft.Network/firewallPolicies/intrusionDetectionSignaturesOverrides + Type *string `json:"type,omitempty"` + // Properties - Will contain the properties of the resource (the actual signature overrides) + Properties *SignaturesOverridesProperties `json:"properties,omitempty"` +} + +// SignaturesOverridesList describes an object containing an array with a single item +type SignaturesOverridesList struct { + autorest.Response `json:"-"` + // Value - Describes a list consisting exactly one item describing the policy's signature override status + Value *[]SignaturesOverrides `json:"value,omitempty"` +} + +// SignaturesOverridesProperties will contain the properties of the resource (the actual signature +// overrides) +type SignaturesOverridesProperties struct { + Signatures map[string]*string `json:"signatures"` +} + +// MarshalJSON is the custom marshaler for SignaturesOverridesProperties. +func (so SignaturesOverridesProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if so.Signatures != nil { + objectMap["signatures"] = so.Signatures + } + return json.Marshal(objectMap) +} + +// SingleQueryResult ... +type SingleQueryResult struct { + // SignatureID - The ID of the signature + SignatureID *int32 `json:"signatureId,omitempty"` + // Mode - The current mode enforced, 0 - Disabled, 1 - Alert, 2 -Deny + Mode *int32 `json:"mode,omitempty"` + // Severity - Describes the severity of signature: 1 - Low, 2 - Medium, 3 - High + Severity *int32 `json:"severity,omitempty"` + // Direction - Describes in which direction signature is being enforced: 0 - Inbound, 1 - OutBound, 2 - Bidirectional + Direction *int32 `json:"direction,omitempty"` + // Group - Describes the groups the signature belongs to + Group *string `json:"group,omitempty"` + // Description - Describes what is the signature enforces + Description *string `json:"description,omitempty"` + // Protocol - Describes the protocol the signatures is being enforced in + Protocol *string `json:"protocol,omitempty"` + // SourcePorts - Describes the list of source ports related to this signature + SourcePorts *[]string `json:"sourcePorts,omitempty"` + // DestinationPorts - Describes the list of destination ports related to this signature + DestinationPorts *[]string `json:"destinationPorts,omitempty"` + // LastUpdated - Describes the last updated time of the signature (provided from 3rd party vendor) + LastUpdated *string `json:"lastUpdated,omitempty"` + // InheritedFromParentPolicy - Describes if this override is inherited from base policy or not + InheritedFromParentPolicy *bool `json:"inheritedFromParentPolicy,omitempty"` +} + +// Sku the sku of this Bastion Host. +type Sku struct { + // Name - The name of this Bastion Host. Possible values include: 'BastionHostSkuNameBasic', 'BastionHostSkuNameStandard' + Name BastionHostSkuName `json:"name,omitempty"` +} + +// StaticMember staticMember Item. +type StaticMember struct { + autorest.Response `json:"-"` + // StaticMemberProperties - The Static Member properties + *StaticMemberProperties `json:"properties,omitempty"` + // SystemData - READ-ONLY; The system metadata related to this resource. + SystemData *SystemData `json:"systemData,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticMember. +func (sm StaticMember) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sm.StaticMemberProperties != nil { + objectMap["properties"] = sm.StaticMemberProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StaticMember struct. +func (sm *StaticMember) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var staticMemberProperties StaticMemberProperties + err = json.Unmarshal(*v, &staticMemberProperties) + if err != nil { + return err + } + sm.StaticMemberProperties = &staticMemberProperties + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + sm.SystemData = &systemData + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sm.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sm.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + sm.Etag = &etag + } + } + } + + return nil +} + +// StaticMemberListResult result of the request to list StaticMember. It contains a list of groups and a +// URL link to get the next set of results. +type StaticMemberListResult struct { + autorest.Response `json:"-"` + // Value - Gets a page of StaticMember + Value *[]StaticMember `json:"value,omitempty"` + // NextLink - Gets the URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// StaticMemberListResultIterator provides access to a complete listing of StaticMember values. +type StaticMemberListResultIterator struct { + i int + page StaticMemberListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *StaticMemberListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticMemberListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *StaticMemberListResultIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ServiceTagInformationListResultIterator) NotDone() bool { +func (iter StaticMemberListResultIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter ServiceTagInformationListResultIterator) Response() ServiceTagInformationListResult { +func (iter StaticMemberListResultIterator) Response() StaticMemberListResult { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter ServiceTagInformationListResultIterator) Value() ServiceTagInformation { +func (iter StaticMemberListResultIterator) Value() StaticMember { if !iter.page.NotDone() { - return ServiceTagInformation{} + return StaticMember{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the ServiceTagInformationListResultIterator type. -func NewServiceTagInformationListResultIterator(page ServiceTagInformationListResultPage) ServiceTagInformationListResultIterator { - return ServiceTagInformationListResultIterator{page: page} +// Creates a new instance of the StaticMemberListResultIterator type. +func NewStaticMemberListResultIterator(page StaticMemberListResultPage) StaticMemberListResultIterator { + return StaticMemberListResultIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (stilr ServiceTagInformationListResult) IsEmpty() bool { - return stilr.Value == nil || len(*stilr.Value) == 0 +func (smlr StaticMemberListResult) IsEmpty() bool { + return smlr.Value == nil || len(*smlr.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (stilr ServiceTagInformationListResult) hasNextLink() bool { - return stilr.NextLink != nil && len(*stilr.NextLink) != 0 +func (smlr StaticMemberListResult) hasNextLink() bool { + return smlr.NextLink != nil && len(*smlr.NextLink) != 0 } -// serviceTagInformationListResultPreparer prepares a request to retrieve the next set of results. +// staticMemberListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (stilr ServiceTagInformationListResult) serviceTagInformationListResultPreparer(ctx context.Context) (*http.Request, error) { - if !stilr.hasNextLink() { +func (smlr StaticMemberListResult) staticMemberListResultPreparer(ctx context.Context) (*http.Request, error) { + if !smlr.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(stilr.NextLink))) + autorest.WithBaseURL(to.String(smlr.NextLink))) } -// ServiceTagInformationListResultPage contains a page of ServiceTagInformation values. -type ServiceTagInformationListResultPage struct { - fn func(context.Context, ServiceTagInformationListResult) (ServiceTagInformationListResult, error) - stilr ServiceTagInformationListResult +// StaticMemberListResultPage contains a page of StaticMember values. +type StaticMemberListResultPage struct { + fn func(context.Context, StaticMemberListResult) (StaticMemberListResult, error) + smlr StaticMemberListResult } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *ServiceTagInformationListResultPage) NextWithContext(ctx context.Context) (err error) { +func (page *StaticMemberListResultPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceTagInformationListResultPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/StaticMemberListResultPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -39957,11 +45737,11 @@ func (page *ServiceTagInformationListResultPage) NextWithContext(ctx context.Con }() } for { - next, err := page.fn(ctx, page.stilr) + next, err := page.fn(ctx, page.smlr) if err != nil { return err } - page.stilr = next + page.smlr = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -39972,168 +45752,55 @@ func (page *ServiceTagInformationListResultPage) NextWithContext(ctx context.Con // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *ServiceTagInformationListResultPage) Next() error { +func (page *StaticMemberListResultPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ServiceTagInformationListResultPage) NotDone() bool { - return !page.stilr.IsEmpty() +func (page StaticMemberListResultPage) NotDone() bool { + return !page.smlr.IsEmpty() } // Response returns the raw server response from the last page request. -func (page ServiceTagInformationListResultPage) Response() ServiceTagInformationListResult { - return page.stilr +func (page StaticMemberListResultPage) Response() StaticMemberListResult { + return page.smlr } // Values returns the slice of values for the current page or nil if there are no values. -func (page ServiceTagInformationListResultPage) Values() []ServiceTagInformation { - if page.stilr.IsEmpty() { +func (page StaticMemberListResultPage) Values() []StaticMember { + if page.smlr.IsEmpty() { return nil } - return *page.stilr.Value + return *page.smlr.Value } -// Creates a new instance of the ServiceTagInformationListResultPage type. -func NewServiceTagInformationListResultPage(cur ServiceTagInformationListResult, getNextPage func(context.Context, ServiceTagInformationListResult) (ServiceTagInformationListResult, error)) ServiceTagInformationListResultPage { - return ServiceTagInformationListResultPage{ - fn: getNextPage, - stilr: cur, +// Creates a new instance of the StaticMemberListResultPage type. +func NewStaticMemberListResultPage(cur StaticMemberListResult, getNextPage func(context.Context, StaticMemberListResult) (StaticMemberListResult, error)) StaticMemberListResultPage { + return StaticMemberListResultPage{ + fn: getNextPage, + smlr: cur, } } -// ServiceTagInformationPropertiesFormat properties of the service tag information. -type ServiceTagInformationPropertiesFormat struct { - // ChangeNumber - READ-ONLY; The iteration number of service tag. - ChangeNumber *string `json:"changeNumber,omitempty"` - // Region - READ-ONLY; The region of service tag. +// StaticMemberProperties properties of static member. +type StaticMemberProperties struct { + // ResourceID - Resource Id. + ResourceID *string `json:"resourceId,omitempty"` + // Region - READ-ONLY; Resource region. Region *string `json:"region,omitempty"` - // SystemService - READ-ONLY; The name of system service. - SystemService *string `json:"systemService,omitempty"` - // AddressPrefixes - READ-ONLY; The list of IP address prefixes. - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - // State - READ-ONLY; The state of the service tag. - State *string `json:"state,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServiceTagInformationPropertiesFormat. -func (stipf ServiceTagInformationPropertiesFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// ServiceTagsListResult response for the ListServiceTags API service call. -type ServiceTagsListResult struct { - autorest.Response `json:"-"` - // Name - READ-ONLY; The name of the cloud. - Name *string `json:"name,omitempty"` - // ID - READ-ONLY; The ID of the cloud. - ID *string `json:"id,omitempty"` - // Type - READ-ONLY; The azure resource type. - Type *string `json:"type,omitempty"` - // ChangeNumber - READ-ONLY; The iteration number. - ChangeNumber *string `json:"changeNumber,omitempty"` - // Cloud - READ-ONLY; The name of the cloud. - Cloud *string `json:"cloud,omitempty"` - // Values - READ-ONLY; The list of service tag information resources. - Values *[]ServiceTagInformation `json:"values,omitempty"` - // NextLink - READ-ONLY; The URL to get next page of service tag information resources. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for ServiceTagsListResult. -func (stlr ServiceTagsListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) -} - -// SessionIds list of session IDs. -type SessionIds struct { - // SessionIds - List of session IDs. - SessionIds *[]string `json:"sessionIds,omitempty"` -} - -// SignatureOverridesFilterValuesQuery describes the filter values possibles for a given column -type SignatureOverridesFilterValuesQuery struct { - // FilterName - Describes the name of the column which values will be returned - FilterName *string `json:"filterName,omitempty"` -} - -// SignatureOverridesFilterValuesResponse describes the list of all possible values for a specific filter -// value -type SignatureOverridesFilterValuesResponse struct { - autorest.Response `json:"-"` - // FilterValues - Describes the possible values - FilterValues *[]string `json:"filterValues,omitempty"` -} - -// SignaturesOverrides contains all specific policy signatures overrides for the IDPS -type SignaturesOverrides struct { - autorest.Response `json:"-"` - // Name - Contains the name of the resource (default) - Name *string `json:"name,omitempty"` - // ID - Will contain the resource id of the signature override resource - ID *string `json:"id,omitempty"` - // Type - Will contain the type of the resource: Microsoft.Network/firewallPolicies/intrusionDetectionSignaturesOverrides - Type *string `json:"type,omitempty"` - // Properties - Will contain the properties of the resource (the actual signature overrides) - Properties *SignaturesOverridesProperties `json:"properties,omitempty"` -} - -// SignaturesOverridesList describes an object containing an array with a single item -type SignaturesOverridesList struct { - autorest.Response `json:"-"` - // Value - Describes a list consisting exactly one item describing the policy's signature override status - Value *[]SignaturesOverrides `json:"value,omitempty"` -} - -// SignaturesOverridesProperties will contain the properties of the resource (the actual signature -// overrides) -type SignaturesOverridesProperties struct { - Signatures map[string]*string `json:"signatures"` + // ProvisioningState - READ-ONLY; The provisioning state of the scope assignment resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } -// MarshalJSON is the custom marshaler for SignaturesOverridesProperties. -func (so SignaturesOverridesProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for StaticMemberProperties. +func (smp StaticMemberProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if so.Signatures != nil { - objectMap["signatures"] = so.Signatures + if smp.ResourceID != nil { + objectMap["resourceId"] = smp.ResourceID } return json.Marshal(objectMap) } -// SingleQueryResult ... -type SingleQueryResult struct { - // SignatureID - The ID of the signature - SignatureID *int32 `json:"signatureId,omitempty"` - // Mode - The current mode enforced, 0 - Disabled, 1 - Alert, 2 -Deny - Mode *int32 `json:"mode,omitempty"` - // Severity - Describes the severity of signature: 1 - Low, 2 - Medium, 3 - High - Severity *int32 `json:"severity,omitempty"` - // Direction - Describes in which direction signature is being enforced: 0 - Inbound, 1 - OutBound, 2 - Bidirectional - Direction *int32 `json:"direction,omitempty"` - // Group - Describes the groups the signature belongs to - Group *string `json:"group,omitempty"` - // Description - Describes what is the signature enforces - Description *string `json:"description,omitempty"` - // Protocol - Describes the protocol the signatures is being enforced in - Protocol *string `json:"protocol,omitempty"` - // SourcePorts - Describes the list of source ports related to this signature - SourcePorts *[]string `json:"sourcePorts,omitempty"` - // DestinationPorts - Describes the list of destination ports related to this signature - DestinationPorts *[]string `json:"destinationPorts,omitempty"` - // LastUpdated - Describes the last updated time of the signature (provided from 3rd party vendor) - LastUpdated *string `json:"lastUpdated,omitempty"` - // InheritedFromParentPolicy - Describes if this override is inherited from base policy or not - InheritedFromParentPolicy *bool `json:"inheritedFromParentPolicy,omitempty"` -} - -// Sku the sku of this Bastion Host. -type Sku struct { - // Name - The name of this Bastion Host. Possible values include: 'BastionHostSkuNameBasic', 'BastionHostSkuNameStandard' - Name BastionHostSkuName `json:"name,omitempty"` -} - // StaticRoute list of all Static Routes. type StaticRoute struct { // Name - The name of the StaticRoute that is unique within a VnetRoute. @@ -40144,6 +45811,24 @@ type StaticRoute struct { NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` } +// StaticRoutesConfig configuration for static routes on this HubVnetConnectionConfiguration for static +// routes on this HubVnetConnection. +type StaticRoutesConfig struct { + // PropagateStaticRoutes - READ-ONLY; Boolean indicating whether static routes on this connection are automatically propagate to route tables which this connection propagates to. + PropagateStaticRoutes *bool `json:"propagateStaticRoutes,omitempty"` + // VnetLocalRouteOverrideCriteria - Parameter determining whether NVA in spoke vnet is bypassed for traffic with destination in spoke. Possible values include: 'VnetLocalRouteOverrideCriteriaContains', 'VnetLocalRouteOverrideCriteriaEqual' + VnetLocalRouteOverrideCriteria VnetLocalRouteOverrideCriteria `json:"vnetLocalRouteOverrideCriteria,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticRoutesConfig. +func (src StaticRoutesConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if src.VnetLocalRouteOverrideCriteria != "" { + objectMap["vnetLocalRouteOverrideCriteria"] = src.VnetLocalRouteOverrideCriteria + } + return json.Marshal(objectMap) +} + // String ... type String struct { autorest.Response `json:"-"` @@ -40664,6 +46349,56 @@ type SubResource struct { ID *string `json:"id,omitempty"` } +// SwapResource swapResource to represent slot type on the specified cloud service. +type SwapResource struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + Properties *SwapResourceProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SwapResource. +func (sr SwapResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sr.Properties != nil { + objectMap["properties"] = sr.Properties + } + return json.Marshal(objectMap) +} + +// SwapResourceListResult swapResource List with single entry to represent slot type on the specified cloud +// service. +type SwapResourceListResult struct { + autorest.Response `json:"-"` + Value *[]SwapResource `json:"value,omitempty"` +} + +// SwapResourceProperties swap resource properties +type SwapResourceProperties struct { + // SlotType - Specifies slot info on a cloud service. Possible values include: 'Production', 'Staging' + SlotType SlotType `json:"slotType,omitempty"` +} + +// SystemData metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // CreatedBy - The identity that created the resource. + CreatedBy *string `json:"createdBy,omitempty"` + // CreatedByType - The type of identity that created the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + CreatedByType CreatedByType `json:"createdByType,omitempty"` + // CreatedAt - The timestamp of resource creation (UTC). + CreatedAt *date.Time `json:"createdAt,omitempty"` + // LastModifiedBy - The identity that last modified the resource. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"` + // LastModifiedAt - The type of identity that last modified the resource. + LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` +} + // TagsObject tags object for patch operations. type TagsObject struct { // Tags - Resource tags. @@ -40707,7 +46442,7 @@ type TopologyAssociation struct { Name *string `json:"name,omitempty"` // ResourceID - The ID of the resource that is associated with the parent resource. ResourceID *string `json:"resourceId,omitempty"` - // AssociationType - The association type of the child resource to the parent resource. Possible values include: 'AssociationTypeAssociated', 'AssociationTypeContains' + // AssociationType - The association type of the child resource to the parent resource. Possible values include: 'Associated', 'Contains' AssociationType AssociationType `json:"associationType,omitempty"` } @@ -41090,7 +46825,7 @@ func NewUsagesListResultPage(cur UsagesListResult, getNextPage func(context.Cont type VerificationIPFlowParameters struct { // TargetResourceID - The ID of the target resource to perform next-hop on. TargetResourceID *string `json:"targetResourceId,omitempty"` - // Direction - The direction of the packet represented as a 5-tuple. Possible values include: 'DirectionInbound', 'DirectionOutbound' + // Direction - The direction of the packet represented as a 5-tuple. Possible values include: 'Inbound', 'Outbound' Direction Direction `json:"direction,omitempty"` // Protocol - Protocol to be verified on. Possible values include: 'IPFlowProtocolTCP', 'IPFlowProtocolUDP' Protocol IPFlowProtocol `json:"protocol,omitempty"` @@ -41109,12 +46844,49 @@ type VerificationIPFlowParameters struct { // VerificationIPFlowResult results of IP flow verification on the target resource. type VerificationIPFlowResult struct { autorest.Response `json:"-"` - // Access - Indicates whether the traffic is allowed or denied. Possible values include: 'AccessAllow', 'AccessDeny' + // Access - Indicates whether the traffic is allowed or denied. Possible values include: 'Allow', 'Deny' Access Access `json:"access,omitempty"` // RuleName - Name of the rule. If input is not matched against any security rule, it is not displayed. RuleName *string `json:"ruleName,omitempty"` } +// VipSwapCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VipSwapCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VipSwapClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VipSwapCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VipSwapCreateFuture.Result. +func (future *VipSwapCreateFuture) result(client VipSwapClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VipSwapCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.VipSwapCreateFuture") + return + } + ar.Response = future.Response() + return +} + // VirtualAppliance networkVirtualAppliance Resource. type VirtualAppliance struct { autorest.Response `json:"-"` @@ -41433,7 +47205,7 @@ type VirtualAppliancePropertiesFormat struct { CloudInitConfigurationBlobs *[]string `json:"cloudInitConfigurationBlobs,omitempty"` // CloudInitConfiguration - CloudInitConfiguration string in plain text. CloudInitConfiguration *string `json:"cloudInitConfiguration,omitempty"` - // VirtualApplianceAsn - VirtualAppliance ASN. + // VirtualApplianceAsn - VirtualAppliance ASN. Microsoft private, public and IANA reserved ASN are not supported. VirtualApplianceAsn *int64 `json:"virtualApplianceAsn,omitempty"` // SSHPublicKey - Public key for SSH login. SSHPublicKey *string `json:"sshPublicKey,omitempty"` @@ -41445,6 +47217,12 @@ type VirtualAppliancePropertiesFormat struct { InboundSecurityRules *[]SubResource `json:"inboundSecurityRules,omitempty"` // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // DeploymentType - READ-ONLY; The deployment type. PartnerManaged for the SaaS NVA + DeploymentType *string `json:"deploymentType,omitempty"` + // Delegation - The delegation for the Virtual Appliance + Delegation *DelegationProperties `json:"delegation,omitempty"` + // PartnerManagedResource - The delegation for the Virtual Appliance + PartnerManagedResource *PartnerManagedResourceProperties `json:"partnerManagedResource,omitempty"` } // MarshalJSON is the custom marshaler for VirtualAppliancePropertiesFormat. @@ -41471,6 +47249,12 @@ func (vapf VirtualAppliancePropertiesFormat) MarshalJSON() ([]byte, error) { if vapf.SSHPublicKey != nil { objectMap["sshPublicKey"] = vapf.SSHPublicKey } + if vapf.Delegation != nil { + objectMap["delegation"] = vapf.Delegation + } + if vapf.PartnerManagedResource != nil { + objectMap["partnerManagedResource"] = vapf.PartnerManagedResource + } return json.Marshal(objectMap) } @@ -42654,6 +48438,8 @@ type VirtualHubProperties struct { BgpConnections *[]SubResource `json:"bgpConnections,omitempty"` // IPConfigurations - READ-ONLY; List of references to IpConfigurations. IPConfigurations *[]SubResource `json:"ipConfigurations,omitempty"` + // RouteMaps - READ-ONLY; List of references to RouteMaps. + RouteMaps *[]SubResource `json:"routeMaps,omitempty"` // VirtualRouterAsn - VirtualRouter ASN. VirtualRouterAsn *int64 `json:"virtualRouterAsn,omitempty"` // VirtualRouterIps - VirtualRouter IPs. @@ -42664,6 +48450,8 @@ type VirtualHubProperties struct { PreferredRoutingGateway PreferredRoutingGateway `json:"preferredRoutingGateway,omitempty"` // HubRoutingPreference - The hubRoutingPreference of this VirtualHub. Possible values include: 'HubRoutingPreferenceExpressRoute', 'HubRoutingPreferenceVpnGateway', 'HubRoutingPreferenceASPath' HubRoutingPreference HubRoutingPreference `json:"hubRoutingPreference,omitempty"` + // VirtualRouterAutoScaleConfiguration - The VirtualHub Router autoscale configuration. + VirtualRouterAutoScaleConfiguration *VirtualRouterAutoScaleConfiguration `json:"virtualRouterAutoScaleConfiguration,omitempty"` } // MarshalJSON is the custom marshaler for VirtualHubProperties. @@ -42720,6 +48508,9 @@ func (vhp VirtualHubProperties) MarshalJSON() ([]byte, error) { if vhp.HubRoutingPreference != "" { objectMap["hubRoutingPreference"] = vhp.HubRoutingPreference } + if vhp.VirtualRouterAutoScaleConfiguration != nil { + objectMap["virtualRouterAutoScaleConfiguration"] = vhp.VirtualRouterAutoScaleConfiguration + } return json.Marshal(objectMap) } @@ -43047,6 +48838,80 @@ func (future *VirtualHubsGetEffectiveVirtualHubRoutesFuture) result(client Virtu return } +// VirtualHubsGetInboundRoutesFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualHubsGetInboundRoutesFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualHubsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualHubsGetInboundRoutesFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualHubsGetInboundRoutesFuture.Result. +func (future *VirtualHubsGetInboundRoutesFuture) result(client VirtualHubsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualHubsGetInboundRoutesFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.VirtualHubsGetInboundRoutesFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualHubsGetOutboundRoutesFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualHubsGetOutboundRoutesFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualHubsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualHubsGetOutboundRoutesFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualHubsGetOutboundRoutesFuture.Result. +func (future *VirtualHubsGetOutboundRoutesFuture) result(client VirtualHubsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualHubsGetOutboundRoutesFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.VirtualHubsGetOutboundRoutesFuture") + return + } + ar.Response = future.Response() + return +} + // VirtualNetwork virtual Network resource. type VirtualNetwork struct { autorest.Response `json:"-"` @@ -43201,12 +49066,173 @@ type VirtualNetworkConnectionGatewayReference struct { ID *string `json:"id,omitempty"` } +// VirtualNetworkDdosProtectionStatusResult response for GetVirtualNetworkDdosProtectionStatusOperation. +type VirtualNetworkDdosProtectionStatusResult struct { + autorest.Response `json:"-"` + // Value - The Ddos Protection Status Result for each public ip under a virtual network. + Value *[]PublicIPDdosProtectionStatusResult `json:"value,omitempty"` + // NextLink - The URL to get the next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// VirtualNetworkDdosProtectionStatusResultIterator provides access to a complete listing of +// PublicIPDdosProtectionStatusResult values. +type VirtualNetworkDdosProtectionStatusResultIterator struct { + i int + page VirtualNetworkDdosProtectionStatusResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *VirtualNetworkDdosProtectionStatusResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkDdosProtectionStatusResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *VirtualNetworkDdosProtectionStatusResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VirtualNetworkDdosProtectionStatusResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter VirtualNetworkDdosProtectionStatusResultIterator) Response() VirtualNetworkDdosProtectionStatusResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter VirtualNetworkDdosProtectionStatusResultIterator) Value() PublicIPDdosProtectionStatusResult { + if !iter.page.NotDone() { + return PublicIPDdosProtectionStatusResult{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the VirtualNetworkDdosProtectionStatusResultIterator type. +func NewVirtualNetworkDdosProtectionStatusResultIterator(page VirtualNetworkDdosProtectionStatusResultPage) VirtualNetworkDdosProtectionStatusResultIterator { + return VirtualNetworkDdosProtectionStatusResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (vndpsr VirtualNetworkDdosProtectionStatusResult) IsEmpty() bool { + return vndpsr.Value == nil || len(*vndpsr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (vndpsr VirtualNetworkDdosProtectionStatusResult) hasNextLink() bool { + return vndpsr.NextLink != nil && len(*vndpsr.NextLink) != 0 +} + +// virtualNetworkDdosProtectionStatusResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vndpsr VirtualNetworkDdosProtectionStatusResult) virtualNetworkDdosProtectionStatusResultPreparer(ctx context.Context) (*http.Request, error) { + if !vndpsr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vndpsr.NextLink))) +} + +// VirtualNetworkDdosProtectionStatusResultPage contains a page of PublicIPDdosProtectionStatusResult +// values. +type VirtualNetworkDdosProtectionStatusResultPage struct { + fn func(context.Context, VirtualNetworkDdosProtectionStatusResult) (VirtualNetworkDdosProtectionStatusResult, error) + vndpsr VirtualNetworkDdosProtectionStatusResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *VirtualNetworkDdosProtectionStatusResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkDdosProtectionStatusResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.vndpsr) + if err != nil { + return err + } + page.vndpsr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *VirtualNetworkDdosProtectionStatusResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VirtualNetworkDdosProtectionStatusResultPage) NotDone() bool { + return !page.vndpsr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VirtualNetworkDdosProtectionStatusResultPage) Response() VirtualNetworkDdosProtectionStatusResult { + return page.vndpsr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VirtualNetworkDdosProtectionStatusResultPage) Values() []PublicIPDdosProtectionStatusResult { + if page.vndpsr.IsEmpty() { + return nil + } + return *page.vndpsr.Value +} + +// Creates a new instance of the VirtualNetworkDdosProtectionStatusResultPage type. +func NewVirtualNetworkDdosProtectionStatusResultPage(cur VirtualNetworkDdosProtectionStatusResult, getNextPage func(context.Context, VirtualNetworkDdosProtectionStatusResult) (VirtualNetworkDdosProtectionStatusResult, error)) VirtualNetworkDdosProtectionStatusResultPage { + return VirtualNetworkDdosProtectionStatusResultPage{ + fn: getNextPage, + vndpsr: cur, + } +} + // VirtualNetworkEncryption indicates if encryption is enabled on virtual network and if VM without // encryption is allowed in encrypted VNet. type VirtualNetworkEncryption struct { // Enabled - Indicates if encryption is enabled on the virtual network. Enabled *bool `json:"enabled,omitempty"` - // Enforcement - If the encrypted VNet allows VM that does not support encryption. Possible values include: 'VirtualNetworkEncryptionEnforcementDropUnencrypted', 'VirtualNetworkEncryptionEnforcementAllowUnencrypted' + // Enforcement - If the encrypted VNet allows VM that does not support encryption. Possible values include: 'DropUnencrypted', 'AllowUnencrypted' Enforcement VirtualNetworkEncryptionEnforcement `json:"enforcement,omitempty"` } @@ -43578,9 +49604,9 @@ type VirtualNetworkGatewayConnectionListEntityPropertiesFormat struct { VirtualNetworkGateway2 *VirtualNetworkConnectionGatewayReference `json:"virtualNetworkGateway2,omitempty"` // LocalNetworkGateway2 - The reference to local network gateway resource. LocalNetworkGateway2 *VirtualNetworkConnectionGatewayReference `json:"localNetworkGateway2,omitempty"` - // ConnectionType - Gateway connection type. Possible values include: 'VirtualNetworkGatewayConnectionTypeIPsec', 'VirtualNetworkGatewayConnectionTypeVnet2Vnet', 'VirtualNetworkGatewayConnectionTypeExpressRoute', 'VirtualNetworkGatewayConnectionTypeVPNClient' + // ConnectionType - Gateway connection type. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' ConnectionType VirtualNetworkGatewayConnectionType `json:"connectionType,omitempty"` - // ConnectionProtocol - Connection protocol used for this connection. Possible values include: 'VirtualNetworkGatewayConnectionProtocolIKEv2', 'VirtualNetworkGatewayConnectionProtocolIKEv1' + // ConnectionProtocol - Connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1' ConnectionProtocol VirtualNetworkGatewayConnectionProtocol `json:"connectionProtocol,omitempty"` // RoutingWeight - The routing weight. RoutingWeight *int32 `json:"routingWeight,omitempty"` @@ -43614,6 +49640,8 @@ type VirtualNetworkGatewayConnectionListEntityPropertiesFormat struct { ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // ExpressRouteGatewayBypass - Bypass ExpressRoute Gateway for data forwarding. ExpressRouteGatewayBypass *bool `json:"expressRouteGatewayBypass,omitempty"` + // EnablePrivateLinkFastPath - Bypass the ExpressRoute gateway when accessing private-links. ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. + EnablePrivateLinkFastPath *bool `json:"enablePrivateLinkFastPath,omitempty"` } // MarshalJSON is the custom marshaler for VirtualNetworkGatewayConnectionListEntityPropertiesFormat. @@ -43667,6 +49695,9 @@ func (vngclepf VirtualNetworkGatewayConnectionListEntityPropertiesFormat) Marsha if vngclepf.ExpressRouteGatewayBypass != nil { objectMap["expressRouteGatewayBypass"] = vngclepf.ExpressRouteGatewayBypass } + if vngclepf.EnablePrivateLinkFastPath != nil { + objectMap["enablePrivateLinkFastPath"] = vngclepf.EnablePrivateLinkFastPath + } return json.Marshal(objectMap) } @@ -43854,9 +49885,9 @@ type VirtualNetworkGatewayConnectionPropertiesFormat struct { IngressNatRules *[]SubResource `json:"ingressNatRules,omitempty"` // EgressNatRules - List of egress NatRules. EgressNatRules *[]SubResource `json:"egressNatRules,omitempty"` - // ConnectionType - Gateway connection type. Possible values include: 'VirtualNetworkGatewayConnectionTypeIPsec', 'VirtualNetworkGatewayConnectionTypeVnet2Vnet', 'VirtualNetworkGatewayConnectionTypeExpressRoute', 'VirtualNetworkGatewayConnectionTypeVPNClient' + // ConnectionType - Gateway connection type. Possible values include: 'IPsec', 'Vnet2Vnet', 'ExpressRoute', 'VPNClient' ConnectionType VirtualNetworkGatewayConnectionType `json:"connectionType,omitempty"` - // ConnectionProtocol - Connection protocol used for this connection. Possible values include: 'VirtualNetworkGatewayConnectionProtocolIKEv2', 'VirtualNetworkGatewayConnectionProtocolIKEv1' + // ConnectionProtocol - Connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1' ConnectionProtocol VirtualNetworkGatewayConnectionProtocol `json:"connectionProtocol,omitempty"` // RoutingWeight - The routing weight. RoutingWeight *int32 `json:"routingWeight,omitempty"` @@ -43894,6 +49925,8 @@ type VirtualNetworkGatewayConnectionPropertiesFormat struct { ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // ExpressRouteGatewayBypass - Bypass ExpressRoute Gateway for data forwarding. ExpressRouteGatewayBypass *bool `json:"expressRouteGatewayBypass,omitempty"` + // EnablePrivateLinkFastPath - Bypass the ExpressRoute gateway when accessing private-links. ExpressRoute FastPath (expressRouteGatewayBypass) must be enabled. + EnablePrivateLinkFastPath *bool `json:"enablePrivateLinkFastPath,omitempty"` } // MarshalJSON is the custom marshaler for VirtualNetworkGatewayConnectionPropertiesFormat. @@ -43959,6 +49992,9 @@ func (vngcpf VirtualNetworkGatewayConnectionPropertiesFormat) MarshalJSON() ([]b if vngcpf.ExpressRouteGatewayBypass != nil { objectMap["expressRouteGatewayBypass"] = vngcpf.ExpressRouteGatewayBypass } + if vngcpf.EnablePrivateLinkFastPath != nil { + objectMap["enablePrivateLinkFastPath"] = vngcpf.EnablePrivateLinkFastPath + } return json.Marshal(objectMap) } @@ -44417,7 +50453,7 @@ func (vngic *VirtualNetworkGatewayIPConfiguration) UnmarshalJSON(body []byte) er // VirtualNetworkGatewayIPConfigurationPropertiesFormat properties of VirtualNetworkGatewayIPConfiguration. type VirtualNetworkGatewayIPConfigurationPropertiesFormat struct { - // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'IPAllocationMethodStatic', 'IPAllocationMethodDynamic' + // PrivateIPAllocationMethod - The private IP address allocation method. Possible values include: 'Static', 'Dynamic' PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` // Subnet - The reference to the subnet resource. Subnet *SubResource `json:"subnet,omitempty"` @@ -44880,7 +50916,7 @@ type VirtualNetworkGatewayNatRuleProperties struct { ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // Type - The type of NAT rule for VPN NAT. Possible values include: 'VpnNatRuleTypeStatic', 'VpnNatRuleTypeDynamic' Type VpnNatRuleType `json:"type,omitempty"` - // Mode - The Source NAT direction of a VPN NAT. Possible values include: 'VpnNatRuleModeEgressSnat', 'VpnNatRuleModeIngressSnat' + // Mode - The Source NAT direction of a VPN NAT. Possible values include: 'EgressSnat', 'IngressSnat' Mode VpnNatRuleMode `json:"mode,omitempty"` // InternalMappings - The private IP address internal mapping for NAT. InternalMappings *[]VpnNatRuleMapping `json:"internalMappings,omitempty"` @@ -44991,13 +51027,130 @@ func (future *VirtualNetworkGatewayNatRulesDeleteFuture) result(client VirtualNe return } +// VirtualNetworkGatewayPolicyGroup parameters for VirtualNetworkGatewayPolicyGroup. +type VirtualNetworkGatewayPolicyGroup struct { + // VirtualNetworkGatewayPolicyGroupProperties - Properties of tVirtualNetworkGatewayPolicyGroup. + *VirtualNetworkGatewayPolicyGroupProperties `json:"properties,omitempty"` + // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string `json:"name,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualNetworkGatewayPolicyGroup. +func (vngpg VirtualNetworkGatewayPolicyGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vngpg.VirtualNetworkGatewayPolicyGroupProperties != nil { + objectMap["properties"] = vngpg.VirtualNetworkGatewayPolicyGroupProperties + } + if vngpg.Name != nil { + objectMap["name"] = vngpg.Name + } + if vngpg.ID != nil { + objectMap["id"] = vngpg.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualNetworkGatewayPolicyGroup struct. +func (vngpg *VirtualNetworkGatewayPolicyGroup) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var virtualNetworkGatewayPolicyGroupProperties VirtualNetworkGatewayPolicyGroupProperties + err = json.Unmarshal(*v, &virtualNetworkGatewayPolicyGroupProperties) + if err != nil { + return err + } + vngpg.VirtualNetworkGatewayPolicyGroupProperties = &virtualNetworkGatewayPolicyGroupProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vngpg.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + vngpg.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vngpg.ID = &ID + } + } + } + + return nil +} + +// VirtualNetworkGatewayPolicyGroupMember vpn Client Connection configuration PolicyGroup member +type VirtualNetworkGatewayPolicyGroupMember struct { + // Name - Name of the VirtualNetworkGatewayPolicyGroupMember. + Name *string `json:"name,omitempty"` + // AttributeType - The Vpn Policy member attribute type. Possible values include: 'CertificateGroupID', 'AADGroupID', 'RadiusAzureGroupID' + AttributeType VpnPolicyMemberAttributeType `json:"attributeType,omitempty"` + // AttributeValue - The value of Attribute used for this VirtualNetworkGatewayPolicyGroupMember. + AttributeValue *string `json:"attributeValue,omitempty"` +} + +// VirtualNetworkGatewayPolicyGroupProperties properties of VirtualNetworkGatewayPolicyGroup. +type VirtualNetworkGatewayPolicyGroupProperties struct { + // IsDefault - Shows if this is a Default VirtualNetworkGatewayPolicyGroup or not. + IsDefault *bool `json:"isDefault,omitempty"` + // Priority - Priority for VirtualNetworkGatewayPolicyGroup. + Priority *int32 `json:"priority,omitempty"` + // PolicyMembers - Multiple PolicyMembers for VirtualNetworkGatewayPolicyGroup. + PolicyMembers *[]VirtualNetworkGatewayPolicyGroupMember `json:"policyMembers,omitempty"` + // VngClientConnectionConfigurations - READ-ONLY; List of references to vngClientConnectionConfigurations. + VngClientConnectionConfigurations *[]SubResource `json:"vngClientConnectionConfigurations,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the VirtualNetworkGatewayPolicyGroup resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualNetworkGatewayPolicyGroupProperties. +func (vngpgp VirtualNetworkGatewayPolicyGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vngpgp.IsDefault != nil { + objectMap["isDefault"] = vngpgp.IsDefault + } + if vngpgp.Priority != nil { + objectMap["priority"] = vngpgp.Priority + } + if vngpgp.PolicyMembers != nil { + objectMap["policyMembers"] = vngpgp.PolicyMembers + } + return json.Marshal(objectMap) +} + // VirtualNetworkGatewayPropertiesFormat virtualNetworkGateway properties. type VirtualNetworkGatewayPropertiesFormat struct { // IPConfigurations - IP configurations for virtual network gateway. IPConfigurations *[]VirtualNetworkGatewayIPConfiguration `json:"ipConfigurations,omitempty"` // GatewayType - The type of this virtual network gateway. Possible values include: 'VirtualNetworkGatewayTypeVpn', 'VirtualNetworkGatewayTypeExpressRoute', 'VirtualNetworkGatewayTypeLocalGateway' GatewayType VirtualNetworkGatewayType `json:"gatewayType,omitempty"` - // VpnType - The type of this virtual network gateway. Possible values include: 'VpnTypePolicyBased', 'VpnTypeRouteBased' + // VpnType - The type of this virtual network gateway. Possible values include: 'PolicyBased', 'RouteBased' VpnType VpnType `json:"vpnType,omitempty"` // VpnGatewayGeneration - The generation for this VirtualNetworkGateway. Must be None if gatewayType is not VPN. Possible values include: 'VpnGatewayGenerationNone', 'VpnGatewayGenerationGeneration1', 'VpnGatewayGenerationGeneration2' VpnGatewayGeneration VpnGatewayGeneration `json:"vpnGatewayGeneration,omitempty"` @@ -45015,6 +51168,8 @@ type VirtualNetworkGatewayPropertiesFormat struct { Sku *VirtualNetworkGatewaySku `json:"sku,omitempty"` // VpnClientConfiguration - The reference to the VpnClientConfiguration resource which represents the P2S VpnClient configurations. VpnClientConfiguration *VpnClientConfiguration `json:"vpnClientConfiguration,omitempty"` + // VirtualNetworkGatewayPolicyGroups - The reference to the VirtualNetworkGatewayPolicyGroup resource which represents the available VirtualNetworkGatewayPolicyGroup for the gateway. + VirtualNetworkGatewayPolicyGroups *[]VirtualNetworkGatewayPolicyGroup `json:"virtualNetworkGatewayPolicyGroups,omitempty"` // BgpSettings - Virtual network gateway's BGP speaker settings. BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` // CustomRoutes - The reference to the address space resource which represents the custom routes address space specified by the customer for virtual network gateway and VpnClient. @@ -45033,6 +51188,10 @@ type VirtualNetworkGatewayPropertiesFormat struct { NatRules *[]VirtualNetworkGatewayNatRule `json:"natRules,omitempty"` // EnableBgpRouteTranslationForNat - EnableBgpRouteTranslationForNat flag. EnableBgpRouteTranslationForNat *bool `json:"enableBgpRouteTranslationForNat,omitempty"` + // AllowVirtualWanTraffic - Configures this gateway to accept traffic from remote Virtual WAN networks. + AllowVirtualWanTraffic *bool `json:"allowVirtualWanTraffic,omitempty"` + // AllowRemoteVnetTraffic - Configure this gateway to accept traffic from other Azure Virtual Networks. This configuration does not support connectivity to Azure Virtual WAN. + AllowRemoteVnetTraffic *bool `json:"allowRemoteVnetTraffic,omitempty"` } // MarshalJSON is the custom marshaler for VirtualNetworkGatewayPropertiesFormat. @@ -45071,6 +51230,9 @@ func (vngpf VirtualNetworkGatewayPropertiesFormat) MarshalJSON() ([]byte, error) if vngpf.VpnClientConfiguration != nil { objectMap["vpnClientConfiguration"] = vngpf.VpnClientConfiguration } + if vngpf.VirtualNetworkGatewayPolicyGroups != nil { + objectMap["virtualNetworkGatewayPolicyGroups"] = vngpf.VirtualNetworkGatewayPolicyGroups + } if vngpf.BgpSettings != nil { objectMap["bgpSettings"] = vngpf.BgpSettings } @@ -45089,6 +51251,12 @@ func (vngpf VirtualNetworkGatewayPropertiesFormat) MarshalJSON() ([]byte, error) if vngpf.EnableBgpRouteTranslationForNat != nil { objectMap["enableBgpRouteTranslationForNat"] = vngpf.EnableBgpRouteTranslationForNat } + if vngpf.AllowVirtualWanTraffic != nil { + objectMap["allowVirtualWanTraffic"] = vngpf.AllowVirtualWanTraffic + } + if vngpf.AllowRemoteVnetTraffic != nil { + objectMap["allowRemoteVnetTraffic"] = vngpf.AllowRemoteVnetTraffic + } return json.Marshal(objectMap) } @@ -46431,7 +52599,7 @@ type VirtualNetworkPeeringPropertiesFormat struct { RemoteVirtualNetworkEncryption *VirtualNetworkEncryption `json:"remoteVirtualNetworkEncryption,omitempty"` // PeeringState - The status of the virtual network peering. Possible values include: 'VirtualNetworkPeeringStateInitiated', 'VirtualNetworkPeeringStateConnected', 'VirtualNetworkPeeringStateDisconnected' PeeringState VirtualNetworkPeeringState `json:"peeringState,omitempty"` - // PeeringSyncLevel - The peering sync status of the virtual network peering. Possible values include: 'VirtualNetworkPeeringLevelFullyInSync', 'VirtualNetworkPeeringLevelRemoteNotInSync', 'VirtualNetworkPeeringLevelLocalNotInSync', 'VirtualNetworkPeeringLevelLocalAndRemoteNotInSync' + // PeeringSyncLevel - The peering sync status of the virtual network peering. Possible values include: 'FullyInSync', 'RemoteNotInSync', 'LocalNotInSync', 'LocalAndRemoteNotInSync' PeeringSyncLevel VirtualNetworkPeeringLevel `json:"peeringSyncLevel,omitempty"` // ProvisioningState - READ-ONLY; The provisioning state of the virtual network peering resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` @@ -46709,6 +52877,92 @@ func (future *VirtualNetworksDeleteFuture) result(client VirtualNetworksClient) return } +// VirtualNetworksListDdosProtectionStatusAllFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type VirtualNetworksListDdosProtectionStatusAllFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualNetworksClient) (VirtualNetworkDdosProtectionStatusResultPage, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualNetworksListDdosProtectionStatusAllFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualNetworksListDdosProtectionStatusAllFuture.Result. +func (future *VirtualNetworksListDdosProtectionStatusAllFuture) result(client VirtualNetworksClient) (vndpsrp VirtualNetworkDdosProtectionStatusResultPage, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworksListDdosProtectionStatusAllFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vndpsrp.vndpsr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.VirtualNetworksListDdosProtectionStatusAllFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vndpsrp.vndpsr.Response.Response, err = future.GetResult(sender); err == nil && vndpsrp.vndpsr.Response.Response.StatusCode != http.StatusNoContent { + vndpsrp, err = client.ListDdosProtectionStatusResponder(vndpsrp.vndpsr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworksListDdosProtectionStatusAllFuture", "Result", vndpsrp.vndpsr.Response.Response, "Failure responding to request") + } + } + return +} + +// VirtualNetworksListDdosProtectionStatusFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type VirtualNetworksListDdosProtectionStatusFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualNetworksClient) (VirtualNetworkDdosProtectionStatusResultPage, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualNetworksListDdosProtectionStatusFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualNetworksListDdosProtectionStatusFuture.Result. +func (future *VirtualNetworksListDdosProtectionStatusFuture) result(client VirtualNetworksClient) (vndpsrp VirtualNetworkDdosProtectionStatusResultPage, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworksListDdosProtectionStatusFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + vndpsrp.vndpsr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("network.VirtualNetworksListDdosProtectionStatusFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if vndpsrp.vndpsr.Response.Response, err = future.GetResult(sender); err == nil && vndpsrp.vndpsr.Response.Response.StatusCode != http.StatusNoContent { + vndpsrp, err = client.ListDdosProtectionStatusResponder(vndpsrp.vndpsr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworksListDdosProtectionStatusFuture", "Result", vndpsrp.vndpsr.Response.Response, "Failure responding to request") + } + } + return +} + // VirtualNetworkTap virtual Network Tap resource. type VirtualNetworkTap struct { autorest.Response `json:"-"` @@ -47243,6 +53497,12 @@ func (vr *VirtualRouter) UnmarshalJSON(body []byte) error { return nil } +// VirtualRouterAutoScaleConfiguration the VirtualHub Router autoscale configuration. +type VirtualRouterAutoScaleConfiguration struct { + // MinCapacity - The minimum number of scale units for VirtualHub Router. + MinCapacity *int32 `json:"minCapacity,omitempty"` +} + // VirtualRouterListResult response for ListVirtualRouters API service call. type VirtualRouterListResult struct { autorest.Response `json:"-"` @@ -48110,7 +54370,7 @@ type VirtualWanSecurityProvider struct { Name *string `json:"name,omitempty"` // URL - Url of the security provider. URL *string `json:"url,omitempty"` - // Type - Name of the security provider. Possible values include: 'VirtualWanSecurityProviderTypeExternal', 'VirtualWanSecurityProviderTypeNative' + // Type - Name of the security provider. Possible values include: 'External', 'Native' Type VirtualWanSecurityProviderType `json:"type,omitempty"` } @@ -48125,7 +54385,7 @@ type VirtualWanSecurityProviders struct { type VirtualWanVpnProfileParameters struct { // VpnServerConfigurationResourceID - VpnServerConfiguration partial resource uri with which VirtualWan is associated to. VpnServerConfigurationResourceID *string `json:"vpnServerConfigurationResourceId,omitempty"` - // AuthenticationMethod - VPN client authentication method. Possible values include: 'AuthenticationMethodEAPTLS', 'AuthenticationMethodEAPMSCHAPv2' + // AuthenticationMethod - VPN client authentication method. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' AuthenticationMethod AuthenticationMethod `json:"authenticationMethod,omitempty"` } @@ -48160,6 +54420,8 @@ func (vVar VM) MarshalJSON() ([]byte, error) { // VnetRoute list of routes that control routing from VirtualHub into a virtual network connection. type VnetRoute struct { + // StaticRoutesConfig - Configuration for static routes on this HubVnetConnection. + StaticRoutesConfig *StaticRoutesConfig `json:"staticRoutesConfig,omitempty"` // StaticRoutes - List of all Static Routes. StaticRoutes *[]StaticRoute `json:"staticRoutes,omitempty"` // BgpConnections - READ-ONLY; The list of references to HubBgpConnection objects. @@ -48169,12 +54431,116 @@ type VnetRoute struct { // MarshalJSON is the custom marshaler for VnetRoute. func (vr VnetRoute) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + if vr.StaticRoutesConfig != nil { + objectMap["staticRoutesConfig"] = vr.StaticRoutesConfig + } if vr.StaticRoutes != nil { objectMap["staticRoutes"] = vr.StaticRoutes } return json.Marshal(objectMap) } +// VngClientConnectionConfiguration a vpn client connection configuration for client connection +// configuration. +type VngClientConnectionConfiguration struct { + // VngClientConnectionConfigurationProperties - Properties of the vpn client root certificate. + *VngClientConnectionConfigurationProperties `json:"properties,omitempty"` + // Name - The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string `json:"name,omitempty"` + // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for VngClientConnectionConfiguration. +func (vccc VngClientConnectionConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vccc.VngClientConnectionConfigurationProperties != nil { + objectMap["properties"] = vccc.VngClientConnectionConfigurationProperties + } + if vccc.Name != nil { + objectMap["name"] = vccc.Name + } + if vccc.ID != nil { + objectMap["id"] = vccc.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VngClientConnectionConfiguration struct. +func (vccc *VngClientConnectionConfiguration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var vngClientConnectionConfigurationProperties VngClientConnectionConfigurationProperties + err = json.Unmarshal(*v, &vngClientConnectionConfigurationProperties) + if err != nil { + return err + } + vccc.VngClientConnectionConfigurationProperties = &vngClientConnectionConfigurationProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vccc.Name = &name + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + vccc.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vccc.ID = &ID + } + } + } + + return nil +} + +// VngClientConnectionConfigurationProperties properties of VngClientConnectionConfiguration. +type VngClientConnectionConfigurationProperties struct { + // VpnClientAddressPool - The reference to the address space resource which represents Address space for P2S VpnClient. + VpnClientAddressPool *AddressSpace `json:"vpnClientAddressPool,omitempty"` + // VirtualNetworkGatewayPolicyGroups - List of references to virtualNetworkGatewayPolicyGroups + VirtualNetworkGatewayPolicyGroups *[]SubResource `json:"virtualNetworkGatewayPolicyGroups,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the VngClientConnectionConfiguration resource. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateFailed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for VngClientConnectionConfigurationProperties. +func (vcccp VngClientConnectionConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vcccp.VpnClientAddressPool != nil { + objectMap["vpnClientAddressPool"] = vcccp.VpnClientAddressPool + } + if vcccp.VirtualNetworkGatewayPolicyGroups != nil { + objectMap["virtualNetworkGatewayPolicyGroups"] = vcccp.VirtualNetworkGatewayPolicyGroups + } + return json.Marshal(objectMap) +} + // VpnClientConfiguration vpnClientConfiguration for P2S client. type VpnClientConfiguration struct { // VpnClientAddressPool - The reference to the address space resource which represents Address space for P2S VpnClient. @@ -48201,6 +54567,8 @@ type VpnClientConfiguration struct { AadAudience *string `json:"aadAudience,omitempty"` // AadIssuer - The AADIssuer property of the VirtualNetworkGateway resource for vpn client connection used for AAD authentication. AadIssuer *string `json:"aadIssuer,omitempty"` + // VngClientConnectionConfigurations - per ip address pool connection policy for virtual network gateway P2S client. + VngClientConnectionConfigurations *[]VngClientConnectionConfiguration `json:"vngClientConnectionConfigurations,omitempty"` } // VpnClientConnectionHealth vpnClientConnectionHealth properties. @@ -48279,7 +54647,7 @@ type VpnClientIPsecParameters struct { IpsecEncryption IpsecEncryption `json:"ipsecEncryption,omitempty"` // IpsecIntegrity - The IPSec integrity algorithm (IKE phase 1). Possible values include: 'IpsecIntegrityMD5', 'IpsecIntegritySHA1', 'IpsecIntegritySHA256', 'IpsecIntegrityGCMAES128', 'IpsecIntegrityGCMAES192', 'IpsecIntegrityGCMAES256' IpsecIntegrity IpsecIntegrity `json:"ipsecIntegrity,omitempty"` - // IkeEncryption - The IKE encryption algorithm (IKE phase 2). Possible values include: 'IkeEncryptionDES', 'IkeEncryptionDES3', 'IkeEncryptionAES128', 'IkeEncryptionAES192', 'IkeEncryptionAES256', 'IkeEncryptionGCMAES256', 'IkeEncryptionGCMAES128' + // IkeEncryption - The IKE encryption algorithm (IKE phase 2). Possible values include: 'DES', 'DES3', 'AES128', 'AES192', 'AES256', 'GCMAES256', 'GCMAES128' IkeEncryption IkeEncryption `json:"ikeEncryption,omitempty"` // IkeIntegrity - The IKE integrity algorithm (IKE phase 2). Possible values include: 'IkeIntegrityMD5', 'IkeIntegritySHA1', 'IkeIntegritySHA256', 'IkeIntegritySHA384', 'IkeIntegrityGCMAES256', 'IkeIntegrityGCMAES128' IkeIntegrity IkeIntegrity `json:"ikeIntegrity,omitempty"` @@ -48291,9 +54659,9 @@ type VpnClientIPsecParameters struct { // VpnClientParameters vpn Client Parameters for package generation. type VpnClientParameters struct { - // ProcessorArchitecture - VPN client Processor Architecture. Possible values include: 'ProcessorArchitectureAmd64', 'ProcessorArchitectureX86' + // ProcessorArchitecture - VPN client Processor Architecture. Possible values include: 'Amd64', 'X86' ProcessorArchitecture ProcessorArchitecture `json:"processorArchitecture,omitempty"` - // AuthenticationMethod - VPN client authentication method. Possible values include: 'AuthenticationMethodEAPTLS', 'AuthenticationMethodEAPMSCHAPv2' + // AuthenticationMethod - VPN client authentication method. Possible values include: 'EAPTLS', 'EAPMSCHAPv2' AuthenticationMethod AuthenticationMethod `json:"authenticationMethod,omitempty"` // RadiusServerAuthCertificate - The public certificate data for the radius server authentication certificate as a Base-64 encoded string. Required only if external radius authentication has been configured with EAPTLS authentication. RadiusServerAuthCertificate *string `json:"radiusServerAuthCertificate,omitempty"` @@ -48599,7 +54967,7 @@ type VpnConnectionProperties struct { DpdTimeoutSeconds *int32 `json:"dpdTimeoutSeconds,omitempty"` // ConnectionStatus - The connection status. Possible values include: 'VpnConnectionStatusUnknown', 'VpnConnectionStatusConnecting', 'VpnConnectionStatusConnected', 'VpnConnectionStatusNotConnected' ConnectionStatus VpnConnectionStatus `json:"connectionStatus,omitempty"` - // VpnConnectionProtocolType - Connection protocol used for this connection. Possible values include: 'VirtualNetworkGatewayConnectionProtocolIKEv2', 'VirtualNetworkGatewayConnectionProtocolIKEv1' + // VpnConnectionProtocolType - Connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1' VpnConnectionProtocolType VirtualNetworkGatewayConnectionProtocol `json:"vpnConnectionProtocolType,omitempty"` // IngressBytesTransferred - READ-ONLY; Ingress bytes transferred. IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` @@ -49082,7 +55450,7 @@ type VpnGatewayNatRuleProperties struct { ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // Type - The type of NAT rule for VPN NAT. Possible values include: 'VpnNatRuleTypeStatic', 'VpnNatRuleTypeDynamic' Type VpnNatRuleType `json:"type,omitempty"` - // Mode - The Source NAT direction of a VPN NAT. Possible values include: 'VpnNatRuleModeEgressSnat', 'VpnNatRuleModeIngressSnat' + // Mode - The Source NAT direction of a VPN NAT. Possible values include: 'EgressSnat', 'IngressSnat' Mode VpnNatRuleMode `json:"mode,omitempty"` // InternalMappings - The private IP address internal mapping for NAT. InternalMappings *[]VpnNatRuleMapping `json:"internalMappings,omitempty"` @@ -49780,7 +56148,7 @@ func (vscpg *VpnServerConfigurationPolicyGroup) UnmarshalJSON(body []byte) error type VpnServerConfigurationPolicyGroupMember struct { // Name - Name of the VpnServerConfigurationPolicyGroupMember. Name *string `json:"name,omitempty"` - // AttributeType - The Vpn Policy member attribute type. Possible values include: 'VpnPolicyMemberAttributeTypeCertificateGroupID', 'VpnPolicyMemberAttributeTypeAADGroupID', 'VpnPolicyMemberAttributeTypeRadiusAzureGroupID' + // AttributeType - The Vpn Policy member attribute type. Possible values include: 'CertificateGroupID', 'AADGroupID', 'RadiusAzureGroupID' AttributeType VpnPolicyMemberAttributeType `json:"attributeType,omitempty"` // AttributeValue - The value of Attribute used for this VpnServerConfigurationPolicyGroupMember. AttributeValue *string `json:"attributeValue,omitempty"` @@ -50361,7 +56729,7 @@ type VpnSiteLinkConnectionProperties struct { VpnLinkConnectionMode VpnLinkConnectionMode `json:"vpnLinkConnectionMode,omitempty"` // ConnectionStatus - The connection status. Possible values include: 'VpnConnectionStatusUnknown', 'VpnConnectionStatusConnecting', 'VpnConnectionStatusConnected', 'VpnConnectionStatusNotConnected' ConnectionStatus VpnConnectionStatus `json:"connectionStatus,omitempty"` - // VpnConnectionProtocolType - Connection protocol used for this connection. Possible values include: 'VirtualNetworkGatewayConnectionProtocolIKEv2', 'VirtualNetworkGatewayConnectionProtocolIKEv1' + // VpnConnectionProtocolType - Connection protocol used for this connection. Possible values include: 'IKEv2', 'IKEv1' VpnConnectionProtocolType VirtualNetworkGatewayConnectionProtocol `json:"vpnConnectionProtocolType,omitempty"` // IngressBytesTransferred - READ-ONLY; Ingress bytes transferred. IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/natgateways.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/natgateways.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/natgateways.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/natgateways.go index 83c7d146cab1..b64e8d6210ce 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/natgateways.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/natgateways.go @@ -69,7 +69,7 @@ func (client NatGatewaysClient) CreateOrUpdatePreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -151,7 +151,7 @@ func (client NatGatewaysClient) DeletePreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -237,7 +237,7 @@ func (client NatGatewaysClient) GetPreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -319,7 +319,7 @@ func (client NatGatewaysClient) ListPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -432,7 +432,7 @@ func (client NatGatewaysClient) ListAllPreparer(ctx context.Context) (*http.Requ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -546,7 +546,7 @@ func (client NatGatewaysClient) UpdateTagsPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/natrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/natrules.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/natrules.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/natrules.go index cff3437cc005..4def3d0c5e99 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/natrules.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/natrules.go @@ -71,7 +71,7 @@ func (client NatRulesClient) CreateOrUpdatePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -156,7 +156,7 @@ func (client NatRulesClient) DeletePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -243,7 +243,7 @@ func (client NatRulesClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -324,7 +324,7 @@ func (client NatRulesClient) ListByVpnGatewayPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/operations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/operations.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/operations.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/operations.go index 675cac56998a..3c3c885537af 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/operations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/operations.go @@ -71,7 +71,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe // ListPreparer prepares the List request. func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/p2svpngateways.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/p2svpngateways.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/p2svpngateways.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/p2svpngateways.go index 8c8e673466a1..446ce1cafd36 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/p2svpngateways.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/p2svpngateways.go @@ -69,7 +69,7 @@ func (client P2sVpnGatewaysClient) CreateOrUpdatePreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -151,7 +151,7 @@ func (client P2sVpnGatewaysClient) DeletePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -231,7 +231,7 @@ func (client P2sVpnGatewaysClient) DisconnectP2sVpnConnectionsPreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -312,7 +312,7 @@ func (client P2sVpnGatewaysClient) GenerateVpnProfilePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -400,7 +400,7 @@ func (client P2sVpnGatewaysClient) GetPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -470,7 +470,7 @@ func (client P2sVpnGatewaysClient) GetP2sVpnConnectionHealthPreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -551,7 +551,7 @@ func (client P2sVpnGatewaysClient) GetP2sVpnConnectionHealthDetailedPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -639,7 +639,7 @@ func (client P2sVpnGatewaysClient) ListPreparer(ctx context.Context) (*http.Requ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -755,7 +755,7 @@ func (client P2sVpnGatewaysClient) ListByResourceGroupPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -861,7 +861,7 @@ func (client P2sVpnGatewaysClient) ResetPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -941,7 +941,7 @@ func (client P2sVpnGatewaysClient) UpdateTagsPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/packetcaptures.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/packetcaptures.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/packetcaptures.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/packetcaptures.go index 3e74bd4af098..d6998421def3 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/packetcaptures.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/packetcaptures.go @@ -93,7 +93,7 @@ func (client PacketCapturesClient) CreatePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -176,7 +176,7 @@ func (client PacketCapturesClient) DeletePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -263,7 +263,7 @@ func (client PacketCapturesClient) GetPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -334,7 +334,7 @@ func (client PacketCapturesClient) GetStatusPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -420,7 +420,7 @@ func (client PacketCapturesClient) ListPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -491,7 +491,7 @@ func (client PacketCapturesClient) StopPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/peerexpressroutecircuitconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/peerexpressroutecircuitconnections.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/peerexpressroutecircuitconnections.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/peerexpressroutecircuitconnections.go index 09c06f561610..dca72d3ce71b 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/peerexpressroutecircuitconnections.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/peerexpressroutecircuitconnections.go @@ -81,7 +81,7 @@ func (client PeerExpressRouteCircuitConnectionsClient) GetPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -164,7 +164,7 @@ func (client PeerExpressRouteCircuitConnectionsClient) ListPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/privatednszonegroups.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/privatednszonegroups.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/privatednszonegroups.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/privatednszonegroups.go index b0baed9f4b84..362708731bc8 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/privatednszonegroups.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/privatednszonegroups.go @@ -72,7 +72,7 @@ func (client PrivateDNSZoneGroupsClient) CreateOrUpdatePreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -156,7 +156,7 @@ func (client PrivateDNSZoneGroupsClient) DeletePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -243,7 +243,7 @@ func (client PrivateDNSZoneGroupsClient) GetPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -324,7 +324,7 @@ func (client PrivateDNSZoneGroupsClient) ListPreparer(ctx context.Context, priva "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/privateendpoints.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/privateendpoints.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/privateendpoints.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/privateendpoints.go index d42061efab6f..f85e9b302271 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/privateendpoints.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/privateendpoints.go @@ -70,7 +70,7 @@ func (client PrivateEndpointsClient) CreateOrUpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -152,7 +152,7 @@ func (client PrivateEndpointsClient) DeletePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -238,7 +238,7 @@ func (client PrivateEndpointsClient) GetPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -320,7 +320,7 @@ func (client PrivateEndpointsClient) ListPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -433,7 +433,7 @@ func (client PrivateEndpointsClient) ListBySubscriptionPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/privatelinkservices.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/privatelinkservices.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/privatelinkservices.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/privatelinkservices.go index a7610b5b9eb3..15ddba895db5 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/privatelinkservices.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/privatelinkservices.go @@ -68,7 +68,7 @@ func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityPrepare "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -151,7 +151,7 @@ func (client PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityByResou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -233,7 +233,7 @@ func (client PrivateLinkServicesClient) CreateOrUpdatePreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -315,7 +315,7 @@ func (client PrivateLinkServicesClient) DeletePreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -395,7 +395,7 @@ func (client PrivateLinkServicesClient) DeletePrivateEndpointConnectionPreparer( "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -481,7 +481,7 @@ func (client PrivateLinkServicesClient) GetPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -564,7 +564,7 @@ func (client PrivateLinkServicesClient) GetPrivateEndpointConnectionPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -646,7 +646,7 @@ func (client PrivateLinkServicesClient) ListPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -763,7 +763,7 @@ func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesPrepa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -882,7 +882,7 @@ func (client PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesByRes "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -995,7 +995,7 @@ func (client PrivateLinkServicesClient) ListBySubscriptionPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1113,7 +1113,7 @@ func (client PrivateLinkServicesClient) ListPrivateEndpointConnectionsPreparer(c "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1230,7 +1230,7 @@ func (client PrivateLinkServicesClient) UpdatePrivateEndpointConnectionPreparer( "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/profiles.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/profiles.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/profiles.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/profiles.go index b8b34572aced..59e825dab152 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/profiles.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/profiles.go @@ -76,7 +76,7 @@ func (client ProfilesClient) CreateOrUpdatePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -148,7 +148,7 @@ func (client ProfilesClient) DeletePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -234,7 +234,7 @@ func (client ProfilesClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -316,7 +316,7 @@ func (client ProfilesClient) ListPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -429,7 +429,7 @@ func (client ProfilesClient) ListAllPreparer(ctx context.Context) (*http.Request "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -543,7 +543,7 @@ func (client ProfilesClient) UpdateTagsPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/publicipaddresses.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/publicipaddresses.go similarity index 93% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/publicipaddresses.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/publicipaddresses.go index 6056b28902b1..1e29520f8606 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/publicipaddresses.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/publicipaddresses.go @@ -84,7 +84,7 @@ func (client PublicIPAddressesClient) CreateOrUpdatePreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -128,6 +128,85 @@ func (client PublicIPAddressesClient) CreateOrUpdateResponder(resp *http.Respons return } +// DdosProtectionStatus gets the Ddos Protection Status of a Public IP Address +// Parameters: +// resourceGroupName - the name of the resource group. +// publicIPAddressName - the name of the public IP address. +func (client PublicIPAddressesClient) DdosProtectionStatus(ctx context.Context, resourceGroupName string, publicIPAddressName string) (result PublicIPAddressesDdosProtectionStatusFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PublicIPAddressesClient.DdosProtectionStatus") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DdosProtectionStatusPreparer(ctx, resourceGroupName, publicIPAddressName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "DdosProtectionStatus", nil, "Failure preparing request") + return + } + + result, err = client.DdosProtectionStatusSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "DdosProtectionStatus", result.Response(), "Failure sending request") + return + } + + return +} + +// DdosProtectionStatusPreparer prepares the DdosProtectionStatus request. +func (client PublicIPAddressesClient) DdosProtectionStatusPreparer(ctx context.Context, resourceGroupName string, publicIPAddressName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "publicIpAddressName": autorest.Encode("path", publicIPAddressName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}/ddosProtectionStatus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DdosProtectionStatusSender sends the DdosProtectionStatus request. The method will close the +// http.Response Body if it receives an error. +func (client PublicIPAddressesClient) DdosProtectionStatusSender(req *http.Request) (future PublicIPAddressesDdosProtectionStatusFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DdosProtectionStatusResponder handles the response to the DdosProtectionStatus request. The method always +// closes the http.Response Body. +func (client PublicIPAddressesClient) DdosProtectionStatusResponder(resp *http.Response) (result PublicIPDdosProtectionStatusResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // Delete deletes the specified public IP address. // Parameters: // resourceGroupName - the name of the resource group. @@ -166,7 +245,7 @@ func (client PublicIPAddressesClient) DeletePreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -252,7 +331,7 @@ func (client PublicIPAddressesClient) GetPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -340,7 +419,7 @@ func (client PublicIPAddressesClient) GetCloudServicePublicIPAddressPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-30" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -428,7 +507,7 @@ func (client PublicIPAddressesClient) GetVirtualMachineScaleSetPublicIPAddressPr "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), } - const APIVersion = "2017-03-30" + const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -510,7 +589,7 @@ func (client PublicIPAddressesClient) ListPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -623,7 +702,7 @@ func (client PublicIPAddressesClient) ListAllPreparer(ctx context.Context) (*htt "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -741,7 +820,7 @@ func (client PublicIPAddressesClient) ListCloudServicePublicIPAddressesPreparer( "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-30" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -866,7 +945,7 @@ func (client PublicIPAddressesClient) ListCloudServiceRoleInstancePublicIPAddres "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-30" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -985,7 +1064,7 @@ func (client PublicIPAddressesClient) ListVirtualMachineScaleSetPublicIPAddresse "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), } - const APIVersion = "2017-03-30" + const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1110,7 +1189,7 @@ func (client PublicIPAddressesClient) ListVirtualMachineScaleSetVMPublicIPAddres "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), } - const APIVersion = "2017-03-30" + const APIVersion = "2018-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1224,7 +1303,7 @@ func (client PublicIPAddressesClient) UpdateTagsPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/publicipprefixes.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/publicipprefixes.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/publicipprefixes.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/publicipprefixes.go index 5d7a29762114..4b076abe551d 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/publicipprefixes.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/publicipprefixes.go @@ -70,7 +70,7 @@ func (client PublicIPPrefixesClient) CreateOrUpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -152,7 +152,7 @@ func (client PublicIPPrefixesClient) DeletePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -238,7 +238,7 @@ func (client PublicIPPrefixesClient) GetPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -320,7 +320,7 @@ func (client PublicIPPrefixesClient) ListPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -433,7 +433,7 @@ func (client PublicIPPrefixesClient) ListAllPreparer(ctx context.Context) (*http "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -547,7 +547,7 @@ func (client PublicIPPrefixesClient) UpdateTagsPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/resourcenavigationlinks.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/resourcenavigationlinks.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/resourcenavigationlinks.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/resourcenavigationlinks.go index ea9b569fd717..0ac79d4c49e0 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/resourcenavigationlinks.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/resourcenavigationlinks.go @@ -78,7 +78,7 @@ func (client ResourceNavigationLinksClient) ListPreparer(ctx context.Context, re "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/routefilterrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routefilterrules.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/routefilterrules.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routefilterrules.go index 2f76f810a30f..179b1a7cb287 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/routefilterrules.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routefilterrules.go @@ -82,7 +82,7 @@ func (client RouteFilterRulesClient) CreateOrUpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -166,7 +166,7 @@ func (client RouteFilterRulesClient) DeletePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -253,7 +253,7 @@ func (client RouteFilterRulesClient) GetPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -334,7 +334,7 @@ func (client RouteFilterRulesClient) ListByRouteFilterPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/routefilters.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routefilters.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/routefilters.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routefilters.go index b809ebd7944c..2f6a25f21b94 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/routefilters.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routefilters.go @@ -69,7 +69,7 @@ func (client RouteFiltersClient) CreateOrUpdatePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -151,7 +151,7 @@ func (client RouteFiltersClient) DeletePreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -237,7 +237,7 @@ func (client RouteFiltersClient) GetPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -316,7 +316,7 @@ func (client RouteFiltersClient) ListPreparer(ctx context.Context) (*http.Reques "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -432,7 +432,7 @@ func (client RouteFiltersClient) ListByResourceGroupPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -546,7 +546,7 @@ func (client RouteFiltersClient) UpdateTagsPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routemaps.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routemaps.go new file mode 100644 index 000000000000..1f31d110144d --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routemaps.go @@ -0,0 +1,394 @@ +package network + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// RouteMapsClient is the network Client +type RouteMapsClient struct { + BaseClient +} + +// NewRouteMapsClient creates an instance of the RouteMapsClient client. +func NewRouteMapsClient(subscriptionID string) RouteMapsClient { + return NewRouteMapsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRouteMapsClientWithBaseURI creates an instance of the RouteMapsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewRouteMapsClientWithBaseURI(baseURI string, subscriptionID string) RouteMapsClient { + return RouteMapsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates a RouteMap if it doesn't exist else updates the existing one. +// Parameters: +// resourceGroupName - the resource group name of the RouteMap's resource group. +// virtualHubName - the name of the VirtualHub containing the RouteMap. +// routeMapName - the name of the RouteMap. +// routeMapParameters - parameters supplied to create or update a RouteMap. +func (client RouteMapsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualHubName string, routeMapName string, routeMapParameters RouteMap) (result RouteMapsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RouteMapsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualHubName, routeMapName, routeMapParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteMapsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteMapsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client RouteMapsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, virtualHubName string, routeMapName string, routeMapParameters RouteMap) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "routeMapName": autorest.Encode("path", routeMapName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualHubName": autorest.Encode("path", virtualHubName), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + routeMapParameters.Name = nil + routeMapParameters.Etag = nil + routeMapParameters.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeMaps/{routeMapName}", pathParameters), + autorest.WithJSON(routeMapParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client RouteMapsClient) CreateOrUpdateSender(req *http.Request) (future RouteMapsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client RouteMapsClient) CreateOrUpdateResponder(resp *http.Response) (result RouteMap, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a RouteMap. +// Parameters: +// resourceGroupName - the resource group name of the RouteMap's resource group. +// virtualHubName - the name of the VirtualHub containing the RouteMap. +// routeMapName - the name of the RouteMap. +func (client RouteMapsClient) Delete(ctx context.Context, resourceGroupName string, virtualHubName string, routeMapName string) (result RouteMapsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RouteMapsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, virtualHubName, routeMapName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteMapsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteMapsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client RouteMapsClient) DeletePreparer(ctx context.Context, resourceGroupName string, virtualHubName string, routeMapName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "routeMapName": autorest.Encode("path", routeMapName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualHubName": autorest.Encode("path", virtualHubName), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeMaps/{routeMapName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client RouteMapsClient) DeleteSender(req *http.Request) (future RouteMapsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client RouteMapsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieves the details of a RouteMap. +// Parameters: +// resourceGroupName - the resource group name of the RouteMap's resource group. +// virtualHubName - the name of the VirtualHub containing the RouteMap. +// routeMapName - the name of the RouteMap. +func (client RouteMapsClient) Get(ctx context.Context, resourceGroupName string, virtualHubName string, routeMapName string) (result RouteMap, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RouteMapsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, virtualHubName, routeMapName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteMapsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.RouteMapsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteMapsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client RouteMapsClient) GetPreparer(ctx context.Context, resourceGroupName string, virtualHubName string, routeMapName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "routeMapName": autorest.Encode("path", routeMapName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualHubName": autorest.Encode("path", virtualHubName), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeMaps/{routeMapName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client RouteMapsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client RouteMapsClient) GetResponder(resp *http.Response) (result RouteMap, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List retrieves the details of all RouteMaps. +// Parameters: +// resourceGroupName - the resource group name of the RouteMap's resource group'. +// virtualHubName - the name of the VirtualHub containing the RouteMap. +func (client RouteMapsClient) List(ctx context.Context, resourceGroupName string, virtualHubName string) (result ListRouteMapsResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RouteMapsClient.List") + defer func() { + sc := -1 + if result.lrmr.Response.Response != nil { + sc = result.lrmr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, virtualHubName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteMapsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.lrmr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.RouteMapsClient", "List", resp, "Failure sending request") + return + } + + result.lrmr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteMapsClient", "List", resp, "Failure responding to request") + return + } + if result.lrmr.hasNextLink() && result.lrmr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client RouteMapsClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualHubName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualHubName": autorest.Encode("path", virtualHubName), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/routeMaps", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client RouteMapsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client RouteMapsClient) ListResponder(resp *http.Response) (result ListRouteMapsResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client RouteMapsClient) listNextResults(ctx context.Context, lastResults ListRouteMapsResult) (result ListRouteMapsResult, err error) { + req, err := lastResults.listRouteMapsResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "network.RouteMapsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.RouteMapsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.RouteMapsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client RouteMapsClient) ListComplete(ctx context.Context, resourceGroupName string, virtualHubName string) (result ListRouteMapsResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RouteMapsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, virtualHubName) + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/routes.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routes.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/routes.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routes.go index f189aeebf85c..fc2be63bfe36 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/routes.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routes.go @@ -71,7 +71,7 @@ func (client RoutesClient) CreateOrUpdatePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -155,7 +155,7 @@ func (client RoutesClient) DeletePreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -242,7 +242,7 @@ func (client RoutesClient) GetPreparer(ctx context.Context, resourceGroupName st "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -323,7 +323,7 @@ func (client RoutesClient) ListPreparer(ctx context.Context, resourceGroupName s "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/routetables.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routetables.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/routetables.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routetables.go index f946c9041b03..79d8c6e272e8 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/routetables.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routetables.go @@ -69,7 +69,7 @@ func (client RouteTablesClient) CreateOrUpdatePreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -151,7 +151,7 @@ func (client RouteTablesClient) DeletePreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -237,7 +237,7 @@ func (client RouteTablesClient) GetPreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -319,7 +319,7 @@ func (client RouteTablesClient) ListPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -432,7 +432,7 @@ func (client RouteTablesClient) ListAllPreparer(ctx context.Context) (*http.Requ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -546,7 +546,7 @@ func (client RouteTablesClient) UpdateTagsPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/routingintent.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routingintent.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/routingintent.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routingintent.go index 2a3d7fdb8f73..cafcec1b9fa6 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/routingintent.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/routingintent.go @@ -71,7 +71,7 @@ func (client RoutingIntentClient) CreateOrUpdatePreparer(ctx context.Context, re "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -156,7 +156,7 @@ func (client RoutingIntentClient) DeletePreparer(ctx context.Context, resourceGr "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -243,7 +243,7 @@ func (client RoutingIntentClient) GetPreparer(ctx context.Context, resourceGroup "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -324,7 +324,7 @@ func (client RoutingIntentClient) ListPreparer(ctx context.Context, resourceGrou "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/scopeconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/scopeconnections.go new file mode 100644 index 000000000000..b08b24b972c9 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/scopeconnections.go @@ -0,0 +1,408 @@ +package network + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ScopeConnectionsClient is the network Client +type ScopeConnectionsClient struct { + BaseClient +} + +// NewScopeConnectionsClient creates an instance of the ScopeConnectionsClient client. +func NewScopeConnectionsClient(subscriptionID string) ScopeConnectionsClient { + return NewScopeConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewScopeConnectionsClientWithBaseURI creates an instance of the ScopeConnectionsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewScopeConnectionsClientWithBaseURI(baseURI string, subscriptionID string) ScopeConnectionsClient { + return ScopeConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates scope connection from Network Manager +// Parameters: +// parameters - scope connection to be created/updated. +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +// scopeConnectionName - name for the cross-tenant connection. +func (client ScopeConnectionsClient) CreateOrUpdate(ctx context.Context, parameters ScopeConnection, resourceGroupName string, networkManagerName string, scopeConnectionName string) (result ScopeConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ScopeConnectionsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, parameters, resourceGroupName, networkManagerName, scopeConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ScopeConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.ScopeConnectionsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ScopeConnectionsClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ScopeConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, parameters ScopeConnection, resourceGroupName string, networkManagerName string, scopeConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "scopeConnectionName": autorest.Encode("path", scopeConnectionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/scopeConnections/{scopeConnectionName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ScopeConnectionsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ScopeConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result ScopeConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the pending scope connection created by this network manager. +// Parameters: +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +// scopeConnectionName - name for the cross-tenant connection. +func (client ScopeConnectionsClient) Delete(ctx context.Context, resourceGroupName string, networkManagerName string, scopeConnectionName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ScopeConnectionsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, networkManagerName, scopeConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ScopeConnectionsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "network.ScopeConnectionsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ScopeConnectionsClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ScopeConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkManagerName string, scopeConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "scopeConnectionName": autorest.Encode("path", scopeConnectionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/scopeConnections/{scopeConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ScopeConnectionsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ScopeConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get specified scope connection created by this Network Manager. +// Parameters: +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +// scopeConnectionName - name for the cross-tenant connection. +func (client ScopeConnectionsClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string, scopeConnectionName string) (result ScopeConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ScopeConnectionsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, networkManagerName, scopeConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ScopeConnectionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.ScopeConnectionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ScopeConnectionsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ScopeConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, networkManagerName string, scopeConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "scopeConnectionName": autorest.Encode("path", scopeConnectionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/scopeConnections/{scopeConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ScopeConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ScopeConnectionsClient) GetResponder(resp *http.Response) (result ScopeConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list all scope connections created by this network manager. +// Parameters: +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +// top - an optional query parameter which specifies the maximum number of records to be returned by the +// server. +// skipToken - skipToken is only used if a previous operation returned a partial result. If a previous response +// contains a nextLink element, the value of the nextLink element will include a skipToken parameter that +// specifies a starting point to use for subsequent calls. +func (client ScopeConnectionsClient) List(ctx context.Context, resourceGroupName string, networkManagerName string, top *int32, skipToken string) (result ScopeConnectionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ScopeConnectionsClient.List") + defer func() { + sc := -1 + if result.sclr.Response.Response != nil { + sc = result.sclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, + {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("network.ScopeConnectionsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, networkManagerName, top, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ScopeConnectionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.sclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.ScopeConnectionsClient", "List", resp, "Failure sending request") + return + } + + result.sclr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ScopeConnectionsClient", "List", resp, "Failure responding to request") + return + } + if result.sclr.hasNextLink() && result.sclr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ScopeConnectionsClient) ListPreparer(ctx context.Context, resourceGroupName string, networkManagerName string, top *int32, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/scopeConnections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ScopeConnectionsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ScopeConnectionsClient) ListResponder(resp *http.Response) (result ScopeConnectionListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ScopeConnectionsClient) listNextResults(ctx context.Context, lastResults ScopeConnectionListResult) (result ScopeConnectionListResult, err error) { + req, err := lastResults.scopeConnectionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "network.ScopeConnectionsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.ScopeConnectionsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ScopeConnectionsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ScopeConnectionsClient) ListComplete(ctx context.Context, resourceGroupName string, networkManagerName string, top *int32, skipToken string) (result ScopeConnectionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ScopeConnectionsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, networkManagerName, top, skipToken) + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/securityadminconfigurations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/securityadminconfigurations.go new file mode 100644 index 000000000000..4bea70a637e7 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/securityadminconfigurations.go @@ -0,0 +1,416 @@ +package network + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SecurityAdminConfigurationsClient is the network Client +type SecurityAdminConfigurationsClient struct { + BaseClient +} + +// NewSecurityAdminConfigurationsClient creates an instance of the SecurityAdminConfigurationsClient client. +func NewSecurityAdminConfigurationsClient(subscriptionID string) SecurityAdminConfigurationsClient { + return NewSecurityAdminConfigurationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSecurityAdminConfigurationsClientWithBaseURI creates an instance of the SecurityAdminConfigurationsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewSecurityAdminConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) SecurityAdminConfigurationsClient { + return SecurityAdminConfigurationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a network manager security admin configuration. +// Parameters: +// securityAdminConfiguration - the security admin configuration to create or update +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +// configurationName - the name of the network manager Security Configuration. +func (client SecurityAdminConfigurationsClient) CreateOrUpdate(ctx context.Context, securityAdminConfiguration SecurityAdminConfiguration, resourceGroupName string, networkManagerName string, configurationName string) (result SecurityAdminConfiguration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecurityAdminConfigurationsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, securityAdminConfiguration, resourceGroupName, networkManagerName, configurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.SecurityAdminConfigurationsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.SecurityAdminConfigurationsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.SecurityAdminConfigurationsClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client SecurityAdminConfigurationsClient) CreateOrUpdatePreparer(ctx context.Context, securityAdminConfiguration SecurityAdminConfiguration, resourceGroupName string, networkManagerName string, configurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "configurationName": autorest.Encode("path", configurationName), + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + securityAdminConfiguration.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}", pathParameters), + autorest.WithJSON(securityAdminConfiguration), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client SecurityAdminConfigurationsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client SecurityAdminConfigurationsClient) CreateOrUpdateResponder(resp *http.Response) (result SecurityAdminConfiguration, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a network manager security admin configuration. +// Parameters: +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +// configurationName - the name of the network manager Security Configuration. +// force - deletes the resource even if it is part of a deployed configuration. If the configuration has been +// deployed, the service will do a cleanup deployment in the background, prior to the delete. +func (client SecurityAdminConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, force *bool) (result SecurityAdminConfigurationsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecurityAdminConfigurationsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, networkManagerName, configurationName, force) + if err != nil { + err = autorest.NewErrorWithError(err, "network.SecurityAdminConfigurationsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.SecurityAdminConfigurationsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SecurityAdminConfigurationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string, force *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "configurationName": autorest.Encode("path", configurationName), + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if force != nil { + queryParameters["force"] = autorest.Encode("query", *force) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client SecurityAdminConfigurationsClient) DeleteSender(req *http.Request) (future SecurityAdminConfigurationsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client SecurityAdminConfigurationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieves a network manager security admin configuration. +// Parameters: +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +// configurationName - the name of the network manager Security Configuration. +func (client SecurityAdminConfigurationsClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string) (result SecurityAdminConfiguration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecurityAdminConfigurationsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, networkManagerName, configurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.SecurityAdminConfigurationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.SecurityAdminConfigurationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.SecurityAdminConfigurationsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client SecurityAdminConfigurationsClient) GetPreparer(ctx context.Context, resourceGroupName string, networkManagerName string, configurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "configurationName": autorest.Encode("path", configurationName), + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations/{configurationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SecurityAdminConfigurationsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SecurityAdminConfigurationsClient) GetResponder(resp *http.Response) (result SecurityAdminConfiguration, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all the network manager security admin configurations in a network manager, in a paginated format. +// Parameters: +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +// top - an optional query parameter which specifies the maximum number of records to be returned by the +// server. +// skipToken - skipToken is only used if a previous operation returned a partial result. If a previous response +// contains a nextLink element, the value of the nextLink element will include a skipToken parameter that +// specifies a starting point to use for subsequent calls. +func (client SecurityAdminConfigurationsClient) List(ctx context.Context, resourceGroupName string, networkManagerName string, top *int32, skipToken string) (result SecurityAdminConfigurationListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecurityAdminConfigurationsClient.List") + defer func() { + sc := -1 + if result.saclr.Response.Response != nil { + sc = result.saclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, + {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("network.SecurityAdminConfigurationsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, networkManagerName, top, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "network.SecurityAdminConfigurationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.saclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.SecurityAdminConfigurationsClient", "List", resp, "Failure sending request") + return + } + + result.saclr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.SecurityAdminConfigurationsClient", "List", resp, "Failure responding to request") + return + } + if result.saclr.hasNextLink() && result.saclr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client SecurityAdminConfigurationsClient) ListPreparer(ctx context.Context, resourceGroupName string, networkManagerName string, top *int32, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/securityAdminConfigurations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client SecurityAdminConfigurationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SecurityAdminConfigurationsClient) ListResponder(resp *http.Response) (result SecurityAdminConfigurationListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client SecurityAdminConfigurationsClient) listNextResults(ctx context.Context, lastResults SecurityAdminConfigurationListResult) (result SecurityAdminConfigurationListResult, err error) { + req, err := lastResults.securityAdminConfigurationListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "network.SecurityAdminConfigurationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.SecurityAdminConfigurationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.SecurityAdminConfigurationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SecurityAdminConfigurationsClient) ListComplete(ctx context.Context, resourceGroupName string, networkManagerName string, top *int32, skipToken string) (result SecurityAdminConfigurationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecurityAdminConfigurationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, networkManagerName, top, skipToken) + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/securitygroups.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/securitygroups.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/securitygroups.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/securitygroups.go index fc059a966b0e..365f7f33c536 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/securitygroups.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/securitygroups.go @@ -69,7 +69,7 @@ func (client SecurityGroupsClient) CreateOrUpdatePreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -151,7 +151,7 @@ func (client SecurityGroupsClient) DeletePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -237,7 +237,7 @@ func (client SecurityGroupsClient) GetPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -319,7 +319,7 @@ func (client SecurityGroupsClient) ListPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -432,7 +432,7 @@ func (client SecurityGroupsClient) ListAllPreparer(ctx context.Context) (*http.R "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -546,7 +546,7 @@ func (client SecurityGroupsClient) UpdateTagsPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/securitypartnerproviders.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/securitypartnerproviders.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/securitypartnerproviders.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/securitypartnerproviders.go index dd7f1dd0f17f..de93a91dffe5 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/securitypartnerproviders.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/securitypartnerproviders.go @@ -70,7 +70,7 @@ func (client SecurityPartnerProvidersClient) CreateOrUpdatePreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -152,7 +152,7 @@ func (client SecurityPartnerProvidersClient) DeletePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -237,7 +237,7 @@ func (client SecurityPartnerProvidersClient) GetPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -313,7 +313,7 @@ func (client SecurityPartnerProvidersClient) ListPreparer(ctx context.Context) ( "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -429,7 +429,7 @@ func (client SecurityPartnerProvidersClient) ListByResourceGroupPreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -543,7 +543,7 @@ func (client SecurityPartnerProvidersClient) UpdateTagsPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/securityrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/securityrules.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/securityrules.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/securityrules.go index 6e75a8eefb3e..744c7cea7023 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/securityrules.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/securityrules.go @@ -71,7 +71,7 @@ func (client SecurityRulesClient) CreateOrUpdatePreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -155,7 +155,7 @@ func (client SecurityRulesClient) DeletePreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -242,7 +242,7 @@ func (client SecurityRulesClient) GetPreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -323,7 +323,7 @@ func (client SecurityRulesClient) ListPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/serviceassociationlinks.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/serviceassociationlinks.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/serviceassociationlinks.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/serviceassociationlinks.go index 097a5f0e76d0..c36939d2c79f 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/serviceassociationlinks.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/serviceassociationlinks.go @@ -78,7 +78,7 @@ func (client ServiceAssociationLinksClient) ListPreparer(ctx context.Context, re "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/serviceendpointpolicies.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/serviceendpointpolicies.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/serviceendpointpolicies.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/serviceendpointpolicies.go index f894adbca990..4b74b9fff16e 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/serviceendpointpolicies.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/serviceendpointpolicies.go @@ -70,7 +70,7 @@ func (client ServiceEndpointPoliciesClient) CreateOrUpdatePreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -153,7 +153,7 @@ func (client ServiceEndpointPoliciesClient) DeletePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -239,7 +239,7 @@ func (client ServiceEndpointPoliciesClient) GetPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -318,7 +318,7 @@ func (client ServiceEndpointPoliciesClient) ListPreparer(ctx context.Context) (* "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -434,7 +434,7 @@ func (client ServiceEndpointPoliciesClient) ListByResourceGroupPreparer(ctx cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -548,7 +548,7 @@ func (client ServiceEndpointPoliciesClient) UpdateTagsPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/serviceendpointpolicydefinitions.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/serviceendpointpolicydefinitions.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/serviceendpointpolicydefinitions.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/serviceendpointpolicydefinitions.go index 89eaa8bb537e..5206cad37abd 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/serviceendpointpolicydefinitions.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/serviceendpointpolicydefinitions.go @@ -73,7 +73,7 @@ func (client ServiceEndpointPolicyDefinitionsClient) CreateOrUpdatePreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -157,7 +157,7 @@ func (client ServiceEndpointPolicyDefinitionsClient) DeletePreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -244,7 +244,7 @@ func (client ServiceEndpointPolicyDefinitionsClient) GetPreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -325,7 +325,7 @@ func (client ServiceEndpointPolicyDefinitionsClient) ListByResourceGroupPreparer "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/servicetaginformation.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/servicetaginformation.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/servicetaginformation.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/servicetaginformation.go index 43306797828f..b57f55295f0a 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/servicetaginformation.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/servicetaginformation.go @@ -83,7 +83,7 @@ func (client ServiceTagInformationClient) ListPreparer(ctx context.Context, loca "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/servicetags.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/servicetags.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/servicetags.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/servicetags.go index 7f04ce556e1b..3710ad39614b 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/servicetags.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/servicetags.go @@ -75,7 +75,7 @@ func (client ServiceTagsClient) ListPreparer(ctx context.Context, location strin "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/staticmembers.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/staticmembers.go new file mode 100644 index 000000000000..565741e30dc3 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/staticmembers.go @@ -0,0 +1,415 @@ +package network + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// StaticMembersClient is the network Client +type StaticMembersClient struct { + BaseClient +} + +// NewStaticMembersClient creates an instance of the StaticMembersClient client. +func NewStaticMembersClient(subscriptionID string) StaticMembersClient { + return NewStaticMembersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewStaticMembersClientWithBaseURI creates an instance of the StaticMembersClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewStaticMembersClientWithBaseURI(baseURI string, subscriptionID string) StaticMembersClient { + return StaticMembersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a static member. +// Parameters: +// parameters - parameters supplied to the specify the static member to create +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +// networkGroupName - the name of the network group. +// staticMemberName - the name of the static member. +func (client StaticMembersClient) CreateOrUpdate(ctx context.Context, parameters StaticMember, resourceGroupName string, networkManagerName string, networkGroupName string, staticMemberName string) (result StaticMember, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticMembersClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, parameters, resourceGroupName, networkManagerName, networkGroupName, staticMemberName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.StaticMembersClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.StaticMembersClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.StaticMembersClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client StaticMembersClient) CreateOrUpdatePreparer(ctx context.Context, parameters StaticMember, resourceGroupName string, networkManagerName string, networkGroupName string, staticMemberName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "networkGroupName": autorest.Encode("path", networkGroupName), + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "staticMemberName": autorest.Encode("path", staticMemberName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}/staticMembers/{staticMemberName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client StaticMembersClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client StaticMembersClient) CreateOrUpdateResponder(resp *http.Response) (result StaticMember, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a static member. +// Parameters: +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +// networkGroupName - the name of the network group. +// staticMemberName - the name of the static member. +func (client StaticMembersClient) Delete(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, staticMemberName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticMembersClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, networkManagerName, networkGroupName, staticMemberName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.StaticMembersClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "network.StaticMembersClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.StaticMembersClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client StaticMembersClient) DeletePreparer(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, staticMemberName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "networkGroupName": autorest.Encode("path", networkGroupName), + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "staticMemberName": autorest.Encode("path", staticMemberName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}/staticMembers/{staticMemberName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client StaticMembersClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client StaticMembersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the specified static member. +// Parameters: +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +// networkGroupName - the name of the network group. +// staticMemberName - the name of the static member. +func (client StaticMembersClient) Get(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, staticMemberName string) (result StaticMember, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticMembersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, networkManagerName, networkGroupName, staticMemberName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.StaticMembersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.StaticMembersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.StaticMembersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client StaticMembersClient) GetPreparer(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, staticMemberName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "networkGroupName": autorest.Encode("path", networkGroupName), + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "staticMemberName": autorest.Encode("path", staticMemberName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}/staticMembers/{staticMemberName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client StaticMembersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client StaticMembersClient) GetResponder(resp *http.Response) (result StaticMember, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the specified static member. +// Parameters: +// resourceGroupName - the name of the resource group. +// networkManagerName - the name of the network manager. +// networkGroupName - the name of the network group. +// top - an optional query parameter which specifies the maximum number of records to be returned by the +// server. +// skipToken - skipToken is only used if a previous operation returned a partial result. If a previous response +// contains a nextLink element, the value of the nextLink element will include a skipToken parameter that +// specifies a starting point to use for subsequent calls. +func (client StaticMembersClient) List(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, top *int32, skipToken string) (result StaticMemberListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticMembersClient.List") + defer func() { + sc := -1 + if result.smlr.Response.Response != nil { + sc = result.smlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, + {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("network.StaticMembersClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, networkManagerName, networkGroupName, top, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "network.StaticMembersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.smlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.StaticMembersClient", "List", resp, "Failure sending request") + return + } + + result.smlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.StaticMembersClient", "List", resp, "Failure responding to request") + return + } + if result.smlr.hasNextLink() && result.smlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client StaticMembersClient) ListPreparer(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, top *int32, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "networkGroupName": autorest.Encode("path", networkGroupName), + "networkManagerName": autorest.Encode("path", networkManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkManagers/{networkManagerName}/networkGroups/{networkGroupName}/staticMembers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client StaticMembersClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client StaticMembersClient) ListResponder(resp *http.Response) (result StaticMemberListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client StaticMembersClient) listNextResults(ctx context.Context, lastResults StaticMemberListResult) (result StaticMemberListResult, err error) { + req, err := lastResults.staticMemberListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "network.StaticMembersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.StaticMembersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.StaticMembersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client StaticMembersClient) ListComplete(ctx context.Context, resourceGroupName string, networkManagerName string, networkGroupName string, top *int32, skipToken string) (result StaticMemberListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticMembersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, networkManagerName, networkGroupName, top, skipToken) + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/subnets.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/subnets.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/subnets.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/subnets.go index fa4f18c83c7b..3ef48cbbd0c2 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/subnets.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/subnets.go @@ -71,7 +71,7 @@ func (client SubnetsClient) CreateOrUpdatePreparer(ctx context.Context, resource "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -155,7 +155,7 @@ func (client SubnetsClient) DeletePreparer(ctx context.Context, resourceGroupNam "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -243,7 +243,7 @@ func (client SubnetsClient) GetPreparer(ctx context.Context, resourceGroupName s "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -327,7 +327,7 @@ func (client SubnetsClient) ListPreparer(ctx context.Context, resourceGroupName "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -437,7 +437,7 @@ func (client SubnetsClient) PrepareNetworkPoliciesPreparer(ctx context.Context, "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -521,7 +521,7 @@ func (client SubnetsClient) UnprepareNetworkPoliciesPreparer(ctx context.Context "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/subscriptionnetworkmanagerconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/subscriptionnetworkmanagerconnections.go new file mode 100644 index 000000000000..41256f35bde7 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/subscriptionnetworkmanagerconnections.go @@ -0,0 +1,393 @@ +package network + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SubscriptionNetworkManagerConnectionsClient is the network Client +type SubscriptionNetworkManagerConnectionsClient struct { + BaseClient +} + +// NewSubscriptionNetworkManagerConnectionsClient creates an instance of the +// SubscriptionNetworkManagerConnectionsClient client. +func NewSubscriptionNetworkManagerConnectionsClient(subscriptionID string) SubscriptionNetworkManagerConnectionsClient { + return NewSubscriptionNetworkManagerConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSubscriptionNetworkManagerConnectionsClientWithBaseURI creates an instance of the +// SubscriptionNetworkManagerConnectionsClient client using a custom endpoint. Use this when interacting with an Azure +// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewSubscriptionNetworkManagerConnectionsClientWithBaseURI(baseURI string, subscriptionID string) SubscriptionNetworkManagerConnectionsClient { + return SubscriptionNetworkManagerConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create a network manager connection on this subscription. +// Parameters: +// parameters - network manager connection to be created/updated. +// networkManagerConnectionName - name for the network manager connection. +func (client SubscriptionNetworkManagerConnectionsClient) CreateOrUpdate(ctx context.Context, parameters ManagerConnection, networkManagerConnectionName string) (result ManagerConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionNetworkManagerConnectionsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, parameters, networkManagerConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.SubscriptionNetworkManagerConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.SubscriptionNetworkManagerConnectionsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.SubscriptionNetworkManagerConnectionsClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client SubscriptionNetworkManagerConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, parameters ManagerConnection, networkManagerConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "networkManagerConnectionName": autorest.Encode("path", networkManagerConnectionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client SubscriptionNetworkManagerConnectionsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client SubscriptionNetworkManagerConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result ManagerConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete specified connection created by this subscription. +// Parameters: +// networkManagerConnectionName - name for the network manager connection. +func (client SubscriptionNetworkManagerConnectionsClient) Delete(ctx context.Context, networkManagerConnectionName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionNetworkManagerConnectionsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, networkManagerConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.SubscriptionNetworkManagerConnectionsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "network.SubscriptionNetworkManagerConnectionsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.SubscriptionNetworkManagerConnectionsClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SubscriptionNetworkManagerConnectionsClient) DeletePreparer(ctx context.Context, networkManagerConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "networkManagerConnectionName": autorest.Encode("path", networkManagerConnectionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client SubscriptionNetworkManagerConnectionsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client SubscriptionNetworkManagerConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get a specified connection created by this subscription. +// Parameters: +// networkManagerConnectionName - name for the network manager connection. +func (client SubscriptionNetworkManagerConnectionsClient) Get(ctx context.Context, networkManagerConnectionName string) (result ManagerConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionNetworkManagerConnectionsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, networkManagerConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.SubscriptionNetworkManagerConnectionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.SubscriptionNetworkManagerConnectionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.SubscriptionNetworkManagerConnectionsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client SubscriptionNetworkManagerConnectionsClient) GetPreparer(ctx context.Context, networkManagerConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "networkManagerConnectionName": autorest.Encode("path", networkManagerConnectionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagerConnections/{networkManagerConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SubscriptionNetworkManagerConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SubscriptionNetworkManagerConnectionsClient) GetResponder(resp *http.Response) (result ManagerConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list all network manager connections created by this subscription. +// Parameters: +// top - an optional query parameter which specifies the maximum number of records to be returned by the +// server. +// skipToken - skipToken is only used if a previous operation returned a partial result. If a previous response +// contains a nextLink element, the value of the nextLink element will include a skipToken parameter that +// specifies a starting point to use for subsequent calls. +func (client SubscriptionNetworkManagerConnectionsClient) List(ctx context.Context, top *int32, skipToken string) (result ManagerConnectionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionNetworkManagerConnectionsClient.List") + defer func() { + sc := -1 + if result.mclr.Response.Response != nil { + sc = result.mclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, + {Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("network.SubscriptionNetworkManagerConnectionsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, top, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "network.SubscriptionNetworkManagerConnectionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.mclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.SubscriptionNetworkManagerConnectionsClient", "List", resp, "Failure sending request") + return + } + + result.mclr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.SubscriptionNetworkManagerConnectionsClient", "List", resp, "Failure responding to request") + return + } + if result.mclr.hasNextLink() && result.mclr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client SubscriptionNetworkManagerConnectionsClient) ListPreparer(ctx context.Context, top *int32, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkManagerConnections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client SubscriptionNetworkManagerConnectionsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SubscriptionNetworkManagerConnectionsClient) ListResponder(resp *http.Response) (result ManagerConnectionListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client SubscriptionNetworkManagerConnectionsClient) listNextResults(ctx context.Context, lastResults ManagerConnectionListResult) (result ManagerConnectionListResult, err error) { + req, err := lastResults.managerConnectionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "network.SubscriptionNetworkManagerConnectionsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.SubscriptionNetworkManagerConnectionsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.SubscriptionNetworkManagerConnectionsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SubscriptionNetworkManagerConnectionsClient) ListComplete(ctx context.Context, top *int32, skipToken string) (result ManagerConnectionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionNetworkManagerConnectionsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, top, skipToken) + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/usages.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/usages.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/usages.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/usages.go index f3a9b82cc598..724cb1157826 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/usages.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/usages.go @@ -85,7 +85,7 @@ func (client UsagesClient) ListPreparer(ctx context.Context, location string) (* "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/version.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/version.go similarity index 90% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/version.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/version.go index 5f7329994a00..0bc5ef088911 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/version.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/version.go @@ -10,7 +10,7 @@ import "github.com/Azure/azure-sdk-for-go/version" // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/" + Version() + " network/2021-08-01" + return "Azure-SDK-For-Go/" + Version() + " network/2022-07-01" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vipswap.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vipswap.go new file mode 100644 index 000000000000..cc1f1ea744c5 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vipswap.go @@ -0,0 +1,272 @@ +package network + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// VipSwapClient is the network Client +type VipSwapClient struct { + BaseClient +} + +// NewVipSwapClient creates an instance of the VipSwapClient client. +func NewVipSwapClient(subscriptionID string) VipSwapClient { + return NewVipSwapClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVipSwapClientWithBaseURI creates an instance of the VipSwapClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewVipSwapClientWithBaseURI(baseURI string, subscriptionID string) VipSwapClient { + return VipSwapClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create performs vip swap operation on swappable cloud services. +// Parameters: +// groupName - the name of the resource group. +// resourceName - the name of the cloud service. +// parameters - swapResource object where slot type should be the target slot after vip swap for the specified +// cloud service. +func (client VipSwapClient) Create(ctx context.Context, groupName string, resourceName string, parameters SwapResource) (result VipSwapCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VipSwapClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, groupName, resourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VipSwapClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VipSwapClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client VipSwapClient) CreatePreparer(ctx context.Context, groupName string, resourceName string, parameters SwapResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupName": autorest.Encode("path", groupName), + "resourceName": autorest.Encode("path", resourceName), + "singletonResource": autorest.Encode("path", "swap"), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + parameters.ID = nil + parameters.Name = nil + parameters.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Compute/cloudServices/{resourceName}/providers/Microsoft.Network/cloudServiceSlots/{singletonResource}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client VipSwapClient) CreateSender(req *http.Request) (future VipSwapCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client VipSwapClient) CreateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the SwapResource which identifies the slot type for the specified cloud service. The slot type on a cloud +// service can either be Staging or Production +// Parameters: +// groupName - the name of the resource group. +// resourceName - the name of the cloud service. +func (client VipSwapClient) Get(ctx context.Context, groupName string, resourceName string) (result SwapResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VipSwapClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, groupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VipSwapClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.VipSwapClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VipSwapClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client VipSwapClient) GetPreparer(ctx context.Context, groupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupName": autorest.Encode("path", groupName), + "resourceName": autorest.Encode("path", resourceName), + "singletonResource": autorest.Encode("path", "swap"), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Compute/cloudServices/{resourceName}/providers/Microsoft.Network/cloudServiceSlots/{singletonResource}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client VipSwapClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client VipSwapClient) GetResponder(resp *http.Response) (result SwapResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the list of SwapResource which identifies the slot type for the specified cloud service. The slot type on +// a cloud service can either be Staging or Production +// Parameters: +// groupName - the name of the resource group. +// resourceName - the name of the cloud service. +func (client VipSwapClient) List(ctx context.Context, groupName string, resourceName string) (result SwapResourceListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VipSwapClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx, groupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VipSwapClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.VipSwapClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VipSwapClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client VipSwapClient) ListPreparer(ctx context.Context, groupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupName": autorest.Encode("path", groupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Compute/cloudServices/{resourceName}/providers/Microsoft.Network/cloudServiceSlots", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client VipSwapClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client VipSwapClient) ListResponder(resp *http.Response) (result SwapResourceListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualappliances.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualappliances.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualappliances.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualappliances.go index fd8e6a55a7a2..97d9fb25a9b5 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualappliances.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualappliances.go @@ -82,7 +82,7 @@ func (client VirtualAppliancesClient) CreateOrUpdatePreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -164,7 +164,7 @@ func (client VirtualAppliancesClient) DeletePreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -250,7 +250,7 @@ func (client VirtualAppliancesClient) GetPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -329,7 +329,7 @@ func (client VirtualAppliancesClient) ListPreparer(ctx context.Context) (*http.R "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -445,7 +445,7 @@ func (client VirtualAppliancesClient) ListByResourceGroupPreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -559,7 +559,7 @@ func (client VirtualAppliancesClient) UpdateTagsPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualappliancesites.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualappliancesites.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualappliancesites.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualappliancesites.go index 932a0a5f7fe3..1a9d2668582c 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualappliancesites.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualappliancesites.go @@ -72,7 +72,7 @@ func (client VirtualApplianceSitesClient) CreateOrUpdatePreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -157,7 +157,7 @@ func (client VirtualApplianceSitesClient) DeletePreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -244,7 +244,7 @@ func (client VirtualApplianceSitesClient) GetPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -325,7 +325,7 @@ func (client VirtualApplianceSitesClient) ListPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualapplianceskus.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualapplianceskus.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualapplianceskus.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualapplianceskus.go index 7cb46dfa72b2..3da40524df86 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualapplianceskus.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualapplianceskus.go @@ -74,7 +74,7 @@ func (client VirtualApplianceSkusClient) GetPreparer(ctx context.Context, skuNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -150,7 +150,7 @@ func (client VirtualApplianceSkusClient) ListPreparer(ctx context.Context) (*htt "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualhubbgpconnection.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualhubbgpconnection.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualhubbgpconnection.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualhubbgpconnection.go index f46aaa5c60bc..766d33159755 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualhubbgpconnection.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualhubbgpconnection.go @@ -85,7 +85,7 @@ func (client VirtualHubBgpConnectionClient) CreateOrUpdatePreparer(ctx context.C "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -170,7 +170,7 @@ func (client VirtualHubBgpConnectionClient) DeletePreparer(ctx context.Context, "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -257,7 +257,7 @@ func (client VirtualHubBgpConnectionClient) GetPreparer(ctx context.Context, res "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualhubbgpconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualhubbgpconnections.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualhubbgpconnections.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualhubbgpconnections.go index b6aae280990d..430cb12af99b 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualhubbgpconnections.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualhubbgpconnections.go @@ -81,7 +81,7 @@ func (client VirtualHubBgpConnectionsClient) ListPreparer(ctx context.Context, r "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -189,7 +189,7 @@ func (client VirtualHubBgpConnectionsClient) ListAdvertisedRoutesPreparer(ctx co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -270,7 +270,7 @@ func (client VirtualHubBgpConnectionsClient) ListLearnedRoutesPreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualhubipconfiguration.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualhubipconfiguration.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualhubipconfiguration.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualhubipconfiguration.go index 9d283a6e4fe9..c6c84931f25c 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualhubipconfiguration.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualhubipconfiguration.go @@ -91,7 +91,7 @@ func (client VirtualHubIPConfigurationClient) CreateOrUpdatePreparer(ctx context "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -176,7 +176,7 @@ func (client VirtualHubIPConfigurationClient) DeletePreparer(ctx context.Context "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -263,7 +263,7 @@ func (client VirtualHubIPConfigurationClient) GetPreparer(ctx context.Context, r "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -344,7 +344,7 @@ func (client VirtualHubIPConfigurationClient) ListPreparer(ctx context.Context, "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualhubroutetablev2s.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualhubroutetablev2s.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualhubroutetablev2s.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualhubroutetablev2s.go index 85d1612d3dda..210a170e348c 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualhubroutetablev2s.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualhubroutetablev2s.go @@ -73,7 +73,7 @@ func (client VirtualHubRouteTableV2sClient) CreateOrUpdatePreparer(ctx context.C "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -157,7 +157,7 @@ func (client VirtualHubRouteTableV2sClient) DeletePreparer(ctx context.Context, "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -244,7 +244,7 @@ func (client VirtualHubRouteTableV2sClient) GetPreparer(ctx context.Context, res "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -325,7 +325,7 @@ func (client VirtualHubRouteTableV2sClient) ListPreparer(ctx context.Context, re "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualhubs.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualhubs.go similarity index 77% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualhubs.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualhubs.go index 8bae5f0ca7c5..5ca1619791e3 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualhubs.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualhubs.go @@ -54,6 +54,10 @@ func (client VirtualHubsClient) CreateOrUpdate(ctx context.Context, resourceGrou Chain: []validation.Constraint{{Target: "virtualHubParameters.VirtualHubProperties.VirtualRouterAsn", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, {Target: "virtualHubParameters.VirtualHubProperties.VirtualRouterAsn", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, }}, + {Target: "virtualHubParameters.VirtualHubProperties.VirtualRouterAutoScaleConfiguration", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "virtualHubParameters.VirtualHubProperties.VirtualRouterAutoScaleConfiguration.MinCapacity", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "virtualHubParameters.VirtualHubProperties.VirtualRouterAutoScaleConfiguration.MinCapacity", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}, + }}, }}}}}); err != nil { return result, validation.NewError("network.VirtualHubsClient", "CreateOrUpdate", err.Error()) } @@ -81,7 +85,7 @@ func (client VirtualHubsClient) CreateOrUpdatePreparer(ctx context.Context, reso "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -164,7 +168,7 @@ func (client VirtualHubsClient) DeletePreparer(ctx context.Context, resourceGrou "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -249,7 +253,7 @@ func (client VirtualHubsClient) GetPreparer(ctx context.Context, resourceGroupNa "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -320,7 +324,7 @@ func (client VirtualHubsClient) GetEffectiveVirtualHubRoutesPreparer(ctx context "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -365,6 +369,168 @@ func (client VirtualHubsClient) GetEffectiveVirtualHubRoutesResponder(resp *http return } +// GetInboundRoutes gets the inbound routes configured for the Virtual Hub on a particular connection. +// Parameters: +// resourceGroupName - the resource group name of the VirtualHub. +// virtualHubName - the name of the VirtualHub. +// getInboundRoutesParameters - parameters supplied to get the inbound routes for a connection resource. +func (client VirtualHubsClient) GetInboundRoutes(ctx context.Context, resourceGroupName string, virtualHubName string, getInboundRoutesParameters GetInboundRoutesParameters) (result VirtualHubsGetInboundRoutesFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubsClient.GetInboundRoutes") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetInboundRoutesPreparer(ctx, resourceGroupName, virtualHubName, getInboundRoutesParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "GetInboundRoutes", nil, "Failure preparing request") + return + } + + result, err = client.GetInboundRoutesSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "GetInboundRoutes", result.Response(), "Failure sending request") + return + } + + return +} + +// GetInboundRoutesPreparer prepares the GetInboundRoutes request. +func (client VirtualHubsClient) GetInboundRoutesPreparer(ctx context.Context, resourceGroupName string, virtualHubName string, getInboundRoutesParameters GetInboundRoutesParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualHubName": autorest.Encode("path", virtualHubName), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/inboundRoutes", pathParameters), + autorest.WithJSON(getInboundRoutesParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetInboundRoutesSender sends the GetInboundRoutes request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualHubsClient) GetInboundRoutesSender(req *http.Request) (future VirtualHubsGetInboundRoutesFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// GetInboundRoutesResponder handles the response to the GetInboundRoutes request. The method always +// closes the http.Response Body. +func (client VirtualHubsClient) GetInboundRoutesResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetOutboundRoutes gets the outbound routes configured for the Virtual Hub on a particular connection. +// Parameters: +// resourceGroupName - the resource group name of the VirtualHub. +// virtualHubName - the name of the VirtualHub. +// getOutboundRoutesParameters - parameters supplied to get the outbound routes for a connection resource. +func (client VirtualHubsClient) GetOutboundRoutes(ctx context.Context, resourceGroupName string, virtualHubName string, getOutboundRoutesParameters GetOutboundRoutesParameters) (result VirtualHubsGetOutboundRoutesFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualHubsClient.GetOutboundRoutes") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetOutboundRoutesPreparer(ctx, resourceGroupName, virtualHubName, getOutboundRoutesParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "GetOutboundRoutes", nil, "Failure preparing request") + return + } + + result, err = client.GetOutboundRoutesSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualHubsClient", "GetOutboundRoutes", result.Response(), "Failure sending request") + return + } + + return +} + +// GetOutboundRoutesPreparer prepares the GetOutboundRoutes request. +func (client VirtualHubsClient) GetOutboundRoutesPreparer(ctx context.Context, resourceGroupName string, virtualHubName string, getOutboundRoutesParameters GetOutboundRoutesParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualHubName": autorest.Encode("path", virtualHubName), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualHubs/{virtualHubName}/outboundRoutes", pathParameters), + autorest.WithJSON(getOutboundRoutesParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetOutboundRoutesSender sends the GetOutboundRoutes request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualHubsClient) GetOutboundRoutesSender(req *http.Request) (future VirtualHubsGetOutboundRoutesFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// GetOutboundRoutesResponder handles the response to the GetOutboundRoutes request. The method always +// closes the http.Response Body. +func (client VirtualHubsClient) GetOutboundRoutesResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + // List lists all the VirtualHubs in a subscription. func (client VirtualHubsClient) List(ctx context.Context) (result ListVirtualHubsResultPage, err error) { if tracing.IsEnabled() { @@ -410,7 +576,7 @@ func (client VirtualHubsClient) ListPreparer(ctx context.Context) (*http.Request "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -526,7 +692,7 @@ func (client VirtualHubsClient) ListByResourceGroupPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -640,7 +806,7 @@ func (client VirtualHubsClient) UpdateTagsPreparer(ctx context.Context, resource "virtualHubName": autorest.Encode("path", virtualHubName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworkgatewayconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworkgatewayconnections.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworkgatewayconnections.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworkgatewayconnections.go index 578c03827347..44549b8b8f52 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworkgatewayconnections.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworkgatewayconnections.go @@ -108,7 +108,7 @@ func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdatePreparer(ctx "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -190,7 +190,7 @@ func (client VirtualNetworkGatewayConnectionsClient) DeletePreparer(ctx context. "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -275,7 +275,7 @@ func (client VirtualNetworkGatewayConnectionsClient) GetPreparer(ctx context.Con "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -345,7 +345,7 @@ func (client VirtualNetworkGatewayConnectionsClient) GetIkeSasPreparer(ctx conte "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -432,7 +432,7 @@ func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeyPreparer(ctx co "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -512,7 +512,7 @@ func (client VirtualNetworkGatewayConnectionsClient) ListPreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -618,7 +618,7 @@ func (client VirtualNetworkGatewayConnectionsClient) ResetConnectionPreparer(ctx "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -709,7 +709,7 @@ func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKeyPreparer(ctx "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -800,7 +800,7 @@ func (client VirtualNetworkGatewayConnectionsClient) SetSharedKeyPreparer(ctx co "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -883,7 +883,7 @@ func (client VirtualNetworkGatewayConnectionsClient) StartPacketCapturePreparer( "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -969,7 +969,7 @@ func (client VirtualNetworkGatewayConnectionsClient) StopPacketCapturePreparer(c "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1051,7 +1051,7 @@ func (client VirtualNetworkGatewayConnectionsClient) UpdateTagsPreparer(ctx cont "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworkgatewaynatrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworkgatewaynatrules.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworkgatewaynatrules.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworkgatewaynatrules.go index fd083dab12fe..119619416b43 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworkgatewaynatrules.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworkgatewaynatrules.go @@ -73,7 +73,7 @@ func (client VirtualNetworkGatewayNatRulesClient) CreateOrUpdatePreparer(ctx con "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -158,7 +158,7 @@ func (client VirtualNetworkGatewayNatRulesClient) DeletePreparer(ctx context.Con "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -245,7 +245,7 @@ func (client VirtualNetworkGatewayNatRulesClient) GetPreparer(ctx context.Contex "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -326,7 +326,7 @@ func (client VirtualNetworkGatewayNatRulesClient) ListByVirtualNetworkGatewayPre "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworkgateways.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworkgateways.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworkgateways.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworkgateways.go index 2943d5e9a6f6..1948dfbbd550 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworkgateways.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworkgateways.go @@ -84,7 +84,7 @@ func (client VirtualNetworkGatewaysClient) CreateOrUpdatePreparer(ctx context.Co "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -166,7 +166,7 @@ func (client VirtualNetworkGatewaysClient) DeletePreparer(ctx context.Context, r "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -246,7 +246,7 @@ func (client VirtualNetworkGatewaysClient) DisconnectVirtualNetworkGatewayVpnCon "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -328,7 +328,7 @@ func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackagePreparer(ctx "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -411,7 +411,7 @@ func (client VirtualNetworkGatewaysClient) GenerateVpnProfilePreparer(ctx contex "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -499,7 +499,7 @@ func (client VirtualNetworkGatewaysClient) GetPreparer(ctx context.Context, reso "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -570,7 +570,7 @@ func (client VirtualNetworkGatewaysClient) GetAdvertisedRoutesPreparer(ctx conte "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, "peer": autorest.Encode("query", peer), @@ -651,7 +651,7 @@ func (client VirtualNetworkGatewaysClient) GetBgpPeerStatusPreparer(ctx context. "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -734,7 +734,7 @@ func (client VirtualNetworkGatewaysClient) GetLearnedRoutesPreparer(ctx context. "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -814,7 +814,7 @@ func (client VirtualNetworkGatewaysClient) GetVpnclientConnectionHealthPreparer( "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -895,7 +895,7 @@ func (client VirtualNetworkGatewaysClient) GetVpnclientIpsecParametersPreparer(c "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -975,7 +975,7 @@ func (client VirtualNetworkGatewaysClient) GetVpnProfilePackageURLPreparer(ctx c "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1064,7 +1064,7 @@ func (client VirtualNetworkGatewaysClient) ListPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1182,7 +1182,7 @@ func (client VirtualNetworkGatewaysClient) ListConnectionsPreparer(ctx context.C "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1290,7 +1290,7 @@ func (client VirtualNetworkGatewaysClient) ResetPreparer(ctx context.Context, re "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1373,7 +1373,7 @@ func (client VirtualNetworkGatewaysClient) ResetVpnClientSharedKeyPreparer(ctx c "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1461,7 +1461,7 @@ func (client VirtualNetworkGatewaysClient) SetVpnclientIpsecParametersPreparer(c "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1543,7 +1543,7 @@ func (client VirtualNetworkGatewaysClient) StartPacketCapturePreparer(ctx contex "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1628,7 +1628,7 @@ func (client VirtualNetworkGatewaysClient) StopPacketCapturePreparer(ctx context "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1716,7 +1716,7 @@ func (client VirtualNetworkGatewaysClient) SupportedVpnDevicesPreparer(ctx conte "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1786,7 +1786,7 @@ func (client VirtualNetworkGatewaysClient) UpdateTagsPreparer(ctx context.Contex "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1876,7 +1876,7 @@ func (client VirtualNetworkGatewaysClient) VpnDeviceConfigurationScriptPreparer( "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworkpeerings.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworkpeerings.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworkpeerings.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworkpeerings.go index f556b1fd8234..03e63e845a7f 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworkpeerings.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworkpeerings.go @@ -87,7 +87,7 @@ func (client VirtualNetworkPeeringsClient) CreateOrUpdatePreparer(ctx context.Co "virtualNetworkPeeringName": autorest.Encode("path", virtualNetworkPeeringName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -174,7 +174,7 @@ func (client VirtualNetworkPeeringsClient) DeletePreparer(ctx context.Context, r "virtualNetworkPeeringName": autorest.Encode("path", virtualNetworkPeeringName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -261,7 +261,7 @@ func (client VirtualNetworkPeeringsClient) GetPreparer(ctx context.Context, reso "virtualNetworkPeeringName": autorest.Encode("path", virtualNetworkPeeringName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -342,7 +342,7 @@ func (client VirtualNetworkPeeringsClient) ListPreparer(ctx context.Context, res "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworks.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworks.go similarity index 83% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworks.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworks.go index 9febb3dec5d5..9f8ef4ba6b10 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworks.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworks.go @@ -77,7 +77,7 @@ func (client VirtualNetworksClient) CheckIPAddressAvailabilityPreparer(ctx conte "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, "ipAddress": autorest.Encode("query", IPAddress), @@ -159,7 +159,7 @@ func (client VirtualNetworksClient) CreateOrUpdatePreparer(ctx context.Context, "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -241,7 +241,7 @@ func (client VirtualNetworksClient) DeletePreparer(ctx context.Context, resource "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -327,7 +327,7 @@ func (client VirtualNetworksClient) GetPreparer(ctx context.Context, resourceGro "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -409,7 +409,7 @@ func (client VirtualNetworksClient) ListPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -522,7 +522,7 @@ func (client VirtualNetworksClient) ListAllPreparer(ctx context.Context) (*http. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -590,6 +590,134 @@ func (client VirtualNetworksClient) ListAllComplete(ctx context.Context) (result return } +// ListDdosProtectionStatus gets the Ddos Protection Status of all IP Addresses under the Virtual Network +// Parameters: +// resourceGroupName - the name of the resource group. +// virtualNetworkName - the name of the virtual network. +// top - the max number of ip addresses to return. +// skipToken - the skipToken that is given with nextLink. +func (client VirtualNetworksClient) ListDdosProtectionStatus(ctx context.Context, resourceGroupName string, virtualNetworkName string, top *int32, skipToken string) (result VirtualNetworksListDdosProtectionStatusFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.ListDdosProtectionStatus") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListDdosProtectionStatusPreparer(ctx, resourceGroupName, virtualNetworkName, top, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListDdosProtectionStatus", nil, "Failure preparing request") + return + } + + result, err = client.ListDdosProtectionStatusSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListDdosProtectionStatus", result.Response(), "Failure sending request") + return + } + + return +} + +// ListDdosProtectionStatusPreparer prepares the ListDdosProtectionStatus request. +func (client VirtualNetworksClient) ListDdosProtectionStatusPreparer(ctx context.Context, resourceGroupName string, virtualNetworkName string, top *int32, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualNetworkName": autorest.Encode("path", virtualNetworkName), + } + + const APIVersion = "2022-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["top"] = autorest.Encode("query", *top) + } + if len(skipToken) > 0 { + queryParameters["skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/ddosProtectionStatus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListDdosProtectionStatusSender sends the ListDdosProtectionStatus request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualNetworksClient) ListDdosProtectionStatusSender(req *http.Request) (future VirtualNetworksListDdosProtectionStatusFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ListDdosProtectionStatusResponder handles the response to the ListDdosProtectionStatus request. The method always +// closes the http.Response Body. +func (client VirtualNetworksClient) ListDdosProtectionStatusResponder(resp *http.Response) (result VirtualNetworkDdosProtectionStatusResultPage, err error) { + result.vndpsr, err = client.listDdosProtectionStatusResponder(resp) + result.fn = client.listDdosProtectionStatusNextResults + return +} + +func (client VirtualNetworksClient) listDdosProtectionStatusResponder(resp *http.Response) (result VirtualNetworkDdosProtectionStatusResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listDdosProtectionStatusNextResults retrieves the next set of results, if any. +func (client VirtualNetworksClient) listDdosProtectionStatusNextResults(ctx context.Context, lastResults VirtualNetworkDdosProtectionStatusResult) (result VirtualNetworkDdosProtectionStatusResult, err error) { + req, err := lastResults.virtualNetworkDdosProtectionStatusResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "listDdosProtectionStatusNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + var resp *http.Response + resp, err = client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if err != nil { + return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "listDdosProtectionStatusNextResults", resp, "Failure sending next results request") + } + return client.listDdosProtectionStatusResponder(resp) +} + +// ListDdosProtectionStatusComplete enumerates all values, automatically crossing page boundaries as required. +func (client VirtualNetworksClient) ListDdosProtectionStatusComplete(ctx context.Context, resourceGroupName string, virtualNetworkName string, top *int32, skipToken string) (result VirtualNetworksListDdosProtectionStatusAllFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.ListDdosProtectionStatus") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + var future VirtualNetworksListDdosProtectionStatusFuture + future, err = client.ListDdosProtectionStatus(ctx, resourceGroupName, virtualNetworkName, top, skipToken) + result.FutureAPI = future.FutureAPI + return +} + // ListUsage lists usage stats. // Parameters: // resourceGroupName - the name of the resource group. @@ -640,7 +768,7 @@ func (client VirtualNetworksClient) ListUsagePreparer(ctx context.Context, resou "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -754,7 +882,7 @@ func (client VirtualNetworksClient) UpdateTagsPreparer(ctx context.Context, reso "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworktaps.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworktaps.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworktaps.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworktaps.go index 7d6bc121f9e8..ed7df95593d6 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualnetworktaps.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualnetworktaps.go @@ -106,7 +106,7 @@ func (client VirtualNetworkTapsClient) CreateOrUpdatePreparer(ctx context.Contex "tapName": autorest.Encode("path", tapName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -188,7 +188,7 @@ func (client VirtualNetworkTapsClient) DeletePreparer(ctx context.Context, resou "tapName": autorest.Encode("path", tapName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -273,7 +273,7 @@ func (client VirtualNetworkTapsClient) GetPreparer(ctx context.Context, resource "tapName": autorest.Encode("path", tapName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -349,7 +349,7 @@ func (client VirtualNetworkTapsClient) ListAllPreparer(ctx context.Context) (*ht "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -465,7 +465,7 @@ func (client VirtualNetworkTapsClient) ListByResourceGroupPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -579,7 +579,7 @@ func (client VirtualNetworkTapsClient) UpdateTagsPreparer(ctx context.Context, r "tapName": autorest.Encode("path", tapName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualrouterpeerings.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualrouterpeerings.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualrouterpeerings.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualrouterpeerings.go index 4ed695c16f96..1b085b20789f 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualrouterpeerings.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualrouterpeerings.go @@ -84,7 +84,7 @@ func (client VirtualRouterPeeringsClient) CreateOrUpdatePreparer(ctx context.Con "virtualRouterName": autorest.Encode("path", virtualRouterName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -169,7 +169,7 @@ func (client VirtualRouterPeeringsClient) DeletePreparer(ctx context.Context, re "virtualRouterName": autorest.Encode("path", virtualRouterName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -256,7 +256,7 @@ func (client VirtualRouterPeeringsClient) GetPreparer(ctx context.Context, resou "virtualRouterName": autorest.Encode("path", virtualRouterName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -337,7 +337,7 @@ func (client VirtualRouterPeeringsClient) ListPreparer(ctx context.Context, reso "virtualRouterName": autorest.Encode("path", virtualRouterName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualrouters.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualrouters.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualrouters.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualrouters.go index a4da32dbc582..83c98525aa87 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualrouters.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualrouters.go @@ -81,7 +81,7 @@ func (client VirtualRoutersClient) CreateOrUpdatePreparer(ctx context.Context, r "virtualRouterName": autorest.Encode("path", virtualRouterName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -163,7 +163,7 @@ func (client VirtualRoutersClient) DeletePreparer(ctx context.Context, resourceG "virtualRouterName": autorest.Encode("path", virtualRouterName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -249,7 +249,7 @@ func (client VirtualRoutersClient) GetPreparer(ctx context.Context, resourceGrou "virtualRouterName": autorest.Encode("path", virtualRouterName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -328,7 +328,7 @@ func (client VirtualRoutersClient) ListPreparer(ctx context.Context) (*http.Requ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -444,7 +444,7 @@ func (client VirtualRoutersClient) ListByResourceGroupPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualwans.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualwans.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualwans.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualwans.go index cf2385c7948f..840147910e05 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/virtualwans.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/virtualwans.go @@ -69,7 +69,7 @@ func (client VirtualWansClient) CreateOrUpdatePreparer(ctx context.Context, reso "VirtualWANName": autorest.Encode("path", virtualWANName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -151,7 +151,7 @@ func (client VirtualWansClient) DeletePreparer(ctx context.Context, resourceGrou "VirtualWANName": autorest.Encode("path", virtualWANName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -236,7 +236,7 @@ func (client VirtualWansClient) GetPreparer(ctx context.Context, resourceGroupNa "VirtualWANName": autorest.Encode("path", virtualWANName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -312,7 +312,7 @@ func (client VirtualWansClient) ListPreparer(ctx context.Context) (*http.Request "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -428,7 +428,7 @@ func (client VirtualWansClient) ListByResourceGroupPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -542,7 +542,7 @@ func (client VirtualWansClient) UpdateTagsPreparer(ctx context.Context, resource "VirtualWANName": autorest.Encode("path", virtualWANName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnconnections.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnconnections.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnconnections.go index bfa051bca448..48663fa5f9b0 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnconnections.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnconnections.go @@ -72,7 +72,7 @@ func (client VpnConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -156,7 +156,7 @@ func (client VpnConnectionsClient) DeletePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -243,7 +243,7 @@ func (client VpnConnectionsClient) GetPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -324,7 +324,7 @@ func (client VpnConnectionsClient) ListByVpnGatewayPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -434,7 +434,7 @@ func (client VpnConnectionsClient) StartPacketCapturePreparer(ctx context.Contex "vpnConnectionName": autorest.Encode("path", vpnConnectionName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -521,7 +521,7 @@ func (client VpnConnectionsClient) StopPacketCapturePreparer(ctx context.Context "vpnConnectionName": autorest.Encode("path", vpnConnectionName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpngateways.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpngateways.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpngateways.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpngateways.go index ea9d2837eccb..19e473877d6d 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpngateways.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpngateways.go @@ -83,7 +83,7 @@ func (client VpnGatewaysClient) CreateOrUpdatePreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -165,7 +165,7 @@ func (client VpnGatewaysClient) DeletePreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -250,7 +250,7 @@ func (client VpnGatewaysClient) GetPreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -326,7 +326,7 @@ func (client VpnGatewaysClient) ListPreparer(ctx context.Context) (*http.Request "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -442,7 +442,7 @@ func (client VpnGatewaysClient) ListByResourceGroupPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -548,7 +548,7 @@ func (client VpnGatewaysClient) ResetPreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -628,7 +628,7 @@ func (client VpnGatewaysClient) StartPacketCapturePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -713,7 +713,7 @@ func (client VpnGatewaysClient) StopPacketCapturePreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -798,7 +798,7 @@ func (client VpnGatewaysClient) UpdateTagsPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnlinkconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnlinkconnections.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnlinkconnections.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnlinkconnections.go index f84a1b158e0e..21927e1f1da2 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnlinkconnections.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnlinkconnections.go @@ -73,7 +73,7 @@ func (client VpnLinkConnectionsClient) GetIkeSasPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -166,7 +166,7 @@ func (client VpnLinkConnectionsClient) ListByVpnConnectionPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -276,7 +276,7 @@ func (client VpnLinkConnectionsClient) ResetConnectionPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnserverconfigurations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnserverconfigurations.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnserverconfigurations.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnserverconfigurations.go index 14784a641112..28d3c9535c58 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnserverconfigurations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnserverconfigurations.go @@ -71,7 +71,7 @@ func (client VpnServerConfigurationsClient) CreateOrUpdatePreparer(ctx context.C "vpnServerConfigurationName": autorest.Encode("path", vpnServerConfigurationName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -153,7 +153,7 @@ func (client VpnServerConfigurationsClient) DeletePreparer(ctx context.Context, "vpnServerConfigurationName": autorest.Encode("path", vpnServerConfigurationName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -238,7 +238,7 @@ func (client VpnServerConfigurationsClient) GetPreparer(ctx context.Context, res "vpnServerConfigurationName": autorest.Encode("path", vpnServerConfigurationName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -314,7 +314,7 @@ func (client VpnServerConfigurationsClient) ListPreparer(ctx context.Context) (* "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -430,7 +430,7 @@ func (client VpnServerConfigurationsClient) ListByResourceGroupPreparer(ctx cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -544,7 +544,7 @@ func (client VpnServerConfigurationsClient) UpdateTagsPreparer(ctx context.Conte "vpnServerConfigurationName": autorest.Encode("path", vpnServerConfigurationName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnserverconfigurationsassociatedwithvirtualwan.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnserverconfigurationsassociatedwithvirtualwan.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnserverconfigurationsassociatedwithvirtualwan.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnserverconfigurationsassociatedwithvirtualwan.go index 21176b057549..fa7215ff90f0 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnserverconfigurationsassociatedwithvirtualwan.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnserverconfigurationsassociatedwithvirtualwan.go @@ -70,7 +70,7 @@ func (client VpnServerConfigurationsAssociatedWithVirtualWanClient) ListPreparer "virtualWANName": autorest.Encode("path", virtualWANName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnsitelinkconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnsitelinkconnections.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnsitelinkconnections.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnsitelinkconnections.go index b4b1695a678b..e39710eedbd1 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnsitelinkconnections.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnsitelinkconnections.go @@ -80,7 +80,7 @@ func (client VpnSiteLinkConnectionsClient) GetPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnsitelinks.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnsitelinks.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnsitelinks.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnsitelinks.go index 284ac1665d37..966f7e7a4cc9 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnsitelinks.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnsitelinks.go @@ -77,7 +77,7 @@ func (client VpnSiteLinksClient) GetPreparer(ctx context.Context, resourceGroupN "vpnSiteName": autorest.Encode("path", vpnSiteName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -158,7 +158,7 @@ func (client VpnSiteLinksClient) ListByVpnSitePreparer(ctx context.Context, reso "vpnSiteName": autorest.Encode("path", vpnSiteName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnsites.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnsites.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnsites.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnsites.go index 4524ca65ab0c..6baf98b822ef 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnsites.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnsites.go @@ -83,7 +83,7 @@ func (client VpnSitesClient) CreateOrUpdatePreparer(ctx context.Context, resourc "vpnSiteName": autorest.Encode("path", vpnSiteName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -165,7 +165,7 @@ func (client VpnSitesClient) DeletePreparer(ctx context.Context, resourceGroupNa "vpnSiteName": autorest.Encode("path", vpnSiteName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -250,7 +250,7 @@ func (client VpnSitesClient) GetPreparer(ctx context.Context, resourceGroupName "vpnSiteName": autorest.Encode("path", vpnSiteName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -326,7 +326,7 @@ func (client VpnSitesClient) ListPreparer(ctx context.Context) (*http.Request, e "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -442,7 +442,7 @@ func (client VpnSitesClient) ListByResourceGroupPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -556,7 +556,7 @@ func (client VpnSitesClient) UpdateTagsPreparer(ctx context.Context, resourceGro "vpnSiteName": autorest.Encode("path", vpnSiteName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnsitesconfiguration.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnsitesconfiguration.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnsitesconfiguration.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnsitesconfiguration.go index 1cc56fb2eccf..91f1679b9c61 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/vpnsitesconfiguration.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/vpnsitesconfiguration.go @@ -77,7 +77,7 @@ func (client VpnSitesConfigurationClient) DownloadPreparer(ctx context.Context, "virtualWANName": autorest.Encode("path", virtualWANName), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/watchers.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/watchers.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/watchers.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/watchers.go index abdca8fdd90b..b995d820c544 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/watchers.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/watchers.go @@ -89,7 +89,7 @@ func (client WatchersClient) CheckConnectivityPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -178,7 +178,7 @@ func (client WatchersClient) CreateOrUpdatePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -250,7 +250,7 @@ func (client WatchersClient) DeletePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -335,7 +335,7 @@ func (client WatchersClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -415,7 +415,7 @@ func (client WatchersClient) GetAzureReachabilityReportPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -503,7 +503,7 @@ func (client WatchersClient) GetFlowLogStatusPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -596,7 +596,7 @@ func (client WatchersClient) GetNetworkConfigurationDiagnosticPreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -686,7 +686,7 @@ func (client WatchersClient) GetNextHopPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -775,7 +775,7 @@ func (client WatchersClient) GetTopologyPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -857,7 +857,7 @@ func (client WatchersClient) GetTroubleshootingPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -945,7 +945,7 @@ func (client WatchersClient) GetTroubleshootingResultPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1033,7 +1033,7 @@ func (client WatchersClient) GetVMSecurityRulesPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1119,7 +1119,7 @@ func (client WatchersClient) ListPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1190,7 +1190,7 @@ func (client WatchersClient) ListAllPreparer(ctx context.Context) (*http.Request "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1261,7 +1261,7 @@ func (client WatchersClient) ListAvailableProvidersPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1353,7 +1353,7 @@ func (client WatchersClient) SetFlowLogConfigurationPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1442,7 +1442,7 @@ func (client WatchersClient) UpdateTagsPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1524,7 +1524,7 @@ func (client WatchersClient) VerifyIPFlowPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/webapplicationfirewallpolicies.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/webapplicationfirewallpolicies.go similarity index 95% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/webapplicationfirewallpolicies.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/webapplicationfirewallpolicies.go index 5a0a6a2b315e..db5c195a2573 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/webapplicationfirewallpolicies.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/webapplicationfirewallpolicies.go @@ -58,6 +58,12 @@ func (client WebApplicationFirewallPoliciesClient) CreateOrUpdate(ctx context.Co Chain: []validation.Constraint{{Target: "parameters.WebApplicationFirewallPolicyPropertiesFormat.PolicySettings.MaxRequestBodySizeInKb", Name: validation.InclusiveMinimum, Rule: int64(8), Chain: nil}}}, {Target: "parameters.WebApplicationFirewallPolicyPropertiesFormat.PolicySettings.FileUploadLimitInMb", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.WebApplicationFirewallPolicyPropertiesFormat.PolicySettings.FileUploadLimitInMb", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}, + {Target: "parameters.WebApplicationFirewallPolicyPropertiesFormat.PolicySettings.CustomBlockResponseStatusCode", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.WebApplicationFirewallPolicyPropertiesFormat.PolicySettings.CustomBlockResponseStatusCode", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}, + {Target: "parameters.WebApplicationFirewallPolicyPropertiesFormat.PolicySettings.CustomBlockResponseBody", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.WebApplicationFirewallPolicyPropertiesFormat.PolicySettings.CustomBlockResponseBody", Name: validation.MaxLength, Rule: 32768, Chain: nil}, + {Target: "parameters.WebApplicationFirewallPolicyPropertiesFormat.PolicySettings.CustomBlockResponseBody", Name: validation.Pattern, Rule: `^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$`, Chain: nil}, + }}, }}, {Target: "parameters.WebApplicationFirewallPolicyPropertiesFormat.ManagedRules", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.WebApplicationFirewallPolicyPropertiesFormat.ManagedRules.ManagedRuleSets", Name: validation.Null, Rule: true, Chain: nil}}}, @@ -95,7 +101,7 @@ func (client WebApplicationFirewallPoliciesClient) CreateOrUpdatePreparer(ctx co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -173,7 +179,7 @@ func (client WebApplicationFirewallPoliciesClient) DeletePreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -264,7 +270,7 @@ func (client WebApplicationFirewallPoliciesClient) GetPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -343,7 +349,7 @@ func (client WebApplicationFirewallPoliciesClient) ListPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -456,7 +462,7 @@ func (client WebApplicationFirewallPoliciesClient) ListAllPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/webcategories.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/webcategories.go similarity index 99% rename from cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/webcategories.go rename to cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/webcategories.go index 13fb4c1fb72e..bc9fa35445d1 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network/webcategories.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network/webcategories.go @@ -74,7 +74,7 @@ func (client WebCategoriesClient) GetPreparer(ctx context.Context, name string, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -153,7 +153,7 @@ func (client WebCategoriesClient) ListBySubscriptionPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2021-08-01" + const APIVersion = "2022-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/version/version.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/version/version.go index 2dde094414cf..bcfbb15cce0d 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/version/version.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/version/version.go @@ -4,4 +4,4 @@ package version // Licensed under the MIT License. See License.txt in the project root for license information. // Number contains the semantic version of this SDK. -const Number = "v67.2.0" +const Number = "v68.0.0" diff --git a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/token.go b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/token.go index 1a9c8ab537f0..2a24ab80cf16 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/token.go +++ b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/adal/token.go @@ -127,6 +127,9 @@ type TokenRefreshCallback func(Token) error // TokenRefresh is a type representing a custom callback to refresh a token type TokenRefresh func(ctx context.Context, resource string) (*Token, error) +// JWTCallback is the type representing callback that will be called to get the federated OIDC JWT +type JWTCallback func() (string, error) + // Token encapsulates the access token used to authorize Azure requests. // https://docs.microsoft.com/en-us/azure/active-directory/develop/v1-oauth2-client-creds-grant-flow#service-to-service-access-token-response type Token struct { @@ -177,7 +180,7 @@ func (t Token) WillExpireIn(d time.Duration) bool { return !t.Expires().After(time.Now().Add(d)) } -//OAuthToken return the current access token +// OAuthToken return the current access token func (t *Token) OAuthToken() string { return t.AccessToken } @@ -367,14 +370,18 @@ func (secret ServicePrincipalAuthorizationCodeSecret) MarshalJSON() ([]byte, err // ServicePrincipalFederatedSecret implements ServicePrincipalSecret for Federated JWTs. type ServicePrincipalFederatedSecret struct { - jwt string + jwtCallback JWTCallback } // SetAuthenticationValues is a method of the interface ServicePrincipalSecret. // It will populate the form submitted during OAuth Token Acquisition using a JWT signed by an OIDC issuer. -func (secret *ServicePrincipalFederatedSecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error { +func (secret *ServicePrincipalFederatedSecret) SetAuthenticationValues(_ *ServicePrincipalToken, v *url.Values) error { + jwt, err := secret.jwtCallback() + if err != nil { + return err + } - v.Set("client_assertion", secret.jwt) + v.Set("client_assertion", jwt) v.Set("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer") return nil } @@ -687,6 +694,8 @@ func NewServicePrincipalTokenFromAuthorizationCode(oauthConfig OAuthConfig, clie } // NewServicePrincipalTokenFromFederatedToken creates a ServicePrincipalToken from the supplied federated OIDC JWT. +// +// Deprecated: Use NewServicePrincipalTokenFromFederatedTokenWithCallback to refresh jwt dynamically. func NewServicePrincipalTokenFromFederatedToken(oauthConfig OAuthConfig, clientID string, jwt string, resource string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) { if err := validateOAuthConfig(oauthConfig); err != nil { return nil, err @@ -700,12 +709,37 @@ func NewServicePrincipalTokenFromFederatedToken(oauthConfig OAuthConfig, clientI if jwt == "" { return nil, fmt.Errorf("parameter 'jwt' cannot be empty") } + return NewServicePrincipalTokenFromFederatedTokenCallback( + oauthConfig, + clientID, + func() (string, error) { + return jwt, nil + }, + resource, + callbacks..., + ) +} + +// NewServicePrincipalTokenFromFederatedTokenCallback creates a ServicePrincipalToken from the supplied federated OIDC JWTCallback. +func NewServicePrincipalTokenFromFederatedTokenCallback(oauthConfig OAuthConfig, clientID string, jwtCallback JWTCallback, resource string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) { + if err := validateOAuthConfig(oauthConfig); err != nil { + return nil, err + } + if err := validateStringParam(clientID, "clientID"); err != nil { + return nil, err + } + if err := validateStringParam(resource, "resource"); err != nil { + return nil, err + } + if jwtCallback == nil { + return nil, fmt.Errorf("parameter 'jwtCallback' cannot be empty") + } return NewServicePrincipalTokenWithSecret( oauthConfig, clientID, resource, &ServicePrincipalFederatedSecret{ - jwt: jwt, + jwtCallback: jwtCallback, }, callbacks..., ) diff --git a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/autorest.go b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/autorest.go index aafdf021fd6f..211c98d1ed04 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/autorest.go +++ b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/autorest.go @@ -6,33 +6,33 @@ generated Go code. The package breaks sending and responding to HTTP requests into three phases: Preparing, Sending, and Responding. A typical pattern is: - req, err := Prepare(&http.Request{}, - token.WithAuthorization()) + req, err := Prepare(&http.Request{}, + token.WithAuthorization()) - resp, err := Send(req, - WithLogging(logger), - DoErrorIfStatusCode(http.StatusInternalServerError), - DoCloseIfError(), - DoRetryForAttempts(5, time.Second)) + resp, err := Send(req, + WithLogging(logger), + DoErrorIfStatusCode(http.StatusInternalServerError), + DoCloseIfError(), + DoRetryForAttempts(5, time.Second)) - err = Respond(resp, - ByDiscardingBody(), - ByClosing()) + err = Respond(resp, + ByDiscardingBody(), + ByClosing()) Each phase relies on decorators to modify and / or manage processing. Decorators may first modify and then pass the data along, pass the data first and then modify the result, or wrap themselves around passing the data (such as a logger might do). Decorators run in the order provided. For example, the following: - req, err := Prepare(&http.Request{}, - WithBaseURL("https://microsoft.com/"), - WithPath("a"), - WithPath("b"), - WithPath("c")) + req, err := Prepare(&http.Request{}, + WithBaseURL("https://microsoft.com/"), + WithPath("a"), + WithPath("b"), + WithPath("c")) will set the URL to: - https://microsoft.com/a/b/c + https://microsoft.com/a/b/c Preparers and Responders may be shared and re-used (assuming the underlying decorators support sharing and re-use). Performant use is obtained by creating one or more Preparers and Responders diff --git a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go index 1328f1764c23..868345db6868 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go +++ b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go @@ -214,7 +214,7 @@ func (r Resource) String() string { // See https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/template-functions-resource?tabs=json#resourceid. func ParseResourceID(resourceID string) (Resource, error) { - const resourceIDPatternText = `(?i)subscriptions/(.+)/resourceGroups/(.+)/providers/(.+?)/(.+?)/(.+)` + const resourceIDPatternText = `(?i)^/subscriptions/(.+)/resourceGroups/(.+)/providers/(.+?)/(.+?)/(.+)$` resourceIDPattern := regexp.MustCompile(resourceIDPatternText) match := resourceIDPattern.FindStringSubmatch(resourceID) diff --git a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/utility.go b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/utility.go index 3467b8fa6043..d35b3850ab34 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/utility.go +++ b/cluster-autoscaler/vendor/github.com/Azure/go-autorest/autorest/utility.go @@ -60,9 +60,9 @@ func NewDecoder(encodedAs EncodedAs, r io.Reader) Decoder { // is especially useful if there is a chance the data will fail to decode. // encodedAs specifies the expected encoding, r provides the io.Reader to the data, and v // is the decoding destination. -func CopyAndDecode(encodedAs EncodedAs, r io.Reader, v interface{}) (bytes.Buffer, error) { - b := bytes.Buffer{} - return b, NewDecoder(encodedAs, io.TeeReader(r, &b)).Decode(v) +func CopyAndDecode(encodedAs EncodedAs, r io.Reader, v interface{}) (b bytes.Buffer, err error) { + err = NewDecoder(encodedAs, io.TeeReader(r, &b)).Decode(v) + return } // TeeReadCloser returns a ReadCloser that writes to w what it reads from rc. diff --git a/cluster-autoscaler/vendor/github.com/Azure/skewer/.golangci.yml b/cluster-autoscaler/vendor/github.com/Azure/skewer/.golangci.yml index cd462664baf3..56cded8736bd 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/skewer/.golangci.yml +++ b/cluster-autoscaler/vendor/github.com/Azure/skewer/.golangci.yml @@ -77,21 +77,18 @@ linters: - gocyclo - gofmt - goimports - - golint - gomnd - goprintffuncname - gosec - gosimple - govet - ineffassign - - interfacer - lll - misspell - nakedret - noctx - nolintlint - rowserrcheck - - scopelint - staticcheck - structcheck - stylecheck diff --git a/cluster-autoscaler/vendor/github.com/Azure/skewer/README.md b/cluster-autoscaler/vendor/github.com/Azure/skewer/README.md index 33064dd2a451..9a665dc9c552 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/skewer/README.md +++ b/cluster-autoscaler/vendor/github.com/Azure/skewer/README.md @@ -16,7 +16,7 @@ import ( "fmt" "github.com/Azure/go-autorest/autorest/azure/auth" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" //nolint:staticcheck "github.com/Azure/skewer" ) diff --git a/cluster-autoscaler/vendor/github.com/Azure/skewer/cache.go b/cluster-autoscaler/vendor/github.com/Azure/skewer/cache.go index b48f3d8c5d5c..5248d812d4d8 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/skewer/cache.go +++ b/cluster-autoscaler/vendor/github.com/Azure/skewer/cache.go @@ -8,9 +8,10 @@ import ( // Config contains configuration options for a cache. type Config struct { - location string - filter string - client client + location string + includeExtendedLocations string + filter string + client client } // Cache stores a list of known skus, possibly fetched with a provided client @@ -31,6 +32,14 @@ func WithLocation(location string) Option { } } +// WithExtendedLocations is a functional option to include extended locations +func WithExtendedLocations() Option { + return func(c *Config) (*Config, error) { + c.includeExtendedLocations = "true" + return c, nil + } +} + // ErrClientNil will be returned when a user attempts to create a cache // without a client and use it. type ErrClientNil struct { @@ -139,7 +148,7 @@ func NewStaticCache(data []SKU, opts ...Option) (*Cache, error) { } func (c *Cache) refresh(ctx context.Context) error { - data, err := c.config.client.List(ctx, c.config.filter) + data, err := c.config.client.List(ctx, c.config.filter, c.config.includeExtendedLocations) if err != nil { return err } diff --git a/cluster-autoscaler/vendor/github.com/Azure/skewer/clients.go b/cluster-autoscaler/vendor/github.com/Azure/skewer/clients.go index 8d8538d14138..3032bea994ee 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/skewer/clients.go +++ b/cluster-autoscaler/vendor/github.com/Azure/skewer/clients.go @@ -3,7 +3,7 @@ package skewer import ( "context" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" //nolint:staticcheck "github.com/pkg/errors" ) @@ -18,8 +18,8 @@ func newWrappedResourceClient(client ResourceClient) *wrappedResourceClient { } // List greedily traverses all returned sku pages -func (w *wrappedResourceClient) List(ctx context.Context, filter string) ([]compute.ResourceSku, error) { - return iterate(ctx, filter, w.client.ListComplete) +func (w *wrappedResourceClient) List(ctx context.Context, filter, includeExtendedLocations string) ([]compute.ResourceSku, error) { + return iterate(ctx, filter, includeExtendedLocations, w.client.ListComplete) } // wrappedResourceProviderClient defines a wrapper for the typical Azure client @@ -33,19 +33,20 @@ func newWrappedResourceProviderClient(client ResourceProviderClient) *wrappedRes return &wrappedResourceProviderClient{client} } -func (w *wrappedResourceProviderClient) ListComplete(ctx context.Context, filter string) (compute.ResourceSkusResultIterator, error) { - page, err := w.client.List(ctx, filter) +//nolint:lll +func (w *wrappedResourceProviderClient) ListComplete(ctx context.Context, filter, includeExtendedLocations string) (compute.ResourceSkusResultIterator, error) { + page, err := w.client.List(ctx, filter, includeExtendedLocations) if err != nil { return compute.ResourceSkusResultIterator{}, nil } return compute.NewResourceSkusResultIterator(page), nil } -type iterFunc func(context.Context, string) (compute.ResourceSkusResultIterator, error) +type iterFunc func(context.Context, string, string) (compute.ResourceSkusResultIterator, error) // iterate invokes fn to get an iterator, then drains it into an array. -func iterate(ctx context.Context, filter string, fn iterFunc) ([]compute.ResourceSku, error) { - iter, err := fn(ctx, filter) +func iterate(ctx context.Context, filter, includeExtendedLocations string, fn iterFunc) ([]compute.ResourceSku, error) { + iter, err := fn(ctx, filter, includeExtendedLocations) if err != nil { return nil, errors.Wrap(err, "could not list resource skus") } diff --git a/cluster-autoscaler/vendor/github.com/Azure/skewer/const.go b/cluster-autoscaler/vendor/github.com/Azure/skewer/const.go index 1be0005c6838..dbebf996dc34 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/skewer/const.go +++ b/cluster-autoscaler/vendor/github.com/Azure/skewer/const.go @@ -49,3 +49,8 @@ const ( // Generation 2. HyperVGeneration2 = "V2" ) + +const ( + ten = 10 + sixtyFour = 64 +) diff --git a/cluster-autoscaler/vendor/github.com/Azure/skewer/interface.go b/cluster-autoscaler/vendor/github.com/Azure/skewer/interface.go index fd20bc3e2028..cac174edf2bf 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/skewer/interface.go +++ b/cluster-autoscaler/vendor/github.com/Azure/skewer/interface.go @@ -3,22 +3,22 @@ package skewer import ( "context" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" //nolint:staticcheck ) // ResourceClient is the required Azure client interface used to populate skewer's data. type ResourceClient interface { - ListComplete(ctx context.Context, filter string) (compute.ResourceSkusResultIterator, error) + ListComplete(ctx context.Context, filter, includeExtendedLocations string) (compute.ResourceSkusResultIterator, error) } // ResourceProviderClient is a convenience interface for uses cases // specific to Azure resource providers. type ResourceProviderClient interface { - List(ctx context.Context, filter string) (compute.ResourceSkusResultPage, error) + List(ctx context.Context, filter, includeExtendedLocations string) (compute.ResourceSkusResultPage, error) } // client defines the internal interface required by the skewer Cache. // TODO(ace): implement a lazy iterator with caching (and a cursor?) type client interface { - List(ctx context.Context, filter string) ([]compute.ResourceSku, error) + List(ctx context.Context, filter, includeExtendedLocations string) ([]compute.ResourceSku, error) } diff --git a/cluster-autoscaler/vendor/github.com/Azure/skewer/sku.go b/cluster-autoscaler/vendor/github.com/Azure/skewer/sku.go index 167c330e03fe..a33c623c7074 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/skewer/sku.go +++ b/cluster-autoscaler/vendor/github.com/Azure/skewer/sku.go @@ -5,7 +5,7 @@ import ( "strconv" "strings" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" //nolint:staticcheck "github.com/pkg/errors" ) @@ -94,7 +94,7 @@ func (s *SKU) IsUltraSSDAvailableInAvailabilityZone(zone string) bool { // IsUltraSSDAvailable returns true when a VM size has ultra SSD enabled // in at least 1 unrestricted zone. // -// Deprecated. Use either IsUltraSSDAvailableWithoutAvailabilityZone or IsUltraSSDAvailableInAvailabilityZone +// Deprecated: use either IsUltraSSDAvailableWithoutAvailabilityZone or IsUltraSSDAvailableInAvailabilityZone func (s *SKU) IsUltraSSDAvailable() bool { return s.HasZonalCapability(UltraSSDAvailable) } @@ -128,7 +128,7 @@ func (s *SKU) GetCapabilityIntegerQuantity(name string) (int64, error) { for _, capability := range *s.Capabilities { if capability.Name != nil && *capability.Name == name { if capability.Value != nil { - intVal, err := strconv.ParseInt(*capability.Value, 10, 64) + intVal, err := strconv.ParseInt(*capability.Value, ten, sixtyFour) if err != nil { return -1, &ErrCapabilityValueParse{name, *capability.Value, err} } @@ -151,7 +151,7 @@ func (s *SKU) GetCapabilityFloatQuantity(name string) (float64, error) { for _, capability := range *s.Capabilities { if capability.Name != nil && *capability.Name == name { if capability.Value != nil { - intVal, err := strconv.ParseFloat(*capability.Value, 64) + intVal, err := strconv.ParseFloat(*capability.Value, sixtyFour) if err != nil { return -1, &ErrCapabilityValueParse{name, *capability.Value, err} } @@ -213,7 +213,7 @@ func (s *SKU) HasZonalCapability(name string) bool { // HasCapabilityInZone return true if the specified capability name is supported in the // specified zone. -func (s *SKU) HasCapabilityInZone(name string, zone string) bool { +func (s *SKU) HasCapabilityInZone(name, zone string) bool { if s.LocationInfo == nil { return false } @@ -281,7 +281,7 @@ func (s *SKU) HasCapabilityWithMinCapacity(name string, value int64) (bool, erro for _, capability := range *s.Capabilities { if capability.Name != nil && strings.EqualFold(*capability.Name, name) { if capability.Value != nil { - intVal, err := strconv.ParseInt(*capability.Value, 10, 64) + intVal, err := strconv.ParseInt(*capability.Value, ten, sixtyFour) if err != nil { return false, errors.Wrapf(err, "failed to parse string '%s' as int64", *capability.Value) } @@ -436,7 +436,7 @@ func (s *SKU) HasLocationRestriction(location string) bool { } // AvailabilityZones returns the list of Availability Zones which have this resource SKU available and unrestricted. -func (s *SKU) AvailabilityZones(location string) map[string]bool { // nolint:gocyclo +func (s *SKU) AvailabilityZones(location string) map[string]bool { //nolint:gocyclo if s.LocationInfo == nil { return nil } diff --git a/cluster-autoscaler/vendor/github.com/Azure/skewer/wrap.go b/cluster-autoscaler/vendor/github.com/Azure/skewer/wrap.go index a9c5eee4e6b5..37cad3712a6b 100644 --- a/cluster-autoscaler/vendor/github.com/Azure/skewer/wrap.go +++ b/cluster-autoscaler/vendor/github.com/Azure/skewer/wrap.go @@ -1,6 +1,6 @@ package skewer -import "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute" +import "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" //nolint:staticcheck // Wrap takes an array of compute resource skus and wraps them into an // array of our richer type. diff --git a/cluster-autoscaler/vendor/github.com/gofrs/uuid/.travis.yml b/cluster-autoscaler/vendor/github.com/gofrs/uuid/.travis.yml deleted file mode 100644 index 0783aaa9c4cf..000000000000 --- a/cluster-autoscaler/vendor/github.com/gofrs/uuid/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: go -sudo: false -go: - - 1.7.x - - 1.8.x - - 1.9.x - - 1.10.x - - 1.11.x - - 1.12.x - - tip -matrix: - allow_failures: - - go: tip - fast_finish: true -before_install: - - go get golang.org/x/tools/cmd/cover -script: - - go test ./... -race -coverprofile=coverage.txt -covermode=atomic -after_success: - - bash <(curl -s https://codecov.io/bash) -notifications: - email: false diff --git a/cluster-autoscaler/vendor/github.com/gofrs/uuid/README.md b/cluster-autoscaler/vendor/github.com/gofrs/uuid/README.md index 2685a832e384..48303001b7c4 100644 --- a/cluster-autoscaler/vendor/github.com/gofrs/uuid/README.md +++ b/cluster-autoscaler/vendor/github.com/gofrs/uuid/README.md @@ -106,3 +106,4 @@ func main() { * [RFC-4122](https://tools.ietf.org/html/rfc4122) * [DCE 1.1: Authentication and Security Services](http://pubs.opengroup.org/onlinepubs/9696989899/chap5.htm#tagcjh_08_02_01_01) +* [New UUID Formats RFC Draft (Peabody) Rev 02](https://datatracker.ietf.org/doc/html/draft-peabody-dispatch-new-uuid-format-02) diff --git a/cluster-autoscaler/vendor/github.com/gofrs/uuid/generator.go b/cluster-autoscaler/vendor/github.com/gofrs/uuid/generator.go index 2783d9e7787f..38bf685029e5 100644 --- a/cluster-autoscaler/vendor/github.com/gofrs/uuid/generator.go +++ b/cluster-autoscaler/vendor/github.com/gofrs/uuid/generator.go @@ -26,6 +26,7 @@ import ( "crypto/rand" "crypto/sha1" "encoding/binary" + "errors" "fmt" "hash" "io" @@ -66,12 +67,45 @@ func NewV5(ns UUID, name string) UUID { return DefaultGenerator.NewV5(ns, name) } +// NewV6 returns a k-sortable UUID based on a timestamp and 48 bits of +// pseudorandom data. The timestamp in a V6 UUID is the same as V1, with the bit +// order being adjusted to allow the UUID to be k-sortable. +// +// This is implemented based on revision 02 of the Peabody UUID draft, and may +// be subject to change pending further revisions. Until the final specification +// revision is finished, changes required to implement updates to the spec will +// not be considered a breaking change. They will happen as a minor version +// releases until the spec is final. +func NewV6() (UUID, error) { + return DefaultGenerator.NewV6() +} + +// NewV7 returns a k-sortable UUID based on the current UNIX epoch, with the +// ability to configure the timestamp's precision from millisecond all the way +// to nanosecond. The additional precision is supported by reducing the amount +// of pseudorandom data that makes up the rest of the UUID. +// +// If an unknown Precision argument is passed to this method it will panic. As +// such it's strongly encouraged to use the package-provided constants for this +// value. +// +// This is implemented based on revision 02 of the Peabody UUID draft, and may +// be subject to change pending further revisions. Until the final specification +// revision is finished, changes required to implement updates to the spec will +// not be considered a breaking change. They will happen as a minor version +// releases until the spec is final. +func NewV7(p Precision) (UUID, error) { + return DefaultGenerator.NewV7(p) +} + // Generator provides an interface for generating UUIDs. type Generator interface { NewV1() (UUID, error) NewV3(ns UUID, name string) UUID NewV4() (UUID, error) NewV5(ns UUID, name string) UUID + NewV6() (UUID, error) + NewV7(Precision) (UUID, error) } // Gen is a reference UUID generator based on the specifications laid out in @@ -97,6 +131,10 @@ type Gen struct { lastTime uint64 clockSequence uint16 hardwareAddr [6]byte + + v7LastTime uint64 + v7LastSubsec uint64 + v7ClockSequence uint16 } // interface check -- build will fail if *Gen doesn't satisfy Generator @@ -182,7 +220,39 @@ func (g *Gen) NewV5(ns UUID, name string) UUID { return u } -// getClockSequence returns the epoch and clock sequence. +// NewV6 returns a k-sortable UUID based on a timestamp and 48 bits of +// pseudorandom data. The timestamp in a V6 UUID is the same as V1, with the bit +// order being adjusted to allow the UUID to be k-sortable. +// +// This is implemented based on revision 02 of the Peabody UUID draft, and may +// be subject to change pending further revisions. Until the final specification +// revision is finished, changes required to implement updates to the spec will +// not be considered a breaking change. They will happen as a minor version +// releases until the spec is final. +func (g *Gen) NewV6() (UUID, error) { + var u UUID + + if _, err := io.ReadFull(g.rand, u[10:]); err != nil { + return Nil, err + } + + timeNow, clockSeq, err := g.getClockSequence() + if err != nil { + return Nil, err + } + + binary.BigEndian.PutUint32(u[0:], uint32(timeNow>>28)) // set time_high + binary.BigEndian.PutUint16(u[4:], uint16(timeNow>>12)) // set time_mid + binary.BigEndian.PutUint16(u[6:], uint16(timeNow&0xfff)) // set time_low (minus four version bits) + binary.BigEndian.PutUint16(u[8:], clockSeq&0x3fff) // set clk_seq_hi_res (minus two variant bits) + + u.SetVersion(V6) + u.SetVariant(VariantRFC4122) + + return u, nil +} + +// getClockSequence returns the epoch and clock sequence for V1 and V6 UUIDs. func (g *Gen) getClockSequence() (uint64, uint16, error) { var err error g.clockSequenceOnce.Do(func() { @@ -210,6 +280,244 @@ func (g *Gen) getClockSequence() (uint64, uint16, error) { return timeNow, g.clockSequence, nil } +// Precision is used to configure the V7 generator, to specify how precise the +// timestamp within the UUID should be. +type Precision byte + +const ( + NanosecondPrecision Precision = iota + MicrosecondPrecision + MillisecondPrecision +) + +func (p Precision) String() string { + switch p { + case NanosecondPrecision: + return "nanosecond" + + case MicrosecondPrecision: + return "microsecond" + + case MillisecondPrecision: + return "millisecond" + + default: + return "unknown" + } +} + +// Duration returns the time.Duration for a specific precision. If the Precision +// value is not known, this returns 0. +func (p Precision) Duration() time.Duration { + switch p { + case NanosecondPrecision: + return time.Nanosecond + + case MicrosecondPrecision: + return time.Microsecond + + case MillisecondPrecision: + return time.Millisecond + + default: + return 0 + } +} + +// NewV7 returns a k-sortable UUID based on the current UNIX epoch, with the +// ability to configure the timestamp's precision from millisecond all the way +// to nanosecond. The additional precision is supported by reducing the amount +// of pseudorandom data that makes up the rest of the UUID. +// +// If an unknown Precision argument is passed to this method it will panic. As +// such it's strongly encouraged to use the package-provided constants for this +// value. +// +// This is implemented based on revision 02 of the Peabody UUID draft, and may +// be subject to change pending further revisions. Until the final specification +// revision is finished, changes required to implement updates to the spec will +// not be considered a breaking change. They will happen as a minor version +// releases until the spec is final. +func (g *Gen) NewV7(p Precision) (UUID, error) { + var u UUID + var err error + + switch p { + case NanosecondPrecision: + u, err = g.newV7Nano() + + case MicrosecondPrecision: + u, err = g.newV7Micro() + + case MillisecondPrecision: + u, err = g.newV7Milli() + + default: + panic(fmt.Sprintf("unknown precision value %d", p)) + } + + if err != nil { + return Nil, err + } + + u.SetVersion(V7) + u.SetVariant(VariantRFC4122) + + return u, nil +} + +func (g *Gen) newV7Milli() (UUID, error) { + var u UUID + + if _, err := io.ReadFull(g.rand, u[8:]); err != nil { + return Nil, err + } + + sec, nano, seq, err := g.getV7ClockSequence(MillisecondPrecision) + if err != nil { + return Nil, err + } + + msec := (nano / 1000000) & 0xfff + + d := (sec << 28) // set unixts field + d |= (msec << 16) // set msec field + d |= (uint64(seq) & 0xfff) // set seq field + + binary.BigEndian.PutUint64(u[:], d) + + return u, nil +} + +func (g *Gen) newV7Micro() (UUID, error) { + var u UUID + + if _, err := io.ReadFull(g.rand, u[10:]); err != nil { + return Nil, err + } + + sec, nano, seq, err := g.getV7ClockSequence(MicrosecondPrecision) + if err != nil { + return Nil, err + } + + usec := nano / 1000 + usech := (usec << 4) & 0xfff0000 + usecl := usec & 0xfff + + d := (sec << 28) // set unixts field + d |= usech | usecl // set usec fields + + binary.BigEndian.PutUint64(u[:], d) + binary.BigEndian.PutUint16(u[8:], seq) + + return u, nil +} + +func (g *Gen) newV7Nano() (UUID, error) { + var u UUID + + if _, err := io.ReadFull(g.rand, u[11:]); err != nil { + return Nil, err + } + + sec, nano, seq, err := g.getV7ClockSequence(NanosecondPrecision) + if err != nil { + return Nil, err + } + + nano &= 0x3fffffffff + nanoh := nano >> 26 + nanom := (nano >> 14) & 0xfff + nanol := uint16(nano & 0x3fff) + + d := (sec << 28) // set unixts field + d |= (nanoh << 16) | nanom // set nsec high and med fields + + binary.BigEndian.PutUint64(u[:], d) + binary.BigEndian.PutUint16(u[8:], nanol) // set nsec low field + + u[10] = byte(seq) // set seq field + + return u, nil +} + +const ( + maxSeq14 = (1 << 14) - 1 + maxSeq12 = (1 << 12) - 1 + maxSeq8 = (1 << 8) - 1 +) + +// getV7ClockSequence returns the unix epoch, nanoseconds of current second, and +// the sequence for V7 UUIDs. +func (g *Gen) getV7ClockSequence(p Precision) (epoch uint64, nano uint64, seq uint16, err error) { + g.storageMutex.Lock() + defer g.storageMutex.Unlock() + + tn := g.epochFunc() + unix := uint64(tn.Unix()) + nsec := uint64(tn.Nanosecond()) + + // V7 UUIDs have more precise requirements around how the clock sequence + // value is generated and used. Specifically they require that the sequence + // be zero, unless we've already generated a UUID within this unit of time + // (millisecond, microsecond, or nanosecond) at which point you should + // increment the sequence. Likewise if time has warped backwards for some reason (NTP + // adjustment?), we also increment the clock sequence to reduce the risk of a + // collision. + switch { + case unix < g.v7LastTime: + g.v7ClockSequence++ + + case unix > g.v7LastTime: + g.v7ClockSequence = 0 + + case unix == g.v7LastTime: + switch p { + case NanosecondPrecision: + if nsec <= g.v7LastSubsec { + if g.v7ClockSequence >= maxSeq8 { + return 0, 0, 0, errors.New("generating nanosecond precision UUIDv7s too fast: internal clock sequence would roll over") + } + + g.v7ClockSequence++ + } else { + g.v7ClockSequence = 0 + } + + case MicrosecondPrecision: + if nsec/1000 <= g.v7LastSubsec/1000 { + if g.v7ClockSequence >= maxSeq14 { + return 0, 0, 0, errors.New("generating microsecond precision UUIDv7s too fast: internal clock sequence would roll over") + } + + g.v7ClockSequence++ + } else { + g.v7ClockSequence = 0 + } + + case MillisecondPrecision: + if nsec/1000000 <= g.v7LastSubsec/1000000 { + if g.v7ClockSequence >= maxSeq12 { + return 0, 0, 0, errors.New("generating millisecond precision UUIDv7s too fast: internal clock sequence would roll over") + } + + g.v7ClockSequence++ + } else { + g.v7ClockSequence = 0 + } + + default: + panic(fmt.Sprintf("unknown precision value %d", p)) + } + } + + g.v7LastTime = unix + g.v7LastSubsec = nsec + + return unix, nsec, g.v7ClockSequence, nil +} + // Returns the hardware address. func (g *Gen) getHardwareAddr() ([]byte, error) { var err error diff --git a/cluster-autoscaler/vendor/github.com/gofrs/uuid/uuid.go b/cluster-autoscaler/vendor/github.com/gofrs/uuid/uuid.go index 78aed6e2539b..f314b8457362 100644 --- a/cluster-autoscaler/vendor/github.com/gofrs/uuid/uuid.go +++ b/cluster-autoscaler/vendor/github.com/gofrs/uuid/uuid.go @@ -20,11 +20,13 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // Package uuid provides implementations of the Universally Unique Identifier -// (UUID), as specified in RFC-4122, +// (UUID), as specified in RFC-4122 and the Peabody RFC Draft (revision 02). // -// RFC-4122[1] provides the specification for versions 1, 3, 4, and 5. +// RFC-4122[1] provides the specification for versions 1, 3, 4, and 5. The +// Peabody UUID RFC Draft[2] provides the specification for the new k-sortable +// UUIDs, versions 6 and 7. // -// DCE 1.1[2] provides the specification for version 2, but version 2 support +// DCE 1.1[3] provides the specification for version 2, but version 2 support // was removed from this package in v4 due to some concerns with the // specification itself. Reading the spec, it seems that it would result in // generating UUIDs that aren't very unique. In having read the spec it seemed @@ -34,7 +36,8 @@ // ensure we were understanding the specification correctly. // // [1] https://tools.ietf.org/html/rfc4122 -// [2] http://pubs.opengroup.org/onlinepubs/9696989899/chap5.htm#tagcjh_08_02_01_01 +// [2] https://datatracker.ietf.org/doc/html/draft-peabody-dispatch-new-uuid-format-02 +// [3] http://pubs.opengroup.org/onlinepubs/9696989899/chap5.htm#tagcjh_08_02_01_01 package uuid import ( @@ -60,6 +63,9 @@ const ( V3 // Version 3 (namespace name-based) V4 // Version 4 (random) V5 // Version 5 (namespace name-based) + V6 // Version 6 (k-sortable timestamp and random data) [peabody draft] + V7 // Version 7 (k-sortable timestamp, with configurable precision, and random data) [peabody draft] + _ // Version 8 (k-sortable timestamp, meant for custom implementations) [peabody draft] [not implemented] ) // UUID layout variants. @@ -88,6 +94,7 @@ const _100nsPerSecond = 10000000 func (t Timestamp) Time() (time.Time, error) { secs := uint64(t) / _100nsPerSecond nsecs := 100 * (uint64(t) % _100nsPerSecond) + return time.Unix(int64(secs)-(epochStart/_100nsPerSecond), int64(nsecs)), nil } @@ -98,12 +105,34 @@ func TimestampFromV1(u UUID) (Timestamp, error) { err := fmt.Errorf("uuid: %s is version %d, not version 1", u, u.Version()) return 0, err } + low := binary.BigEndian.Uint32(u[0:4]) mid := binary.BigEndian.Uint16(u[4:6]) hi := binary.BigEndian.Uint16(u[6:8]) & 0xfff + return Timestamp(uint64(low) + (uint64(mid) << 32) + (uint64(hi) << 48)), nil } +// TimestampFromV6 returns the Timestamp embedded within a V6 UUID. This +// function returns an error if the UUID is any version other than 6. +// +// This is implemented based on revision 01 of the Peabody UUID draft, and may +// be subject to change pending further revisions. Until the final specification +// revision is finished, changes required to implement updates to the spec will +// not be considered a breaking change. They will happen as a minor version +// releases until the spec is final. +func TimestampFromV6(u UUID) (Timestamp, error) { + if u.Version() != 6 { + return 0, fmt.Errorf("uuid: %s is version %d, not version 6", u, u.Version()) + } + + hi := binary.BigEndian.Uint32(u[0:4]) + mid := binary.BigEndian.Uint16(u[4:6]) + low := binary.BigEndian.Uint16(u[6:8]) & 0xfff + + return Timestamp(uint64(low) + (uint64(mid) << 12) + (uint64(hi) << 28)), nil +} + // String parse helpers. var ( urnPrefix = []byte("urn:uuid:") @@ -122,6 +151,11 @@ var ( NamespaceX500 = Must(FromString("6ba7b814-9dad-11d1-80b4-00c04fd430c8")) ) +// IsNil returns if the UUID is equal to the nil UUID +func (u UUID) IsNil() bool { + return u == Nil +} + // Version returns the algorithm version used to generate the UUID. func (u UUID) Version() byte { return u[6] >> 4 diff --git a/cluster-autoscaler/vendor/github.com/golang-jwt/jwt/v4/README.md b/cluster-autoscaler/vendor/github.com/golang-jwt/jwt/v4/README.md index f5d551ca8fd8..30f2f2a6f70c 100644 --- a/cluster-autoscaler/vendor/github.com/golang-jwt/jwt/v4/README.md +++ b/cluster-autoscaler/vendor/github.com/golang-jwt/jwt/v4/README.md @@ -54,9 +54,9 @@ import "github.com/golang-jwt/jwt/v4" See [the project documentation](https://pkg.go.dev/github.com/golang-jwt/jwt/v4) for examples of usage: -* [Simple example of parsing and validating a token](https://pkg.go.dev/github.com/golang-jwt/jwt#example-Parse-Hmac) -* [Simple example of building and signing a token](https://pkg.go.dev/github.com/golang-jwt/jwt#example-New-Hmac) -* [Directory of Examples](https://pkg.go.dev/github.com/golang-jwt/jwt#pkg-examples) +* [Simple example of parsing and validating a token](https://pkg.go.dev/github.com/golang-jwt/jwt/v4#example-Parse-Hmac) +* [Simple example of building and signing a token](https://pkg.go.dev/github.com/golang-jwt/jwt/v4#example-New-Hmac) +* [Directory of Examples](https://pkg.go.dev/github.com/golang-jwt/jwt/v4#pkg-examples) ## Extensions @@ -96,7 +96,7 @@ A token is simply a JSON object that is signed by its author. this tells you exa * The author of the token was in the possession of the signing secret * The data has not been modified since it was signed -It's important to know that JWT does not provide encryption, which means anyone who has access to the token can read its contents. If you need to protect (encrypt) the data, there is a companion spec, `JWE`, that provides this functionality. JWE is currently outside the scope of this library. +It's important to know that JWT does not provide encryption, which means anyone who has access to the token can read its contents. If you need to protect (encrypt) the data, there is a companion spec, `JWE`, that provides this functionality. The companion project https://github.com/golang-jwt/jwe aims at a (very) experimental implementation of the JWE standard. ### Choosing a Signing Method @@ -110,10 +110,10 @@ Asymmetric signing methods, such as RSA, use different keys for signing and veri Each signing method expects a different object type for its signing keys. See the package documentation for details. Here are the most common ones: -* The [HMAC signing method](https://pkg.go.dev/github.com/golang-jwt/jwt#SigningMethodHMAC) (`HS256`,`HS384`,`HS512`) expect `[]byte` values for signing and validation -* The [RSA signing method](https://pkg.go.dev/github.com/golang-jwt/jwt#SigningMethodRSA) (`RS256`,`RS384`,`RS512`) expect `*rsa.PrivateKey` for signing and `*rsa.PublicKey` for validation -* The [ECDSA signing method](https://pkg.go.dev/github.com/golang-jwt/jwt#SigningMethodECDSA) (`ES256`,`ES384`,`ES512`) expect `*ecdsa.PrivateKey` for signing and `*ecdsa.PublicKey` for validation -* The [EdDSA signing method](https://pkg.go.dev/github.com/golang-jwt/jwt#SigningMethodEd25519) (`Ed25519`) expect `ed25519.PrivateKey` for signing and `ed25519.PublicKey` for validation +* The [HMAC signing method](https://pkg.go.dev/github.com/golang-jwt/jwt/v4#SigningMethodHMAC) (`HS256`,`HS384`,`HS512`) expect `[]byte` values for signing and validation +* The [RSA signing method](https://pkg.go.dev/github.com/golang-jwt/jwt/v4#SigningMethodRSA) (`RS256`,`RS384`,`RS512`) expect `*rsa.PrivateKey` for signing and `*rsa.PublicKey` for validation +* The [ECDSA signing method](https://pkg.go.dev/github.com/golang-jwt/jwt/v4#SigningMethodECDSA) (`ES256`,`ES384`,`ES512`) expect `*ecdsa.PrivateKey` for signing and `*ecdsa.PublicKey` for validation +* The [EdDSA signing method](https://pkg.go.dev/github.com/golang-jwt/jwt/v4#SigningMethodEd25519) (`Ed25519`) expect `ed25519.PrivateKey` for signing and `ed25519.PublicKey` for validation ### JWT and OAuth @@ -131,7 +131,7 @@ This library uses descriptive error messages whenever possible. If you are not g ## More -Documentation can be found [on pkg.go.dev](https://pkg.go.dev/github.com/golang-jwt/jwt). +Documentation can be found [on pkg.go.dev](https://pkg.go.dev/github.com/golang-jwt/jwt/v4). The command line utility included in this project (cmd/jwt) provides a straightforward example of token creation and parsing as well as a useful tool for debugging your own integration. You'll also find several implementation examples in the documentation. diff --git a/cluster-autoscaler/vendor/github.com/golang-jwt/jwt/v4/claims.go b/cluster-autoscaler/vendor/github.com/golang-jwt/jwt/v4/claims.go index 9d95cad2bf27..364cec8773cd 100644 --- a/cluster-autoscaler/vendor/github.com/golang-jwt/jwt/v4/claims.go +++ b/cluster-autoscaler/vendor/github.com/golang-jwt/jwt/v4/claims.go @@ -265,9 +265,5 @@ func verifyIss(iss string, cmp string, required bool) bool { if iss == "" { return !required } - if subtle.ConstantTimeCompare([]byte(iss), []byte(cmp)) != 0 { - return true - } else { - return false - } + return subtle.ConstantTimeCompare([]byte(iss), []byte(cmp)) != 0 } diff --git a/cluster-autoscaler/vendor/github.com/golang-jwt/jwt/v4/parser.go b/cluster-autoscaler/vendor/github.com/golang-jwt/jwt/v4/parser.go index 2f61a69d7fcb..c0a6f6927917 100644 --- a/cluster-autoscaler/vendor/github.com/golang-jwt/jwt/v4/parser.go +++ b/cluster-autoscaler/vendor/github.com/golang-jwt/jwt/v4/parser.go @@ -42,6 +42,13 @@ func (p *Parser) Parse(tokenString string, keyFunc Keyfunc) (*Token, error) { return p.ParseWithClaims(tokenString, MapClaims{}, keyFunc) } +// ParseWithClaims parses, validates, and verifies like Parse, but supplies a default object implementing the Claims +// interface. This provides default values which can be overridden and allows a caller to use their own type, rather +// than the default MapClaims implementation of Claims. +// +// Note: If you provide a custom claim implementation that embeds one of the standard claims (such as RegisteredClaims), +// make sure that a) you either embed a non-pointer version of the claims or b) if you are using a pointer, allocate the +// proper memory for it before passing in the overall claims, otherwise you might run into a panic. func (p *Parser) ParseWithClaims(tokenString string, claims Claims, keyFunc Keyfunc) (*Token, error) { token, parts, err := p.ParseUnverified(tokenString, claims) if err != nil { diff --git a/cluster-autoscaler/vendor/github.com/golang-jwt/jwt/v4/token.go b/cluster-autoscaler/vendor/github.com/golang-jwt/jwt/v4/token.go index 3cb0f3f0e4c0..786b275ce03a 100644 --- a/cluster-autoscaler/vendor/github.com/golang-jwt/jwt/v4/token.go +++ b/cluster-autoscaler/vendor/github.com/golang-jwt/jwt/v4/token.go @@ -14,6 +14,12 @@ import ( // To use the non-recommended decoding, set this boolean to `true` prior to using this package. var DecodePaddingAllowed bool +// DecodeStrict will switch the codec used for decoding JWTs into strict mode. +// In this mode, the decoder requires that trailing padding bits are zero, as described in RFC 4648 section 3.5. +// Note that this is a global variable, and updating it will change the behavior on a package level, and is also NOT go-routine safe. +// To use strict decoding, set this boolean to `true` prior to using this package. +var DecodeStrict bool + // TimeFunc provides the current time when parsing token to validate "exp" claim (expiration time). // You can override it to use another time value. This is useful for testing or if your // server uses a different time zone than your tokens. @@ -99,6 +105,11 @@ func Parse(tokenString string, keyFunc Keyfunc, options ...ParserOption) (*Token return NewParser(options...).Parse(tokenString, keyFunc) } +// ParseWithClaims is a shortcut for NewParser().ParseWithClaims(). +// +// Note: If you provide a custom claim implementation that embeds one of the standard claims (such as RegisteredClaims), +// make sure that a) you either embed a non-pointer version of the claims or b) if you are using a pointer, allocate the +// proper memory for it before passing in the overall claims, otherwise you might run into a panic. func ParseWithClaims(tokenString string, claims Claims, keyFunc Keyfunc, options ...ParserOption) (*Token, error) { return NewParser(options...).ParseWithClaims(tokenString, claims, keyFunc) } @@ -116,12 +127,17 @@ func EncodeSegment(seg []byte) string { // Deprecated: In a future release, we will demote this function to a non-exported function, since it // should only be used internally func DecodeSegment(seg string) ([]byte, error) { + encoding := base64.RawURLEncoding + if DecodePaddingAllowed { if l := len(seg) % 4; l > 0 { seg += strings.Repeat("=", 4-l) } - return base64.URLEncoding.DecodeString(seg) + encoding = base64.URLEncoding } - return base64.RawURLEncoding.DecodeString(seg) + if DecodeStrict { + encoding = encoding.Strict() + } + return encoding.DecodeString(seg) } diff --git a/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_compare.go b/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_compare.go index 95d8e59da69b..b774da88d86c 100644 --- a/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_compare.go +++ b/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_compare.go @@ -352,9 +352,9 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { // Greater asserts that the first element is greater than the second // -// assert.Greater(t, 2, 1) -// assert.Greater(t, float64(2), float64(1)) -// assert.Greater(t, "b", "a") +// assert.Greater(t, 2, 1) +// assert.Greater(t, float64(2), float64(1)) +// assert.Greater(t, "b", "a") func Greater(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -364,10 +364,10 @@ func Greater(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface // GreaterOrEqual asserts that the first element is greater than or equal to the second // -// assert.GreaterOrEqual(t, 2, 1) -// assert.GreaterOrEqual(t, 2, 2) -// assert.GreaterOrEqual(t, "b", "a") -// assert.GreaterOrEqual(t, "b", "b") +// assert.GreaterOrEqual(t, 2, 1) +// assert.GreaterOrEqual(t, 2, 2) +// assert.GreaterOrEqual(t, "b", "a") +// assert.GreaterOrEqual(t, "b", "b") func GreaterOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -377,9 +377,9 @@ func GreaterOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...in // Less asserts that the first element is less than the second // -// assert.Less(t, 1, 2) -// assert.Less(t, float64(1), float64(2)) -// assert.Less(t, "a", "b") +// assert.Less(t, 1, 2) +// assert.Less(t, float64(1), float64(2)) +// assert.Less(t, "a", "b") func Less(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -389,10 +389,10 @@ func Less(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) // LessOrEqual asserts that the first element is less than or equal to the second // -// assert.LessOrEqual(t, 1, 2) -// assert.LessOrEqual(t, 2, 2) -// assert.LessOrEqual(t, "a", "b") -// assert.LessOrEqual(t, "b", "b") +// assert.LessOrEqual(t, 1, 2) +// assert.LessOrEqual(t, 2, 2) +// assert.LessOrEqual(t, "a", "b") +// assert.LessOrEqual(t, "b", "b") func LessOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -402,8 +402,8 @@ func LessOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...inter // Positive asserts that the specified element is positive // -// assert.Positive(t, 1) -// assert.Positive(t, 1.23) +// assert.Positive(t, 1) +// assert.Positive(t, 1.23) func Positive(t TestingT, e interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -414,8 +414,8 @@ func Positive(t TestingT, e interface{}, msgAndArgs ...interface{}) bool { // Negative asserts that the specified element is negative // -// assert.Negative(t, -1) -// assert.Negative(t, -1.23) +// assert.Negative(t, -1) +// assert.Negative(t, -1.23) func Negative(t TestingT, e interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() diff --git a/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_format.go b/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_format.go index 7880b8f94333..84dbd6c790b9 100644 --- a/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_format.go +++ b/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_format.go @@ -22,9 +22,9 @@ func Conditionf(t TestingT, comp Comparison, msg string, args ...interface{}) bo // Containsf asserts that the specified string, list(array, slice...) or map contains the // specified substring or element. // -// assert.Containsf(t, "Hello World", "World", "error message %s", "formatted") -// assert.Containsf(t, ["Hello", "World"], "World", "error message %s", "formatted") -// assert.Containsf(t, {"Hello": "World"}, "Hello", "error message %s", "formatted") +// assert.Containsf(t, "Hello World", "World", "error message %s", "formatted") +// assert.Containsf(t, ["Hello", "World"], "World", "error message %s", "formatted") +// assert.Containsf(t, {"Hello": "World"}, "Hello", "error message %s", "formatted") func Containsf(t TestingT, s interface{}, contains interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -56,7 +56,7 @@ func ElementsMatchf(t TestingT, listA interface{}, listB interface{}, msg string // Emptyf asserts that the specified object is empty. I.e. nil, "", false, 0 or either // a slice or a channel with len == 0. // -// assert.Emptyf(t, obj, "error message %s", "formatted") +// assert.Emptyf(t, obj, "error message %s", "formatted") func Emptyf(t TestingT, object interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -66,7 +66,7 @@ func Emptyf(t TestingT, object interface{}, msg string, args ...interface{}) boo // Equalf asserts that two objects are equal. // -// assert.Equalf(t, 123, 123, "error message %s", "formatted") +// assert.Equalf(t, 123, 123, "error message %s", "formatted") // // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). Function equality @@ -81,8 +81,8 @@ func Equalf(t TestingT, expected interface{}, actual interface{}, msg string, ar // EqualErrorf asserts that a function returned an error (i.e. not `nil`) // and that it is equal to the provided error. // -// actualObj, err := SomeFunction() -// assert.EqualErrorf(t, err, expectedErrorString, "error message %s", "formatted") +// actualObj, err := SomeFunction() +// assert.EqualErrorf(t, err, expectedErrorString, "error message %s", "formatted") func EqualErrorf(t TestingT, theError error, errString string, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -90,10 +90,27 @@ func EqualErrorf(t TestingT, theError error, errString string, msg string, args return EqualError(t, theError, errString, append([]interface{}{msg}, args...)...) } +// EqualExportedValuesf asserts that the types of two objects are equal and their public +// fields are also equal. This is useful for comparing structs that have private fields +// that could potentially differ. +// +// type S struct { +// Exported int +// notExported int +// } +// assert.EqualExportedValuesf(t, S{1, 2}, S{1, 3}, "error message %s", "formatted") => true +// assert.EqualExportedValuesf(t, S{1, 2}, S{2, 3}, "error message %s", "formatted") => false +func EqualExportedValuesf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + return EqualExportedValues(t, expected, actual, append([]interface{}{msg}, args...)...) +} + // EqualValuesf asserts that two objects are equal or convertable to the same types // and equal. // -// assert.EqualValuesf(t, uint32(123), int32(123), "error message %s", "formatted") +// assert.EqualValuesf(t, uint32(123), int32(123), "error message %s", "formatted") func EqualValuesf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -103,10 +120,10 @@ func EqualValuesf(t TestingT, expected interface{}, actual interface{}, msg stri // Errorf asserts that a function returned an error (i.e. not `nil`). // -// actualObj, err := SomeFunction() -// if assert.Errorf(t, err, "error message %s", "formatted") { -// assert.Equal(t, expectedErrorf, err) -// } +// actualObj, err := SomeFunction() +// if assert.Errorf(t, err, "error message %s", "formatted") { +// assert.Equal(t, expectedErrorf, err) +// } func Errorf(t TestingT, err error, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -126,8 +143,8 @@ func ErrorAsf(t TestingT, err error, target interface{}, msg string, args ...int // ErrorContainsf asserts that a function returned an error (i.e. not `nil`) // and that the error contains the specified substring. // -// actualObj, err := SomeFunction() -// assert.ErrorContainsf(t, err, expectedErrorSubString, "error message %s", "formatted") +// actualObj, err := SomeFunction() +// assert.ErrorContainsf(t, err, expectedErrorSubString, "error message %s", "formatted") func ErrorContainsf(t TestingT, theError error, contains string, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -147,7 +164,7 @@ func ErrorIsf(t TestingT, err error, target error, msg string, args ...interface // Eventuallyf asserts that given condition will be met in waitFor time, // periodically checking target function each tick. // -// assert.Eventuallyf(t, func() bool { return true; }, time.Second, 10*time.Millisecond, "error message %s", "formatted") +// assert.Eventuallyf(t, func() bool { return true; }, time.Second, 10*time.Millisecond, "error message %s", "formatted") func Eventuallyf(t TestingT, condition func() bool, waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -155,9 +172,34 @@ func Eventuallyf(t TestingT, condition func() bool, waitFor time.Duration, tick return Eventually(t, condition, waitFor, tick, append([]interface{}{msg}, args...)...) } +// EventuallyWithTf asserts that given condition will be met in waitFor time, +// periodically checking target function each tick. In contrast to Eventually, +// it supplies a CollectT to the condition function, so that the condition +// function can use the CollectT to call other assertions. +// The condition is considered "met" if no errors are raised in a tick. +// The supplied CollectT collects all errors from one tick (if there are any). +// If the condition is not met before waitFor, the collected errors of +// the last tick are copied to t. +// +// externalValue := false +// go func() { +// time.Sleep(8*time.Second) +// externalValue = true +// }() +// assert.EventuallyWithTf(t, func(c *assert.CollectT, "error message %s", "formatted") { +// // add assertions as needed; any assertion failure will fail the current tick +// assert.True(c, externalValue, "expected 'externalValue' to be true") +// }, 1*time.Second, 10*time.Second, "external state has not changed to 'true'; still false") +func EventuallyWithTf(t TestingT, condition func(collect *CollectT), waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + return EventuallyWithT(t, condition, waitFor, tick, append([]interface{}{msg}, args...)...) +} + // Exactlyf asserts that two objects are equal in value and type. // -// assert.Exactlyf(t, int32(123), int64(123), "error message %s", "formatted") +// assert.Exactlyf(t, int32(123), int64(123), "error message %s", "formatted") func Exactlyf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -183,7 +225,7 @@ func FailNowf(t TestingT, failureMessage string, msg string, args ...interface{} // Falsef asserts that the specified value is false. // -// assert.Falsef(t, myBool, "error message %s", "formatted") +// assert.Falsef(t, myBool, "error message %s", "formatted") func Falsef(t TestingT, value bool, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -202,9 +244,9 @@ func FileExistsf(t TestingT, path string, msg string, args ...interface{}) bool // Greaterf asserts that the first element is greater than the second // -// assert.Greaterf(t, 2, 1, "error message %s", "formatted") -// assert.Greaterf(t, float64(2), float64(1), "error message %s", "formatted") -// assert.Greaterf(t, "b", "a", "error message %s", "formatted") +// assert.Greaterf(t, 2, 1, "error message %s", "formatted") +// assert.Greaterf(t, float64(2), float64(1), "error message %s", "formatted") +// assert.Greaterf(t, "b", "a", "error message %s", "formatted") func Greaterf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -214,10 +256,10 @@ func Greaterf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...in // GreaterOrEqualf asserts that the first element is greater than or equal to the second // -// assert.GreaterOrEqualf(t, 2, 1, "error message %s", "formatted") -// assert.GreaterOrEqualf(t, 2, 2, "error message %s", "formatted") -// assert.GreaterOrEqualf(t, "b", "a", "error message %s", "formatted") -// assert.GreaterOrEqualf(t, "b", "b", "error message %s", "formatted") +// assert.GreaterOrEqualf(t, 2, 1, "error message %s", "formatted") +// assert.GreaterOrEqualf(t, 2, 2, "error message %s", "formatted") +// assert.GreaterOrEqualf(t, "b", "a", "error message %s", "formatted") +// assert.GreaterOrEqualf(t, "b", "b", "error message %s", "formatted") func GreaterOrEqualf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -228,7 +270,7 @@ func GreaterOrEqualf(t TestingT, e1 interface{}, e2 interface{}, msg string, arg // HTTPBodyContainsf asserts that a specified handler returns a // body that contains a string. // -// assert.HTTPBodyContainsf(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") +// assert.HTTPBodyContainsf(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func HTTPBodyContainsf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) bool { @@ -241,7 +283,7 @@ func HTTPBodyContainsf(t TestingT, handler http.HandlerFunc, method string, url // HTTPBodyNotContainsf asserts that a specified handler returns a // body that does not contain a string. // -// assert.HTTPBodyNotContainsf(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") +// assert.HTTPBodyNotContainsf(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func HTTPBodyNotContainsf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) bool { @@ -253,7 +295,7 @@ func HTTPBodyNotContainsf(t TestingT, handler http.HandlerFunc, method string, u // HTTPErrorf asserts that a specified handler returns an error status code. // -// assert.HTTPErrorf(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} +// assert.HTTPErrorf(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} // // Returns whether the assertion was successful (true) or not (false). func HTTPErrorf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) bool { @@ -265,7 +307,7 @@ func HTTPErrorf(t TestingT, handler http.HandlerFunc, method string, url string, // HTTPRedirectf asserts that a specified handler returns a redirect status code. // -// assert.HTTPRedirectf(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} +// assert.HTTPRedirectf(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} // // Returns whether the assertion was successful (true) or not (false). func HTTPRedirectf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) bool { @@ -277,7 +319,7 @@ func HTTPRedirectf(t TestingT, handler http.HandlerFunc, method string, url stri // HTTPStatusCodef asserts that a specified handler returns a specified status code. // -// assert.HTTPStatusCodef(t, myHandler, "GET", "/notImplemented", nil, 501, "error message %s", "formatted") +// assert.HTTPStatusCodef(t, myHandler, "GET", "/notImplemented", nil, 501, "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func HTTPStatusCodef(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msg string, args ...interface{}) bool { @@ -289,7 +331,7 @@ func HTTPStatusCodef(t TestingT, handler http.HandlerFunc, method string, url st // HTTPSuccessf asserts that a specified handler returns a success status code. // -// assert.HTTPSuccessf(t, myHandler, "POST", "http://www.google.com", nil, "error message %s", "formatted") +// assert.HTTPSuccessf(t, myHandler, "POST", "http://www.google.com", nil, "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func HTTPSuccessf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) bool { @@ -301,7 +343,7 @@ func HTTPSuccessf(t TestingT, handler http.HandlerFunc, method string, url strin // Implementsf asserts that an object is implemented by the specified interface. // -// assert.Implementsf(t, (*MyInterface)(nil), new(MyObject), "error message %s", "formatted") +// assert.Implementsf(t, (*MyInterface)(nil), new(MyObject), "error message %s", "formatted") func Implementsf(t TestingT, interfaceObject interface{}, object interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -311,7 +353,7 @@ func Implementsf(t TestingT, interfaceObject interface{}, object interface{}, ms // InDeltaf asserts that the two numerals are within delta of each other. // -// assert.InDeltaf(t, math.Pi, 22/7.0, 0.01, "error message %s", "formatted") +// assert.InDeltaf(t, math.Pi, 22/7.0, 0.01, "error message %s", "formatted") func InDeltaf(t TestingT, expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -353,9 +395,9 @@ func InEpsilonSlicef(t TestingT, expected interface{}, actual interface{}, epsil // IsDecreasingf asserts that the collection is decreasing // -// assert.IsDecreasingf(t, []int{2, 1, 0}, "error message %s", "formatted") -// assert.IsDecreasingf(t, []float{2, 1}, "error message %s", "formatted") -// assert.IsDecreasingf(t, []string{"b", "a"}, "error message %s", "formatted") +// assert.IsDecreasingf(t, []int{2, 1, 0}, "error message %s", "formatted") +// assert.IsDecreasingf(t, []float{2, 1}, "error message %s", "formatted") +// assert.IsDecreasingf(t, []string{"b", "a"}, "error message %s", "formatted") func IsDecreasingf(t TestingT, object interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -365,9 +407,9 @@ func IsDecreasingf(t TestingT, object interface{}, msg string, args ...interface // IsIncreasingf asserts that the collection is increasing // -// assert.IsIncreasingf(t, []int{1, 2, 3}, "error message %s", "formatted") -// assert.IsIncreasingf(t, []float{1, 2}, "error message %s", "formatted") -// assert.IsIncreasingf(t, []string{"a", "b"}, "error message %s", "formatted") +// assert.IsIncreasingf(t, []int{1, 2, 3}, "error message %s", "formatted") +// assert.IsIncreasingf(t, []float{1, 2}, "error message %s", "formatted") +// assert.IsIncreasingf(t, []string{"a", "b"}, "error message %s", "formatted") func IsIncreasingf(t TestingT, object interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -377,9 +419,9 @@ func IsIncreasingf(t TestingT, object interface{}, msg string, args ...interface // IsNonDecreasingf asserts that the collection is not decreasing // -// assert.IsNonDecreasingf(t, []int{1, 1, 2}, "error message %s", "formatted") -// assert.IsNonDecreasingf(t, []float{1, 2}, "error message %s", "formatted") -// assert.IsNonDecreasingf(t, []string{"a", "b"}, "error message %s", "formatted") +// assert.IsNonDecreasingf(t, []int{1, 1, 2}, "error message %s", "formatted") +// assert.IsNonDecreasingf(t, []float{1, 2}, "error message %s", "formatted") +// assert.IsNonDecreasingf(t, []string{"a", "b"}, "error message %s", "formatted") func IsNonDecreasingf(t TestingT, object interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -389,9 +431,9 @@ func IsNonDecreasingf(t TestingT, object interface{}, msg string, args ...interf // IsNonIncreasingf asserts that the collection is not increasing // -// assert.IsNonIncreasingf(t, []int{2, 1, 1}, "error message %s", "formatted") -// assert.IsNonIncreasingf(t, []float{2, 1}, "error message %s", "formatted") -// assert.IsNonIncreasingf(t, []string{"b", "a"}, "error message %s", "formatted") +// assert.IsNonIncreasingf(t, []int{2, 1, 1}, "error message %s", "formatted") +// assert.IsNonIncreasingf(t, []float{2, 1}, "error message %s", "formatted") +// assert.IsNonIncreasingf(t, []string{"b", "a"}, "error message %s", "formatted") func IsNonIncreasingf(t TestingT, object interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -409,7 +451,7 @@ func IsTypef(t TestingT, expectedType interface{}, object interface{}, msg strin // JSONEqf asserts that two JSON strings are equivalent. // -// assert.JSONEqf(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`, "error message %s", "formatted") +// assert.JSONEqf(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`, "error message %s", "formatted") func JSONEqf(t TestingT, expected string, actual string, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -420,7 +462,7 @@ func JSONEqf(t TestingT, expected string, actual string, msg string, args ...int // Lenf asserts that the specified object has specific length. // Lenf also fails if the object has a type that len() not accept. // -// assert.Lenf(t, mySlice, 3, "error message %s", "formatted") +// assert.Lenf(t, mySlice, 3, "error message %s", "formatted") func Lenf(t TestingT, object interface{}, length int, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -430,9 +472,9 @@ func Lenf(t TestingT, object interface{}, length int, msg string, args ...interf // Lessf asserts that the first element is less than the second // -// assert.Lessf(t, 1, 2, "error message %s", "formatted") -// assert.Lessf(t, float64(1), float64(2), "error message %s", "formatted") -// assert.Lessf(t, "a", "b", "error message %s", "formatted") +// assert.Lessf(t, 1, 2, "error message %s", "formatted") +// assert.Lessf(t, float64(1), float64(2), "error message %s", "formatted") +// assert.Lessf(t, "a", "b", "error message %s", "formatted") func Lessf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -442,10 +484,10 @@ func Lessf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...inter // LessOrEqualf asserts that the first element is less than or equal to the second // -// assert.LessOrEqualf(t, 1, 2, "error message %s", "formatted") -// assert.LessOrEqualf(t, 2, 2, "error message %s", "formatted") -// assert.LessOrEqualf(t, "a", "b", "error message %s", "formatted") -// assert.LessOrEqualf(t, "b", "b", "error message %s", "formatted") +// assert.LessOrEqualf(t, 1, 2, "error message %s", "formatted") +// assert.LessOrEqualf(t, 2, 2, "error message %s", "formatted") +// assert.LessOrEqualf(t, "a", "b", "error message %s", "formatted") +// assert.LessOrEqualf(t, "b", "b", "error message %s", "formatted") func LessOrEqualf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -455,8 +497,8 @@ func LessOrEqualf(t TestingT, e1 interface{}, e2 interface{}, msg string, args . // Negativef asserts that the specified element is negative // -// assert.Negativef(t, -1, "error message %s", "formatted") -// assert.Negativef(t, -1.23, "error message %s", "formatted") +// assert.Negativef(t, -1, "error message %s", "formatted") +// assert.Negativef(t, -1.23, "error message %s", "formatted") func Negativef(t TestingT, e interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -467,7 +509,7 @@ func Negativef(t TestingT, e interface{}, msg string, args ...interface{}) bool // Neverf asserts that the given condition doesn't satisfy in waitFor time, // periodically checking the target function each tick. // -// assert.Neverf(t, func() bool { return false; }, time.Second, 10*time.Millisecond, "error message %s", "formatted") +// assert.Neverf(t, func() bool { return false; }, time.Second, 10*time.Millisecond, "error message %s", "formatted") func Neverf(t TestingT, condition func() bool, waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -477,7 +519,7 @@ func Neverf(t TestingT, condition func() bool, waitFor time.Duration, tick time. // Nilf asserts that the specified object is nil. // -// assert.Nilf(t, err, "error message %s", "formatted") +// assert.Nilf(t, err, "error message %s", "formatted") func Nilf(t TestingT, object interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -496,10 +538,10 @@ func NoDirExistsf(t TestingT, path string, msg string, args ...interface{}) bool // NoErrorf asserts that a function returned no error (i.e. `nil`). // -// actualObj, err := SomeFunction() -// if assert.NoErrorf(t, err, "error message %s", "formatted") { -// assert.Equal(t, expectedObj, actualObj) -// } +// actualObj, err := SomeFunction() +// if assert.NoErrorf(t, err, "error message %s", "formatted") { +// assert.Equal(t, expectedObj, actualObj) +// } func NoErrorf(t TestingT, err error, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -519,9 +561,9 @@ func NoFileExistsf(t TestingT, path string, msg string, args ...interface{}) boo // NotContainsf asserts that the specified string, list(array, slice...) or map does NOT contain the // specified substring or element. // -// assert.NotContainsf(t, "Hello World", "Earth", "error message %s", "formatted") -// assert.NotContainsf(t, ["Hello", "World"], "Earth", "error message %s", "formatted") -// assert.NotContainsf(t, {"Hello": "World"}, "Earth", "error message %s", "formatted") +// assert.NotContainsf(t, "Hello World", "Earth", "error message %s", "formatted") +// assert.NotContainsf(t, ["Hello", "World"], "Earth", "error message %s", "formatted") +// assert.NotContainsf(t, {"Hello": "World"}, "Earth", "error message %s", "formatted") func NotContainsf(t TestingT, s interface{}, contains interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -532,9 +574,9 @@ func NotContainsf(t TestingT, s interface{}, contains interface{}, msg string, a // NotEmptyf asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either // a slice or a channel with len == 0. // -// if assert.NotEmptyf(t, obj, "error message %s", "formatted") { -// assert.Equal(t, "two", obj[1]) -// } +// if assert.NotEmptyf(t, obj, "error message %s", "formatted") { +// assert.Equal(t, "two", obj[1]) +// } func NotEmptyf(t TestingT, object interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -544,7 +586,7 @@ func NotEmptyf(t TestingT, object interface{}, msg string, args ...interface{}) // NotEqualf asserts that the specified values are NOT equal. // -// assert.NotEqualf(t, obj1, obj2, "error message %s", "formatted") +// assert.NotEqualf(t, obj1, obj2, "error message %s", "formatted") // // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). @@ -557,7 +599,7 @@ func NotEqualf(t TestingT, expected interface{}, actual interface{}, msg string, // NotEqualValuesf asserts that two objects are not equal even when converted to the same type // -// assert.NotEqualValuesf(t, obj1, obj2, "error message %s", "formatted") +// assert.NotEqualValuesf(t, obj1, obj2, "error message %s", "formatted") func NotEqualValuesf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -576,7 +618,7 @@ func NotErrorIsf(t TestingT, err error, target error, msg string, args ...interf // NotNilf asserts that the specified object is not nil. // -// assert.NotNilf(t, err, "error message %s", "formatted") +// assert.NotNilf(t, err, "error message %s", "formatted") func NotNilf(t TestingT, object interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -586,7 +628,7 @@ func NotNilf(t TestingT, object interface{}, msg string, args ...interface{}) bo // NotPanicsf asserts that the code inside the specified PanicTestFunc does NOT panic. // -// assert.NotPanicsf(t, func(){ RemainCalm() }, "error message %s", "formatted") +// assert.NotPanicsf(t, func(){ RemainCalm() }, "error message %s", "formatted") func NotPanicsf(t TestingT, f PanicTestFunc, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -596,8 +638,8 @@ func NotPanicsf(t TestingT, f PanicTestFunc, msg string, args ...interface{}) bo // NotRegexpf asserts that a specified regexp does not match a string. // -// assert.NotRegexpf(t, regexp.MustCompile("starts"), "it's starting", "error message %s", "formatted") -// assert.NotRegexpf(t, "^start", "it's not starting", "error message %s", "formatted") +// assert.NotRegexpf(t, regexp.MustCompile("starts"), "it's starting", "error message %s", "formatted") +// assert.NotRegexpf(t, "^start", "it's not starting", "error message %s", "formatted") func NotRegexpf(t TestingT, rx interface{}, str interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -607,7 +649,7 @@ func NotRegexpf(t TestingT, rx interface{}, str interface{}, msg string, args .. // NotSamef asserts that two pointers do not reference the same object. // -// assert.NotSamef(t, ptr1, ptr2, "error message %s", "formatted") +// assert.NotSamef(t, ptr1, ptr2, "error message %s", "formatted") // // Both arguments must be pointer variables. Pointer variable sameness is // determined based on the equality of both type and value. @@ -621,7 +663,7 @@ func NotSamef(t TestingT, expected interface{}, actual interface{}, msg string, // NotSubsetf asserts that the specified list(array, slice...) contains not all // elements given in the specified subset(array, slice...). // -// assert.NotSubsetf(t, [1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]", "error message %s", "formatted") +// assert.NotSubsetf(t, [1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]", "error message %s", "formatted") func NotSubsetf(t TestingT, list interface{}, subset interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -639,7 +681,7 @@ func NotZerof(t TestingT, i interface{}, msg string, args ...interface{}) bool { // Panicsf asserts that the code inside the specified PanicTestFunc panics. // -// assert.Panicsf(t, func(){ GoCrazy() }, "error message %s", "formatted") +// assert.Panicsf(t, func(){ GoCrazy() }, "error message %s", "formatted") func Panicsf(t TestingT, f PanicTestFunc, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -651,7 +693,7 @@ func Panicsf(t TestingT, f PanicTestFunc, msg string, args ...interface{}) bool // panics, and that the recovered panic value is an error that satisfies the // EqualError comparison. // -// assert.PanicsWithErrorf(t, "crazy error", func(){ GoCrazy() }, "error message %s", "formatted") +// assert.PanicsWithErrorf(t, "crazy error", func(){ GoCrazy() }, "error message %s", "formatted") func PanicsWithErrorf(t TestingT, errString string, f PanicTestFunc, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -662,7 +704,7 @@ func PanicsWithErrorf(t TestingT, errString string, f PanicTestFunc, msg string, // PanicsWithValuef asserts that the code inside the specified PanicTestFunc panics, and that // the recovered panic value equals the expected panic value. // -// assert.PanicsWithValuef(t, "crazy error", func(){ GoCrazy() }, "error message %s", "formatted") +// assert.PanicsWithValuef(t, "crazy error", func(){ GoCrazy() }, "error message %s", "formatted") func PanicsWithValuef(t TestingT, expected interface{}, f PanicTestFunc, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -672,8 +714,8 @@ func PanicsWithValuef(t TestingT, expected interface{}, f PanicTestFunc, msg str // Positivef asserts that the specified element is positive // -// assert.Positivef(t, 1, "error message %s", "formatted") -// assert.Positivef(t, 1.23, "error message %s", "formatted") +// assert.Positivef(t, 1, "error message %s", "formatted") +// assert.Positivef(t, 1.23, "error message %s", "formatted") func Positivef(t TestingT, e interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -683,8 +725,8 @@ func Positivef(t TestingT, e interface{}, msg string, args ...interface{}) bool // Regexpf asserts that a specified regexp matches a string. // -// assert.Regexpf(t, regexp.MustCompile("start"), "it's starting", "error message %s", "formatted") -// assert.Regexpf(t, "start...$", "it's not starting", "error message %s", "formatted") +// assert.Regexpf(t, regexp.MustCompile("start"), "it's starting", "error message %s", "formatted") +// assert.Regexpf(t, "start...$", "it's not starting", "error message %s", "formatted") func Regexpf(t TestingT, rx interface{}, str interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -694,7 +736,7 @@ func Regexpf(t TestingT, rx interface{}, str interface{}, msg string, args ...in // Samef asserts that two pointers reference the same object. // -// assert.Samef(t, ptr1, ptr2, "error message %s", "formatted") +// assert.Samef(t, ptr1, ptr2, "error message %s", "formatted") // // Both arguments must be pointer variables. Pointer variable sameness is // determined based on the equality of both type and value. @@ -708,7 +750,7 @@ func Samef(t TestingT, expected interface{}, actual interface{}, msg string, arg // Subsetf asserts that the specified list(array, slice...) contains all // elements given in the specified subset(array, slice...). // -// assert.Subsetf(t, [1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]", "error message %s", "formatted") +// assert.Subsetf(t, [1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]", "error message %s", "formatted") func Subsetf(t TestingT, list interface{}, subset interface{}, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -718,7 +760,7 @@ func Subsetf(t TestingT, list interface{}, subset interface{}, msg string, args // Truef asserts that the specified value is true. // -// assert.Truef(t, myBool, "error message %s", "formatted") +// assert.Truef(t, myBool, "error message %s", "formatted") func Truef(t TestingT, value bool, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -728,7 +770,7 @@ func Truef(t TestingT, value bool, msg string, args ...interface{}) bool { // WithinDurationf asserts that the two times are within duration delta of each other. // -// assert.WithinDurationf(t, time.Now(), time.Now(), 10*time.Second, "error message %s", "formatted") +// assert.WithinDurationf(t, time.Now(), time.Now(), 10*time.Second, "error message %s", "formatted") func WithinDurationf(t TestingT, expected time.Time, actual time.Time, delta time.Duration, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -738,7 +780,7 @@ func WithinDurationf(t TestingT, expected time.Time, actual time.Time, delta tim // WithinRangef asserts that a time is within a time range (inclusive). // -// assert.WithinRangef(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second), "error message %s", "formatted") +// assert.WithinRangef(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second), "error message %s", "formatted") func WithinRangef(t TestingT, actual time.Time, start time.Time, end time.Time, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() diff --git a/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_forward.go b/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_forward.go index 339515b8bfb9..b1d94aec53cc 100644 --- a/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_forward.go +++ b/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_forward.go @@ -30,9 +30,9 @@ func (a *Assertions) Conditionf(comp Comparison, msg string, args ...interface{} // Contains asserts that the specified string, list(array, slice...) or map contains the // specified substring or element. // -// a.Contains("Hello World", "World") -// a.Contains(["Hello", "World"], "World") -// a.Contains({"Hello": "World"}, "Hello") +// a.Contains("Hello World", "World") +// a.Contains(["Hello", "World"], "World") +// a.Contains({"Hello": "World"}, "Hello") func (a *Assertions) Contains(s interface{}, contains interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -43,9 +43,9 @@ func (a *Assertions) Contains(s interface{}, contains interface{}, msgAndArgs .. // Containsf asserts that the specified string, list(array, slice...) or map contains the // specified substring or element. // -// a.Containsf("Hello World", "World", "error message %s", "formatted") -// a.Containsf(["Hello", "World"], "World", "error message %s", "formatted") -// a.Containsf({"Hello": "World"}, "Hello", "error message %s", "formatted") +// a.Containsf("Hello World", "World", "error message %s", "formatted") +// a.Containsf(["Hello", "World"], "World", "error message %s", "formatted") +// a.Containsf({"Hello": "World"}, "Hello", "error message %s", "formatted") func (a *Assertions) Containsf(s interface{}, contains interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -98,7 +98,7 @@ func (a *Assertions) ElementsMatchf(listA interface{}, listB interface{}, msg st // Empty asserts that the specified object is empty. I.e. nil, "", false, 0 or either // a slice or a channel with len == 0. // -// a.Empty(obj) +// a.Empty(obj) func (a *Assertions) Empty(object interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -109,7 +109,7 @@ func (a *Assertions) Empty(object interface{}, msgAndArgs ...interface{}) bool { // Emptyf asserts that the specified object is empty. I.e. nil, "", false, 0 or either // a slice or a channel with len == 0. // -// a.Emptyf(obj, "error message %s", "formatted") +// a.Emptyf(obj, "error message %s", "formatted") func (a *Assertions) Emptyf(object interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -119,7 +119,7 @@ func (a *Assertions) Emptyf(object interface{}, msg string, args ...interface{}) // Equal asserts that two objects are equal. // -// a.Equal(123, 123) +// a.Equal(123, 123) // // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). Function equality @@ -134,8 +134,8 @@ func (a *Assertions) Equal(expected interface{}, actual interface{}, msgAndArgs // EqualError asserts that a function returned an error (i.e. not `nil`) // and that it is equal to the provided error. // -// actualObj, err := SomeFunction() -// a.EqualError(err, expectedErrorString) +// actualObj, err := SomeFunction() +// a.EqualError(err, expectedErrorString) func (a *Assertions) EqualError(theError error, errString string, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -146,8 +146,8 @@ func (a *Assertions) EqualError(theError error, errString string, msgAndArgs ... // EqualErrorf asserts that a function returned an error (i.e. not `nil`) // and that it is equal to the provided error. // -// actualObj, err := SomeFunction() -// a.EqualErrorf(err, expectedErrorString, "error message %s", "formatted") +// actualObj, err := SomeFunction() +// a.EqualErrorf(err, expectedErrorString, "error message %s", "formatted") func (a *Assertions) EqualErrorf(theError error, errString string, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -155,10 +155,44 @@ func (a *Assertions) EqualErrorf(theError error, errString string, msg string, a return EqualErrorf(a.t, theError, errString, msg, args...) } +// EqualExportedValues asserts that the types of two objects are equal and their public +// fields are also equal. This is useful for comparing structs that have private fields +// that could potentially differ. +// +// type S struct { +// Exported int +// notExported int +// } +// a.EqualExportedValues(S{1, 2}, S{1, 3}) => true +// a.EqualExportedValues(S{1, 2}, S{2, 3}) => false +func (a *Assertions) EqualExportedValues(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return EqualExportedValues(a.t, expected, actual, msgAndArgs...) +} + +// EqualExportedValuesf asserts that the types of two objects are equal and their public +// fields are also equal. This is useful for comparing structs that have private fields +// that could potentially differ. +// +// type S struct { +// Exported int +// notExported int +// } +// a.EqualExportedValuesf(S{1, 2}, S{1, 3}, "error message %s", "formatted") => true +// a.EqualExportedValuesf(S{1, 2}, S{2, 3}, "error message %s", "formatted") => false +func (a *Assertions) EqualExportedValuesf(expected interface{}, actual interface{}, msg string, args ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return EqualExportedValuesf(a.t, expected, actual, msg, args...) +} + // EqualValues asserts that two objects are equal or convertable to the same types // and equal. // -// a.EqualValues(uint32(123), int32(123)) +// a.EqualValues(uint32(123), int32(123)) func (a *Assertions) EqualValues(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -169,7 +203,7 @@ func (a *Assertions) EqualValues(expected interface{}, actual interface{}, msgAn // EqualValuesf asserts that two objects are equal or convertable to the same types // and equal. // -// a.EqualValuesf(uint32(123), int32(123), "error message %s", "formatted") +// a.EqualValuesf(uint32(123), int32(123), "error message %s", "formatted") func (a *Assertions) EqualValuesf(expected interface{}, actual interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -179,7 +213,7 @@ func (a *Assertions) EqualValuesf(expected interface{}, actual interface{}, msg // Equalf asserts that two objects are equal. // -// a.Equalf(123, 123, "error message %s", "formatted") +// a.Equalf(123, 123, "error message %s", "formatted") // // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). Function equality @@ -193,10 +227,10 @@ func (a *Assertions) Equalf(expected interface{}, actual interface{}, msg string // Error asserts that a function returned an error (i.e. not `nil`). // -// actualObj, err := SomeFunction() -// if a.Error(err) { -// assert.Equal(t, expectedError, err) -// } +// actualObj, err := SomeFunction() +// if a.Error(err) { +// assert.Equal(t, expectedError, err) +// } func (a *Assertions) Error(err error, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -225,8 +259,8 @@ func (a *Assertions) ErrorAsf(err error, target interface{}, msg string, args .. // ErrorContains asserts that a function returned an error (i.e. not `nil`) // and that the error contains the specified substring. // -// actualObj, err := SomeFunction() -// a.ErrorContains(err, expectedErrorSubString) +// actualObj, err := SomeFunction() +// a.ErrorContains(err, expectedErrorSubString) func (a *Assertions) ErrorContains(theError error, contains string, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -237,8 +271,8 @@ func (a *Assertions) ErrorContains(theError error, contains string, msgAndArgs . // ErrorContainsf asserts that a function returned an error (i.e. not `nil`) // and that the error contains the specified substring. // -// actualObj, err := SomeFunction() -// a.ErrorContainsf(err, expectedErrorSubString, "error message %s", "formatted") +// actualObj, err := SomeFunction() +// a.ErrorContainsf(err, expectedErrorSubString, "error message %s", "formatted") func (a *Assertions) ErrorContainsf(theError error, contains string, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -266,10 +300,10 @@ func (a *Assertions) ErrorIsf(err error, target error, msg string, args ...inter // Errorf asserts that a function returned an error (i.e. not `nil`). // -// actualObj, err := SomeFunction() -// if a.Errorf(err, "error message %s", "formatted") { -// assert.Equal(t, expectedErrorf, err) -// } +// actualObj, err := SomeFunction() +// if a.Errorf(err, "error message %s", "formatted") { +// assert.Equal(t, expectedErrorf, err) +// } func (a *Assertions) Errorf(err error, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -280,7 +314,7 @@ func (a *Assertions) Errorf(err error, msg string, args ...interface{}) bool { // Eventually asserts that given condition will be met in waitFor time, // periodically checking target function each tick. // -// a.Eventually(func() bool { return true; }, time.Second, 10*time.Millisecond) +// a.Eventually(func() bool { return true; }, time.Second, 10*time.Millisecond) func (a *Assertions) Eventually(condition func() bool, waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -288,10 +322,60 @@ func (a *Assertions) Eventually(condition func() bool, waitFor time.Duration, ti return Eventually(a.t, condition, waitFor, tick, msgAndArgs...) } +// EventuallyWithT asserts that given condition will be met in waitFor time, +// periodically checking target function each tick. In contrast to Eventually, +// it supplies a CollectT to the condition function, so that the condition +// function can use the CollectT to call other assertions. +// The condition is considered "met" if no errors are raised in a tick. +// The supplied CollectT collects all errors from one tick (if there are any). +// If the condition is not met before waitFor, the collected errors of +// the last tick are copied to t. +// +// externalValue := false +// go func() { +// time.Sleep(8*time.Second) +// externalValue = true +// }() +// a.EventuallyWithT(func(c *assert.CollectT) { +// // add assertions as needed; any assertion failure will fail the current tick +// assert.True(c, externalValue, "expected 'externalValue' to be true") +// }, 1*time.Second, 10*time.Second, "external state has not changed to 'true'; still false") +func (a *Assertions) EventuallyWithT(condition func(collect *CollectT), waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return EventuallyWithT(a.t, condition, waitFor, tick, msgAndArgs...) +} + +// EventuallyWithTf asserts that given condition will be met in waitFor time, +// periodically checking target function each tick. In contrast to Eventually, +// it supplies a CollectT to the condition function, so that the condition +// function can use the CollectT to call other assertions. +// The condition is considered "met" if no errors are raised in a tick. +// The supplied CollectT collects all errors from one tick (if there are any). +// If the condition is not met before waitFor, the collected errors of +// the last tick are copied to t. +// +// externalValue := false +// go func() { +// time.Sleep(8*time.Second) +// externalValue = true +// }() +// a.EventuallyWithTf(func(c *assert.CollectT, "error message %s", "formatted") { +// // add assertions as needed; any assertion failure will fail the current tick +// assert.True(c, externalValue, "expected 'externalValue' to be true") +// }, 1*time.Second, 10*time.Second, "external state has not changed to 'true'; still false") +func (a *Assertions) EventuallyWithTf(condition func(collect *CollectT), waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) bool { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + return EventuallyWithTf(a.t, condition, waitFor, tick, msg, args...) +} + // Eventuallyf asserts that given condition will be met in waitFor time, // periodically checking target function each tick. // -// a.Eventuallyf(func() bool { return true; }, time.Second, 10*time.Millisecond, "error message %s", "formatted") +// a.Eventuallyf(func() bool { return true; }, time.Second, 10*time.Millisecond, "error message %s", "formatted") func (a *Assertions) Eventuallyf(condition func() bool, waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -301,7 +385,7 @@ func (a *Assertions) Eventuallyf(condition func() bool, waitFor time.Duration, t // Exactly asserts that two objects are equal in value and type. // -// a.Exactly(int32(123), int64(123)) +// a.Exactly(int32(123), int64(123)) func (a *Assertions) Exactly(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -311,7 +395,7 @@ func (a *Assertions) Exactly(expected interface{}, actual interface{}, msgAndArg // Exactlyf asserts that two objects are equal in value and type. // -// a.Exactlyf(int32(123), int64(123), "error message %s", "formatted") +// a.Exactlyf(int32(123), int64(123), "error message %s", "formatted") func (a *Assertions) Exactlyf(expected interface{}, actual interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -353,7 +437,7 @@ func (a *Assertions) Failf(failureMessage string, msg string, args ...interface{ // False asserts that the specified value is false. // -// a.False(myBool) +// a.False(myBool) func (a *Assertions) False(value bool, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -363,7 +447,7 @@ func (a *Assertions) False(value bool, msgAndArgs ...interface{}) bool { // Falsef asserts that the specified value is false. // -// a.Falsef(myBool, "error message %s", "formatted") +// a.Falsef(myBool, "error message %s", "formatted") func (a *Assertions) Falsef(value bool, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -391,9 +475,9 @@ func (a *Assertions) FileExistsf(path string, msg string, args ...interface{}) b // Greater asserts that the first element is greater than the second // -// a.Greater(2, 1) -// a.Greater(float64(2), float64(1)) -// a.Greater("b", "a") +// a.Greater(2, 1) +// a.Greater(float64(2), float64(1)) +// a.Greater("b", "a") func (a *Assertions) Greater(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -403,10 +487,10 @@ func (a *Assertions) Greater(e1 interface{}, e2 interface{}, msgAndArgs ...inter // GreaterOrEqual asserts that the first element is greater than or equal to the second // -// a.GreaterOrEqual(2, 1) -// a.GreaterOrEqual(2, 2) -// a.GreaterOrEqual("b", "a") -// a.GreaterOrEqual("b", "b") +// a.GreaterOrEqual(2, 1) +// a.GreaterOrEqual(2, 2) +// a.GreaterOrEqual("b", "a") +// a.GreaterOrEqual("b", "b") func (a *Assertions) GreaterOrEqual(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -416,10 +500,10 @@ func (a *Assertions) GreaterOrEqual(e1 interface{}, e2 interface{}, msgAndArgs . // GreaterOrEqualf asserts that the first element is greater than or equal to the second // -// a.GreaterOrEqualf(2, 1, "error message %s", "formatted") -// a.GreaterOrEqualf(2, 2, "error message %s", "formatted") -// a.GreaterOrEqualf("b", "a", "error message %s", "formatted") -// a.GreaterOrEqualf("b", "b", "error message %s", "formatted") +// a.GreaterOrEqualf(2, 1, "error message %s", "formatted") +// a.GreaterOrEqualf(2, 2, "error message %s", "formatted") +// a.GreaterOrEqualf("b", "a", "error message %s", "formatted") +// a.GreaterOrEqualf("b", "b", "error message %s", "formatted") func (a *Assertions) GreaterOrEqualf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -429,9 +513,9 @@ func (a *Assertions) GreaterOrEqualf(e1 interface{}, e2 interface{}, msg string, // Greaterf asserts that the first element is greater than the second // -// a.Greaterf(2, 1, "error message %s", "formatted") -// a.Greaterf(float64(2), float64(1), "error message %s", "formatted") -// a.Greaterf("b", "a", "error message %s", "formatted") +// a.Greaterf(2, 1, "error message %s", "formatted") +// a.Greaterf(float64(2), float64(1), "error message %s", "formatted") +// a.Greaterf("b", "a", "error message %s", "formatted") func (a *Assertions) Greaterf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -442,7 +526,7 @@ func (a *Assertions) Greaterf(e1 interface{}, e2 interface{}, msg string, args . // HTTPBodyContains asserts that a specified handler returns a // body that contains a string. // -// a.HTTPBodyContains(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") +// a.HTTPBodyContains(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPBodyContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) bool { @@ -455,7 +539,7 @@ func (a *Assertions) HTTPBodyContains(handler http.HandlerFunc, method string, u // HTTPBodyContainsf asserts that a specified handler returns a // body that contains a string. // -// a.HTTPBodyContainsf(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") +// a.HTTPBodyContainsf(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPBodyContainsf(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) bool { @@ -468,7 +552,7 @@ func (a *Assertions) HTTPBodyContainsf(handler http.HandlerFunc, method string, // HTTPBodyNotContains asserts that a specified handler returns a // body that does not contain a string. // -// a.HTTPBodyNotContains(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") +// a.HTTPBodyNotContains(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPBodyNotContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) bool { @@ -481,7 +565,7 @@ func (a *Assertions) HTTPBodyNotContains(handler http.HandlerFunc, method string // HTTPBodyNotContainsf asserts that a specified handler returns a // body that does not contain a string. // -// a.HTTPBodyNotContainsf(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") +// a.HTTPBodyNotContainsf(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPBodyNotContainsf(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) bool { @@ -493,7 +577,7 @@ func (a *Assertions) HTTPBodyNotContainsf(handler http.HandlerFunc, method strin // HTTPError asserts that a specified handler returns an error status code. // -// a.HTTPError(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} +// a.HTTPError(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPError(handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) bool { @@ -505,7 +589,7 @@ func (a *Assertions) HTTPError(handler http.HandlerFunc, method string, url stri // HTTPErrorf asserts that a specified handler returns an error status code. // -// a.HTTPErrorf(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} +// a.HTTPErrorf(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPErrorf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) bool { @@ -517,7 +601,7 @@ func (a *Assertions) HTTPErrorf(handler http.HandlerFunc, method string, url str // HTTPRedirect asserts that a specified handler returns a redirect status code. // -// a.HTTPRedirect(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} +// a.HTTPRedirect(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPRedirect(handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) bool { @@ -529,7 +613,7 @@ func (a *Assertions) HTTPRedirect(handler http.HandlerFunc, method string, url s // HTTPRedirectf asserts that a specified handler returns a redirect status code. // -// a.HTTPRedirectf(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} +// a.HTTPRedirectf(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPRedirectf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) bool { @@ -541,7 +625,7 @@ func (a *Assertions) HTTPRedirectf(handler http.HandlerFunc, method string, url // HTTPStatusCode asserts that a specified handler returns a specified status code. // -// a.HTTPStatusCode(myHandler, "GET", "/notImplemented", nil, 501) +// a.HTTPStatusCode(myHandler, "GET", "/notImplemented", nil, 501) // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPStatusCode(handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msgAndArgs ...interface{}) bool { @@ -553,7 +637,7 @@ func (a *Assertions) HTTPStatusCode(handler http.HandlerFunc, method string, url // HTTPStatusCodef asserts that a specified handler returns a specified status code. // -// a.HTTPStatusCodef(myHandler, "GET", "/notImplemented", nil, 501, "error message %s", "formatted") +// a.HTTPStatusCodef(myHandler, "GET", "/notImplemented", nil, 501, "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPStatusCodef(handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msg string, args ...interface{}) bool { @@ -565,7 +649,7 @@ func (a *Assertions) HTTPStatusCodef(handler http.HandlerFunc, method string, ur // HTTPSuccess asserts that a specified handler returns a success status code. // -// a.HTTPSuccess(myHandler, "POST", "http://www.google.com", nil) +// a.HTTPSuccess(myHandler, "POST", "http://www.google.com", nil) // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPSuccess(handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) bool { @@ -577,7 +661,7 @@ func (a *Assertions) HTTPSuccess(handler http.HandlerFunc, method string, url st // HTTPSuccessf asserts that a specified handler returns a success status code. // -// a.HTTPSuccessf(myHandler, "POST", "http://www.google.com", nil, "error message %s", "formatted") +// a.HTTPSuccessf(myHandler, "POST", "http://www.google.com", nil, "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPSuccessf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) bool { @@ -589,7 +673,7 @@ func (a *Assertions) HTTPSuccessf(handler http.HandlerFunc, method string, url s // Implements asserts that an object is implemented by the specified interface. // -// a.Implements((*MyInterface)(nil), new(MyObject)) +// a.Implements((*MyInterface)(nil), new(MyObject)) func (a *Assertions) Implements(interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -599,7 +683,7 @@ func (a *Assertions) Implements(interfaceObject interface{}, object interface{}, // Implementsf asserts that an object is implemented by the specified interface. // -// a.Implementsf((*MyInterface)(nil), new(MyObject), "error message %s", "formatted") +// a.Implementsf((*MyInterface)(nil), new(MyObject), "error message %s", "formatted") func (a *Assertions) Implementsf(interfaceObject interface{}, object interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -609,7 +693,7 @@ func (a *Assertions) Implementsf(interfaceObject interface{}, object interface{} // InDelta asserts that the two numerals are within delta of each other. // -// a.InDelta(math.Pi, 22/7.0, 0.01) +// a.InDelta(math.Pi, 22/7.0, 0.01) func (a *Assertions) InDelta(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -651,7 +735,7 @@ func (a *Assertions) InDeltaSlicef(expected interface{}, actual interface{}, del // InDeltaf asserts that the two numerals are within delta of each other. // -// a.InDeltaf(math.Pi, 22/7.0, 0.01, "error message %s", "formatted") +// a.InDeltaf(math.Pi, 22/7.0, 0.01, "error message %s", "formatted") func (a *Assertions) InDeltaf(expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -693,9 +777,9 @@ func (a *Assertions) InEpsilonf(expected interface{}, actual interface{}, epsilo // IsDecreasing asserts that the collection is decreasing // -// a.IsDecreasing([]int{2, 1, 0}) -// a.IsDecreasing([]float{2, 1}) -// a.IsDecreasing([]string{"b", "a"}) +// a.IsDecreasing([]int{2, 1, 0}) +// a.IsDecreasing([]float{2, 1}) +// a.IsDecreasing([]string{"b", "a"}) func (a *Assertions) IsDecreasing(object interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -705,9 +789,9 @@ func (a *Assertions) IsDecreasing(object interface{}, msgAndArgs ...interface{}) // IsDecreasingf asserts that the collection is decreasing // -// a.IsDecreasingf([]int{2, 1, 0}, "error message %s", "formatted") -// a.IsDecreasingf([]float{2, 1}, "error message %s", "formatted") -// a.IsDecreasingf([]string{"b", "a"}, "error message %s", "formatted") +// a.IsDecreasingf([]int{2, 1, 0}, "error message %s", "formatted") +// a.IsDecreasingf([]float{2, 1}, "error message %s", "formatted") +// a.IsDecreasingf([]string{"b", "a"}, "error message %s", "formatted") func (a *Assertions) IsDecreasingf(object interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -717,9 +801,9 @@ func (a *Assertions) IsDecreasingf(object interface{}, msg string, args ...inter // IsIncreasing asserts that the collection is increasing // -// a.IsIncreasing([]int{1, 2, 3}) -// a.IsIncreasing([]float{1, 2}) -// a.IsIncreasing([]string{"a", "b"}) +// a.IsIncreasing([]int{1, 2, 3}) +// a.IsIncreasing([]float{1, 2}) +// a.IsIncreasing([]string{"a", "b"}) func (a *Assertions) IsIncreasing(object interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -729,9 +813,9 @@ func (a *Assertions) IsIncreasing(object interface{}, msgAndArgs ...interface{}) // IsIncreasingf asserts that the collection is increasing // -// a.IsIncreasingf([]int{1, 2, 3}, "error message %s", "formatted") -// a.IsIncreasingf([]float{1, 2}, "error message %s", "formatted") -// a.IsIncreasingf([]string{"a", "b"}, "error message %s", "formatted") +// a.IsIncreasingf([]int{1, 2, 3}, "error message %s", "formatted") +// a.IsIncreasingf([]float{1, 2}, "error message %s", "formatted") +// a.IsIncreasingf([]string{"a", "b"}, "error message %s", "formatted") func (a *Assertions) IsIncreasingf(object interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -741,9 +825,9 @@ func (a *Assertions) IsIncreasingf(object interface{}, msg string, args ...inter // IsNonDecreasing asserts that the collection is not decreasing // -// a.IsNonDecreasing([]int{1, 1, 2}) -// a.IsNonDecreasing([]float{1, 2}) -// a.IsNonDecreasing([]string{"a", "b"}) +// a.IsNonDecreasing([]int{1, 1, 2}) +// a.IsNonDecreasing([]float{1, 2}) +// a.IsNonDecreasing([]string{"a", "b"}) func (a *Assertions) IsNonDecreasing(object interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -753,9 +837,9 @@ func (a *Assertions) IsNonDecreasing(object interface{}, msgAndArgs ...interface // IsNonDecreasingf asserts that the collection is not decreasing // -// a.IsNonDecreasingf([]int{1, 1, 2}, "error message %s", "formatted") -// a.IsNonDecreasingf([]float{1, 2}, "error message %s", "formatted") -// a.IsNonDecreasingf([]string{"a", "b"}, "error message %s", "formatted") +// a.IsNonDecreasingf([]int{1, 1, 2}, "error message %s", "formatted") +// a.IsNonDecreasingf([]float{1, 2}, "error message %s", "formatted") +// a.IsNonDecreasingf([]string{"a", "b"}, "error message %s", "formatted") func (a *Assertions) IsNonDecreasingf(object interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -765,9 +849,9 @@ func (a *Assertions) IsNonDecreasingf(object interface{}, msg string, args ...in // IsNonIncreasing asserts that the collection is not increasing // -// a.IsNonIncreasing([]int{2, 1, 1}) -// a.IsNonIncreasing([]float{2, 1}) -// a.IsNonIncreasing([]string{"b", "a"}) +// a.IsNonIncreasing([]int{2, 1, 1}) +// a.IsNonIncreasing([]float{2, 1}) +// a.IsNonIncreasing([]string{"b", "a"}) func (a *Assertions) IsNonIncreasing(object interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -777,9 +861,9 @@ func (a *Assertions) IsNonIncreasing(object interface{}, msgAndArgs ...interface // IsNonIncreasingf asserts that the collection is not increasing // -// a.IsNonIncreasingf([]int{2, 1, 1}, "error message %s", "formatted") -// a.IsNonIncreasingf([]float{2, 1}, "error message %s", "formatted") -// a.IsNonIncreasingf([]string{"b", "a"}, "error message %s", "formatted") +// a.IsNonIncreasingf([]int{2, 1, 1}, "error message %s", "formatted") +// a.IsNonIncreasingf([]float{2, 1}, "error message %s", "formatted") +// a.IsNonIncreasingf([]string{"b", "a"}, "error message %s", "formatted") func (a *Assertions) IsNonIncreasingf(object interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -805,7 +889,7 @@ func (a *Assertions) IsTypef(expectedType interface{}, object interface{}, msg s // JSONEq asserts that two JSON strings are equivalent. // -// a.JSONEq(`{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`) +// a.JSONEq(`{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`) func (a *Assertions) JSONEq(expected string, actual string, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -815,7 +899,7 @@ func (a *Assertions) JSONEq(expected string, actual string, msgAndArgs ...interf // JSONEqf asserts that two JSON strings are equivalent. // -// a.JSONEqf(`{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`, "error message %s", "formatted") +// a.JSONEqf(`{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`, "error message %s", "formatted") func (a *Assertions) JSONEqf(expected string, actual string, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -826,7 +910,7 @@ func (a *Assertions) JSONEqf(expected string, actual string, msg string, args .. // Len asserts that the specified object has specific length. // Len also fails if the object has a type that len() not accept. // -// a.Len(mySlice, 3) +// a.Len(mySlice, 3) func (a *Assertions) Len(object interface{}, length int, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -837,7 +921,7 @@ func (a *Assertions) Len(object interface{}, length int, msgAndArgs ...interface // Lenf asserts that the specified object has specific length. // Lenf also fails if the object has a type that len() not accept. // -// a.Lenf(mySlice, 3, "error message %s", "formatted") +// a.Lenf(mySlice, 3, "error message %s", "formatted") func (a *Assertions) Lenf(object interface{}, length int, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -847,9 +931,9 @@ func (a *Assertions) Lenf(object interface{}, length int, msg string, args ...in // Less asserts that the first element is less than the second // -// a.Less(1, 2) -// a.Less(float64(1), float64(2)) -// a.Less("a", "b") +// a.Less(1, 2) +// a.Less(float64(1), float64(2)) +// a.Less("a", "b") func (a *Assertions) Less(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -859,10 +943,10 @@ func (a *Assertions) Less(e1 interface{}, e2 interface{}, msgAndArgs ...interfac // LessOrEqual asserts that the first element is less than or equal to the second // -// a.LessOrEqual(1, 2) -// a.LessOrEqual(2, 2) -// a.LessOrEqual("a", "b") -// a.LessOrEqual("b", "b") +// a.LessOrEqual(1, 2) +// a.LessOrEqual(2, 2) +// a.LessOrEqual("a", "b") +// a.LessOrEqual("b", "b") func (a *Assertions) LessOrEqual(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -872,10 +956,10 @@ func (a *Assertions) LessOrEqual(e1 interface{}, e2 interface{}, msgAndArgs ...i // LessOrEqualf asserts that the first element is less than or equal to the second // -// a.LessOrEqualf(1, 2, "error message %s", "formatted") -// a.LessOrEqualf(2, 2, "error message %s", "formatted") -// a.LessOrEqualf("a", "b", "error message %s", "formatted") -// a.LessOrEqualf("b", "b", "error message %s", "formatted") +// a.LessOrEqualf(1, 2, "error message %s", "formatted") +// a.LessOrEqualf(2, 2, "error message %s", "formatted") +// a.LessOrEqualf("a", "b", "error message %s", "formatted") +// a.LessOrEqualf("b", "b", "error message %s", "formatted") func (a *Assertions) LessOrEqualf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -885,9 +969,9 @@ func (a *Assertions) LessOrEqualf(e1 interface{}, e2 interface{}, msg string, ar // Lessf asserts that the first element is less than the second // -// a.Lessf(1, 2, "error message %s", "formatted") -// a.Lessf(float64(1), float64(2), "error message %s", "formatted") -// a.Lessf("a", "b", "error message %s", "formatted") +// a.Lessf(1, 2, "error message %s", "formatted") +// a.Lessf(float64(1), float64(2), "error message %s", "formatted") +// a.Lessf("a", "b", "error message %s", "formatted") func (a *Assertions) Lessf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -897,8 +981,8 @@ func (a *Assertions) Lessf(e1 interface{}, e2 interface{}, msg string, args ...i // Negative asserts that the specified element is negative // -// a.Negative(-1) -// a.Negative(-1.23) +// a.Negative(-1) +// a.Negative(-1.23) func (a *Assertions) Negative(e interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -908,8 +992,8 @@ func (a *Assertions) Negative(e interface{}, msgAndArgs ...interface{}) bool { // Negativef asserts that the specified element is negative // -// a.Negativef(-1, "error message %s", "formatted") -// a.Negativef(-1.23, "error message %s", "formatted") +// a.Negativef(-1, "error message %s", "formatted") +// a.Negativef(-1.23, "error message %s", "formatted") func (a *Assertions) Negativef(e interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -920,7 +1004,7 @@ func (a *Assertions) Negativef(e interface{}, msg string, args ...interface{}) b // Never asserts that the given condition doesn't satisfy in waitFor time, // periodically checking the target function each tick. // -// a.Never(func() bool { return false; }, time.Second, 10*time.Millisecond) +// a.Never(func() bool { return false; }, time.Second, 10*time.Millisecond) func (a *Assertions) Never(condition func() bool, waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -931,7 +1015,7 @@ func (a *Assertions) Never(condition func() bool, waitFor time.Duration, tick ti // Neverf asserts that the given condition doesn't satisfy in waitFor time, // periodically checking the target function each tick. // -// a.Neverf(func() bool { return false; }, time.Second, 10*time.Millisecond, "error message %s", "formatted") +// a.Neverf(func() bool { return false; }, time.Second, 10*time.Millisecond, "error message %s", "formatted") func (a *Assertions) Neverf(condition func() bool, waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -941,7 +1025,7 @@ func (a *Assertions) Neverf(condition func() bool, waitFor time.Duration, tick t // Nil asserts that the specified object is nil. // -// a.Nil(err) +// a.Nil(err) func (a *Assertions) Nil(object interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -951,7 +1035,7 @@ func (a *Assertions) Nil(object interface{}, msgAndArgs ...interface{}) bool { // Nilf asserts that the specified object is nil. // -// a.Nilf(err, "error message %s", "formatted") +// a.Nilf(err, "error message %s", "formatted") func (a *Assertions) Nilf(object interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -979,10 +1063,10 @@ func (a *Assertions) NoDirExistsf(path string, msg string, args ...interface{}) // NoError asserts that a function returned no error (i.e. `nil`). // -// actualObj, err := SomeFunction() -// if a.NoError(err) { -// assert.Equal(t, expectedObj, actualObj) -// } +// actualObj, err := SomeFunction() +// if a.NoError(err) { +// assert.Equal(t, expectedObj, actualObj) +// } func (a *Assertions) NoError(err error, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -992,10 +1076,10 @@ func (a *Assertions) NoError(err error, msgAndArgs ...interface{}) bool { // NoErrorf asserts that a function returned no error (i.e. `nil`). // -// actualObj, err := SomeFunction() -// if a.NoErrorf(err, "error message %s", "formatted") { -// assert.Equal(t, expectedObj, actualObj) -// } +// actualObj, err := SomeFunction() +// if a.NoErrorf(err, "error message %s", "formatted") { +// assert.Equal(t, expectedObj, actualObj) +// } func (a *Assertions) NoErrorf(err error, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1024,9 +1108,9 @@ func (a *Assertions) NoFileExistsf(path string, msg string, args ...interface{}) // NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the // specified substring or element. // -// a.NotContains("Hello World", "Earth") -// a.NotContains(["Hello", "World"], "Earth") -// a.NotContains({"Hello": "World"}, "Earth") +// a.NotContains("Hello World", "Earth") +// a.NotContains(["Hello", "World"], "Earth") +// a.NotContains({"Hello": "World"}, "Earth") func (a *Assertions) NotContains(s interface{}, contains interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1037,9 +1121,9 @@ func (a *Assertions) NotContains(s interface{}, contains interface{}, msgAndArgs // NotContainsf asserts that the specified string, list(array, slice...) or map does NOT contain the // specified substring or element. // -// a.NotContainsf("Hello World", "Earth", "error message %s", "formatted") -// a.NotContainsf(["Hello", "World"], "Earth", "error message %s", "formatted") -// a.NotContainsf({"Hello": "World"}, "Earth", "error message %s", "formatted") +// a.NotContainsf("Hello World", "Earth", "error message %s", "formatted") +// a.NotContainsf(["Hello", "World"], "Earth", "error message %s", "formatted") +// a.NotContainsf({"Hello": "World"}, "Earth", "error message %s", "formatted") func (a *Assertions) NotContainsf(s interface{}, contains interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1050,9 +1134,9 @@ func (a *Assertions) NotContainsf(s interface{}, contains interface{}, msg strin // NotEmpty asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either // a slice or a channel with len == 0. // -// if a.NotEmpty(obj) { -// assert.Equal(t, "two", obj[1]) -// } +// if a.NotEmpty(obj) { +// assert.Equal(t, "two", obj[1]) +// } func (a *Assertions) NotEmpty(object interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1063,9 +1147,9 @@ func (a *Assertions) NotEmpty(object interface{}, msgAndArgs ...interface{}) boo // NotEmptyf asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either // a slice or a channel with len == 0. // -// if a.NotEmptyf(obj, "error message %s", "formatted") { -// assert.Equal(t, "two", obj[1]) -// } +// if a.NotEmptyf(obj, "error message %s", "formatted") { +// assert.Equal(t, "two", obj[1]) +// } func (a *Assertions) NotEmptyf(object interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1075,7 +1159,7 @@ func (a *Assertions) NotEmptyf(object interface{}, msg string, args ...interface // NotEqual asserts that the specified values are NOT equal. // -// a.NotEqual(obj1, obj2) +// a.NotEqual(obj1, obj2) // // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). @@ -1088,7 +1172,7 @@ func (a *Assertions) NotEqual(expected interface{}, actual interface{}, msgAndAr // NotEqualValues asserts that two objects are not equal even when converted to the same type // -// a.NotEqualValues(obj1, obj2) +// a.NotEqualValues(obj1, obj2) func (a *Assertions) NotEqualValues(expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1098,7 +1182,7 @@ func (a *Assertions) NotEqualValues(expected interface{}, actual interface{}, ms // NotEqualValuesf asserts that two objects are not equal even when converted to the same type // -// a.NotEqualValuesf(obj1, obj2, "error message %s", "formatted") +// a.NotEqualValuesf(obj1, obj2, "error message %s", "formatted") func (a *Assertions) NotEqualValuesf(expected interface{}, actual interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1108,7 +1192,7 @@ func (a *Assertions) NotEqualValuesf(expected interface{}, actual interface{}, m // NotEqualf asserts that the specified values are NOT equal. // -// a.NotEqualf(obj1, obj2, "error message %s", "formatted") +// a.NotEqualf(obj1, obj2, "error message %s", "formatted") // // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). @@ -1139,7 +1223,7 @@ func (a *Assertions) NotErrorIsf(err error, target error, msg string, args ...in // NotNil asserts that the specified object is not nil. // -// a.NotNil(err) +// a.NotNil(err) func (a *Assertions) NotNil(object interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1149,7 +1233,7 @@ func (a *Assertions) NotNil(object interface{}, msgAndArgs ...interface{}) bool // NotNilf asserts that the specified object is not nil. // -// a.NotNilf(err, "error message %s", "formatted") +// a.NotNilf(err, "error message %s", "formatted") func (a *Assertions) NotNilf(object interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1159,7 +1243,7 @@ func (a *Assertions) NotNilf(object interface{}, msg string, args ...interface{} // NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic. // -// a.NotPanics(func(){ RemainCalm() }) +// a.NotPanics(func(){ RemainCalm() }) func (a *Assertions) NotPanics(f PanicTestFunc, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1169,7 +1253,7 @@ func (a *Assertions) NotPanics(f PanicTestFunc, msgAndArgs ...interface{}) bool // NotPanicsf asserts that the code inside the specified PanicTestFunc does NOT panic. // -// a.NotPanicsf(func(){ RemainCalm() }, "error message %s", "formatted") +// a.NotPanicsf(func(){ RemainCalm() }, "error message %s", "formatted") func (a *Assertions) NotPanicsf(f PanicTestFunc, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1179,8 +1263,8 @@ func (a *Assertions) NotPanicsf(f PanicTestFunc, msg string, args ...interface{} // NotRegexp asserts that a specified regexp does not match a string. // -// a.NotRegexp(regexp.MustCompile("starts"), "it's starting") -// a.NotRegexp("^start", "it's not starting") +// a.NotRegexp(regexp.MustCompile("starts"), "it's starting") +// a.NotRegexp("^start", "it's not starting") func (a *Assertions) NotRegexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1190,8 +1274,8 @@ func (a *Assertions) NotRegexp(rx interface{}, str interface{}, msgAndArgs ...in // NotRegexpf asserts that a specified regexp does not match a string. // -// a.NotRegexpf(regexp.MustCompile("starts"), "it's starting", "error message %s", "formatted") -// a.NotRegexpf("^start", "it's not starting", "error message %s", "formatted") +// a.NotRegexpf(regexp.MustCompile("starts"), "it's starting", "error message %s", "formatted") +// a.NotRegexpf("^start", "it's not starting", "error message %s", "formatted") func (a *Assertions) NotRegexpf(rx interface{}, str interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1201,7 +1285,7 @@ func (a *Assertions) NotRegexpf(rx interface{}, str interface{}, msg string, arg // NotSame asserts that two pointers do not reference the same object. // -// a.NotSame(ptr1, ptr2) +// a.NotSame(ptr1, ptr2) // // Both arguments must be pointer variables. Pointer variable sameness is // determined based on the equality of both type and value. @@ -1214,7 +1298,7 @@ func (a *Assertions) NotSame(expected interface{}, actual interface{}, msgAndArg // NotSamef asserts that two pointers do not reference the same object. // -// a.NotSamef(ptr1, ptr2, "error message %s", "formatted") +// a.NotSamef(ptr1, ptr2, "error message %s", "formatted") // // Both arguments must be pointer variables. Pointer variable sameness is // determined based on the equality of both type and value. @@ -1228,7 +1312,7 @@ func (a *Assertions) NotSamef(expected interface{}, actual interface{}, msg stri // NotSubset asserts that the specified list(array, slice...) contains not all // elements given in the specified subset(array, slice...). // -// a.NotSubset([1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]") +// a.NotSubset([1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]") func (a *Assertions) NotSubset(list interface{}, subset interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1239,7 +1323,7 @@ func (a *Assertions) NotSubset(list interface{}, subset interface{}, msgAndArgs // NotSubsetf asserts that the specified list(array, slice...) contains not all // elements given in the specified subset(array, slice...). // -// a.NotSubsetf([1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]", "error message %s", "formatted") +// a.NotSubsetf([1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]", "error message %s", "formatted") func (a *Assertions) NotSubsetf(list interface{}, subset interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1265,7 +1349,7 @@ func (a *Assertions) NotZerof(i interface{}, msg string, args ...interface{}) bo // Panics asserts that the code inside the specified PanicTestFunc panics. // -// a.Panics(func(){ GoCrazy() }) +// a.Panics(func(){ GoCrazy() }) func (a *Assertions) Panics(f PanicTestFunc, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1277,7 +1361,7 @@ func (a *Assertions) Panics(f PanicTestFunc, msgAndArgs ...interface{}) bool { // panics, and that the recovered panic value is an error that satisfies the // EqualError comparison. // -// a.PanicsWithError("crazy error", func(){ GoCrazy() }) +// a.PanicsWithError("crazy error", func(){ GoCrazy() }) func (a *Assertions) PanicsWithError(errString string, f PanicTestFunc, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1289,7 +1373,7 @@ func (a *Assertions) PanicsWithError(errString string, f PanicTestFunc, msgAndAr // panics, and that the recovered panic value is an error that satisfies the // EqualError comparison. // -// a.PanicsWithErrorf("crazy error", func(){ GoCrazy() }, "error message %s", "formatted") +// a.PanicsWithErrorf("crazy error", func(){ GoCrazy() }, "error message %s", "formatted") func (a *Assertions) PanicsWithErrorf(errString string, f PanicTestFunc, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1300,7 +1384,7 @@ func (a *Assertions) PanicsWithErrorf(errString string, f PanicTestFunc, msg str // PanicsWithValue asserts that the code inside the specified PanicTestFunc panics, and that // the recovered panic value equals the expected panic value. // -// a.PanicsWithValue("crazy error", func(){ GoCrazy() }) +// a.PanicsWithValue("crazy error", func(){ GoCrazy() }) func (a *Assertions) PanicsWithValue(expected interface{}, f PanicTestFunc, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1311,7 +1395,7 @@ func (a *Assertions) PanicsWithValue(expected interface{}, f PanicTestFunc, msgA // PanicsWithValuef asserts that the code inside the specified PanicTestFunc panics, and that // the recovered panic value equals the expected panic value. // -// a.PanicsWithValuef("crazy error", func(){ GoCrazy() }, "error message %s", "formatted") +// a.PanicsWithValuef("crazy error", func(){ GoCrazy() }, "error message %s", "formatted") func (a *Assertions) PanicsWithValuef(expected interface{}, f PanicTestFunc, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1321,7 +1405,7 @@ func (a *Assertions) PanicsWithValuef(expected interface{}, f PanicTestFunc, msg // Panicsf asserts that the code inside the specified PanicTestFunc panics. // -// a.Panicsf(func(){ GoCrazy() }, "error message %s", "formatted") +// a.Panicsf(func(){ GoCrazy() }, "error message %s", "formatted") func (a *Assertions) Panicsf(f PanicTestFunc, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1331,8 +1415,8 @@ func (a *Assertions) Panicsf(f PanicTestFunc, msg string, args ...interface{}) b // Positive asserts that the specified element is positive // -// a.Positive(1) -// a.Positive(1.23) +// a.Positive(1) +// a.Positive(1.23) func (a *Assertions) Positive(e interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1342,8 +1426,8 @@ func (a *Assertions) Positive(e interface{}, msgAndArgs ...interface{}) bool { // Positivef asserts that the specified element is positive // -// a.Positivef(1, "error message %s", "formatted") -// a.Positivef(1.23, "error message %s", "formatted") +// a.Positivef(1, "error message %s", "formatted") +// a.Positivef(1.23, "error message %s", "formatted") func (a *Assertions) Positivef(e interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1353,8 +1437,8 @@ func (a *Assertions) Positivef(e interface{}, msg string, args ...interface{}) b // Regexp asserts that a specified regexp matches a string. // -// a.Regexp(regexp.MustCompile("start"), "it's starting") -// a.Regexp("start...$", "it's not starting") +// a.Regexp(regexp.MustCompile("start"), "it's starting") +// a.Regexp("start...$", "it's not starting") func (a *Assertions) Regexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1364,8 +1448,8 @@ func (a *Assertions) Regexp(rx interface{}, str interface{}, msgAndArgs ...inter // Regexpf asserts that a specified regexp matches a string. // -// a.Regexpf(regexp.MustCompile("start"), "it's starting", "error message %s", "formatted") -// a.Regexpf("start...$", "it's not starting", "error message %s", "formatted") +// a.Regexpf(regexp.MustCompile("start"), "it's starting", "error message %s", "formatted") +// a.Regexpf("start...$", "it's not starting", "error message %s", "formatted") func (a *Assertions) Regexpf(rx interface{}, str interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1375,7 +1459,7 @@ func (a *Assertions) Regexpf(rx interface{}, str interface{}, msg string, args . // Same asserts that two pointers reference the same object. // -// a.Same(ptr1, ptr2) +// a.Same(ptr1, ptr2) // // Both arguments must be pointer variables. Pointer variable sameness is // determined based on the equality of both type and value. @@ -1388,7 +1472,7 @@ func (a *Assertions) Same(expected interface{}, actual interface{}, msgAndArgs . // Samef asserts that two pointers reference the same object. // -// a.Samef(ptr1, ptr2, "error message %s", "formatted") +// a.Samef(ptr1, ptr2, "error message %s", "formatted") // // Both arguments must be pointer variables. Pointer variable sameness is // determined based on the equality of both type and value. @@ -1402,7 +1486,7 @@ func (a *Assertions) Samef(expected interface{}, actual interface{}, msg string, // Subset asserts that the specified list(array, slice...) contains all // elements given in the specified subset(array, slice...). // -// a.Subset([1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]") +// a.Subset([1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]") func (a *Assertions) Subset(list interface{}, subset interface{}, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1413,7 +1497,7 @@ func (a *Assertions) Subset(list interface{}, subset interface{}, msgAndArgs ... // Subsetf asserts that the specified list(array, slice...) contains all // elements given in the specified subset(array, slice...). // -// a.Subsetf([1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]", "error message %s", "formatted") +// a.Subsetf([1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]", "error message %s", "formatted") func (a *Assertions) Subsetf(list interface{}, subset interface{}, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1423,7 +1507,7 @@ func (a *Assertions) Subsetf(list interface{}, subset interface{}, msg string, a // True asserts that the specified value is true. // -// a.True(myBool) +// a.True(myBool) func (a *Assertions) True(value bool, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1433,7 +1517,7 @@ func (a *Assertions) True(value bool, msgAndArgs ...interface{}) bool { // Truef asserts that the specified value is true. // -// a.Truef(myBool, "error message %s", "formatted") +// a.Truef(myBool, "error message %s", "formatted") func (a *Assertions) Truef(value bool, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1443,7 +1527,7 @@ func (a *Assertions) Truef(value bool, msg string, args ...interface{}) bool { // WithinDuration asserts that the two times are within duration delta of each other. // -// a.WithinDuration(time.Now(), time.Now(), 10*time.Second) +// a.WithinDuration(time.Now(), time.Now(), 10*time.Second) func (a *Assertions) WithinDuration(expected time.Time, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1453,7 +1537,7 @@ func (a *Assertions) WithinDuration(expected time.Time, actual time.Time, delta // WithinDurationf asserts that the two times are within duration delta of each other. // -// a.WithinDurationf(time.Now(), time.Now(), 10*time.Second, "error message %s", "formatted") +// a.WithinDurationf(time.Now(), time.Now(), 10*time.Second, "error message %s", "formatted") func (a *Assertions) WithinDurationf(expected time.Time, actual time.Time, delta time.Duration, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1463,7 +1547,7 @@ func (a *Assertions) WithinDurationf(expected time.Time, actual time.Time, delta // WithinRange asserts that a time is within a time range (inclusive). // -// a.WithinRange(time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second)) +// a.WithinRange(time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second)) func (a *Assertions) WithinRange(actual time.Time, start time.Time, end time.Time, msgAndArgs ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1473,7 +1557,7 @@ func (a *Assertions) WithinRange(actual time.Time, start time.Time, end time.Tim // WithinRangef asserts that a time is within a time range (inclusive). // -// a.WithinRangef(time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second), "error message %s", "formatted") +// a.WithinRangef(time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second), "error message %s", "formatted") func (a *Assertions) WithinRangef(actual time.Time, start time.Time, end time.Time, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() diff --git a/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_order.go b/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_order.go index 759448783585..00df62a05992 100644 --- a/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_order.go +++ b/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertion_order.go @@ -46,36 +46,36 @@ func isOrdered(t TestingT, object interface{}, allowedComparesResults []CompareT // IsIncreasing asserts that the collection is increasing // -// assert.IsIncreasing(t, []int{1, 2, 3}) -// assert.IsIncreasing(t, []float{1, 2}) -// assert.IsIncreasing(t, []string{"a", "b"}) +// assert.IsIncreasing(t, []int{1, 2, 3}) +// assert.IsIncreasing(t, []float{1, 2}) +// assert.IsIncreasing(t, []string{"a", "b"}) func IsIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { return isOrdered(t, object, []CompareType{compareLess}, "\"%v\" is not less than \"%v\"", msgAndArgs...) } // IsNonIncreasing asserts that the collection is not increasing // -// assert.IsNonIncreasing(t, []int{2, 1, 1}) -// assert.IsNonIncreasing(t, []float{2, 1}) -// assert.IsNonIncreasing(t, []string{"b", "a"}) +// assert.IsNonIncreasing(t, []int{2, 1, 1}) +// assert.IsNonIncreasing(t, []float{2, 1}) +// assert.IsNonIncreasing(t, []string{"b", "a"}) func IsNonIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { return isOrdered(t, object, []CompareType{compareEqual, compareGreater}, "\"%v\" is not greater than or equal to \"%v\"", msgAndArgs...) } // IsDecreasing asserts that the collection is decreasing // -// assert.IsDecreasing(t, []int{2, 1, 0}) -// assert.IsDecreasing(t, []float{2, 1}) -// assert.IsDecreasing(t, []string{"b", "a"}) +// assert.IsDecreasing(t, []int{2, 1, 0}) +// assert.IsDecreasing(t, []float{2, 1}) +// assert.IsDecreasing(t, []string{"b", "a"}) func IsDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { return isOrdered(t, object, []CompareType{compareGreater}, "\"%v\" is not greater than \"%v\"", msgAndArgs...) } // IsNonDecreasing asserts that the collection is not decreasing // -// assert.IsNonDecreasing(t, []int{1, 1, 2}) -// assert.IsNonDecreasing(t, []float{1, 2}) -// assert.IsNonDecreasing(t, []string{"a", "b"}) +// assert.IsNonDecreasing(t, []int{1, 1, 2}) +// assert.IsNonDecreasing(t, []float{1, 2}) +// assert.IsNonDecreasing(t, []string{"a", "b"}) func IsNonDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { return isOrdered(t, object, []CompareType{compareLess, compareEqual}, "\"%v\" is not less than or equal to \"%v\"", msgAndArgs...) } diff --git a/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertions.go b/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertions.go index 2924cf3a1492..a55d1bba926c 100644 --- a/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertions.go +++ b/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/assertions.go @@ -75,6 +75,77 @@ func ObjectsAreEqual(expected, actual interface{}) bool { return bytes.Equal(exp, act) } +// copyExportedFields iterates downward through nested data structures and creates a copy +// that only contains the exported struct fields. +func copyExportedFields(expected interface{}) interface{} { + if isNil(expected) { + return expected + } + + expectedType := reflect.TypeOf(expected) + expectedKind := expectedType.Kind() + expectedValue := reflect.ValueOf(expected) + + switch expectedKind { + case reflect.Struct: + result := reflect.New(expectedType).Elem() + for i := 0; i < expectedType.NumField(); i++ { + field := expectedType.Field(i) + isExported := field.IsExported() + if isExported { + fieldValue := expectedValue.Field(i) + if isNil(fieldValue) || isNil(fieldValue.Interface()) { + continue + } + newValue := copyExportedFields(fieldValue.Interface()) + result.Field(i).Set(reflect.ValueOf(newValue)) + } + } + return result.Interface() + + case reflect.Ptr: + result := reflect.New(expectedType.Elem()) + unexportedRemoved := copyExportedFields(expectedValue.Elem().Interface()) + result.Elem().Set(reflect.ValueOf(unexportedRemoved)) + return result.Interface() + + case reflect.Array, reflect.Slice: + result := reflect.MakeSlice(expectedType, expectedValue.Len(), expectedValue.Len()) + for i := 0; i < expectedValue.Len(); i++ { + index := expectedValue.Index(i) + if isNil(index) { + continue + } + unexportedRemoved := copyExportedFields(index.Interface()) + result.Index(i).Set(reflect.ValueOf(unexportedRemoved)) + } + return result.Interface() + + case reflect.Map: + result := reflect.MakeMap(expectedType) + for _, k := range expectedValue.MapKeys() { + index := expectedValue.MapIndex(k) + unexportedRemoved := copyExportedFields(index.Interface()) + result.SetMapIndex(k, reflect.ValueOf(unexportedRemoved)) + } + return result.Interface() + + default: + return expected + } +} + +// ObjectsExportedFieldsAreEqual determines if the exported (public) fields of two objects are +// considered equal. This comparison of only exported fields is applied recursively to nested data +// structures. +// +// This function does no assertion of any kind. +func ObjectsExportedFieldsAreEqual(expected, actual interface{}) bool { + expectedCleaned := copyExportedFields(expected) + actualCleaned := copyExportedFields(actual) + return ObjectsAreEqualValues(expectedCleaned, actualCleaned) +} + // ObjectsAreEqualValues gets whether two objects are equal, or if their // values are equal. func ObjectsAreEqualValues(expected, actual interface{}) bool { @@ -271,7 +342,7 @@ type labeledContent struct { // labeledOutput returns a string consisting of the provided labeledContent. Each labeled output is appended in the following manner: // -// \t{{label}}:{{align_spaces}}\t{{content}}\n +// \t{{label}}:{{align_spaces}}\t{{content}}\n // // The initial carriage return is required to undo/erase any padding added by testing.T.Errorf. The "\t{{label}}:" is for the label. // If a label is shorter than the longest label provided, padding spaces are added to make all the labels match in length. Once this @@ -294,7 +365,7 @@ func labeledOutput(content ...labeledContent) string { // Implements asserts that an object is implemented by the specified interface. // -// assert.Implements(t, (*MyInterface)(nil), new(MyObject)) +// assert.Implements(t, (*MyInterface)(nil), new(MyObject)) func Implements(t TestingT, interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -326,7 +397,7 @@ func IsType(t TestingT, expectedType interface{}, object interface{}, msgAndArgs // Equal asserts that two objects are equal. // -// assert.Equal(t, 123, 123) +// assert.Equal(t, 123, 123) // // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). Function equality @@ -367,7 +438,7 @@ func validateEqualArgs(expected, actual interface{}) error { // Same asserts that two pointers reference the same object. // -// assert.Same(t, ptr1, ptr2) +// assert.Same(t, ptr1, ptr2) // // Both arguments must be pointer variables. Pointer variable sameness is // determined based on the equality of both type and value. @@ -387,7 +458,7 @@ func Same(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) b // NotSame asserts that two pointers do not reference the same object. // -// assert.NotSame(t, ptr1, ptr2) +// assert.NotSame(t, ptr1, ptr2) // // Both arguments must be pointer variables. Pointer variable sameness is // determined based on the equality of both type and value. @@ -455,7 +526,7 @@ func truncatingFormat(data interface{}) string { // EqualValues asserts that two objects are equal or convertable to the same types // and equal. // -// assert.EqualValues(t, uint32(123), int32(123)) +// assert.EqualValues(t, uint32(123), int32(123)) func EqualValues(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -473,9 +544,53 @@ func EqualValues(t TestingT, expected, actual interface{}, msgAndArgs ...interfa } +// EqualExportedValues asserts that the types of two objects are equal and their public +// fields are also equal. This is useful for comparing structs that have private fields +// that could potentially differ. +// +// type S struct { +// Exported int +// notExported int +// } +// assert.EqualExportedValues(t, S{1, 2}, S{1, 3}) => true +// assert.EqualExportedValues(t, S{1, 2}, S{2, 3}) => false +func EqualExportedValues(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + + aType := reflect.TypeOf(expected) + bType := reflect.TypeOf(actual) + + if aType != bType { + return Fail(t, fmt.Sprintf("Types expected to match exactly\n\t%v != %v", aType, bType), msgAndArgs...) + } + + if aType.Kind() != reflect.Struct { + return Fail(t, fmt.Sprintf("Types expected to both be struct \n\t%v != %v", aType.Kind(), reflect.Struct), msgAndArgs...) + } + + if bType.Kind() != reflect.Struct { + return Fail(t, fmt.Sprintf("Types expected to both be struct \n\t%v != %v", bType.Kind(), reflect.Struct), msgAndArgs...) + } + + expected = copyExportedFields(expected) + actual = copyExportedFields(actual) + + if !ObjectsAreEqualValues(expected, actual) { + diff := diff(expected, actual) + expected, actual = formatUnequalValues(expected, actual) + return Fail(t, fmt.Sprintf("Not equal (comparing only exported fields): \n"+ + "expected: %s\n"+ + "actual : %s%s", expected, actual, diff), msgAndArgs...) + } + + return true +} + // Exactly asserts that two objects are equal in value and type. // -// assert.Exactly(t, int32(123), int64(123)) +// assert.Exactly(t, int32(123), int64(123)) func Exactly(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -494,7 +609,7 @@ func Exactly(t TestingT, expected, actual interface{}, msgAndArgs ...interface{} // NotNil asserts that the specified object is not nil. // -// assert.NotNil(t, err) +// assert.NotNil(t, err) func NotNil(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { if !isNil(object) { return true @@ -540,7 +655,7 @@ func isNil(object interface{}) bool { // Nil asserts that the specified object is nil. // -// assert.Nil(t, err) +// assert.Nil(t, err) func Nil(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { if isNil(object) { return true @@ -583,7 +698,7 @@ func isEmpty(object interface{}) bool { // Empty asserts that the specified object is empty. I.e. nil, "", false, 0 or either // a slice or a channel with len == 0. // -// assert.Empty(t, obj) +// assert.Empty(t, obj) func Empty(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { pass := isEmpty(object) if !pass { @@ -600,9 +715,9 @@ func Empty(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { // NotEmpty asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either // a slice or a channel with len == 0. // -// if assert.NotEmpty(t, obj) { -// assert.Equal(t, "two", obj[1]) -// } +// if assert.NotEmpty(t, obj) { +// assert.Equal(t, "two", obj[1]) +// } func NotEmpty(t TestingT, object interface{}, msgAndArgs ...interface{}) bool { pass := !isEmpty(object) if !pass { @@ -631,7 +746,7 @@ func getLen(x interface{}) (ok bool, length int) { // Len asserts that the specified object has specific length. // Len also fails if the object has a type that len() not accept. // -// assert.Len(t, mySlice, 3) +// assert.Len(t, mySlice, 3) func Len(t TestingT, object interface{}, length int, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -649,7 +764,7 @@ func Len(t TestingT, object interface{}, length int, msgAndArgs ...interface{}) // True asserts that the specified value is true. // -// assert.True(t, myBool) +// assert.True(t, myBool) func True(t TestingT, value bool, msgAndArgs ...interface{}) bool { if !value { if h, ok := t.(tHelper); ok { @@ -664,7 +779,7 @@ func True(t TestingT, value bool, msgAndArgs ...interface{}) bool { // False asserts that the specified value is false. // -// assert.False(t, myBool) +// assert.False(t, myBool) func False(t TestingT, value bool, msgAndArgs ...interface{}) bool { if value { if h, ok := t.(tHelper); ok { @@ -679,7 +794,7 @@ func False(t TestingT, value bool, msgAndArgs ...interface{}) bool { // NotEqual asserts that the specified values are NOT equal. // -// assert.NotEqual(t, obj1, obj2) +// assert.NotEqual(t, obj1, obj2) // // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). @@ -702,7 +817,7 @@ func NotEqual(t TestingT, expected, actual interface{}, msgAndArgs ...interface{ // NotEqualValues asserts that two objects are not equal even when converted to the same type // -// assert.NotEqualValues(t, obj1, obj2) +// assert.NotEqualValues(t, obj1, obj2) func NotEqualValues(t TestingT, expected, actual interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -761,9 +876,9 @@ func containsElement(list interface{}, element interface{}) (ok, found bool) { // Contains asserts that the specified string, list(array, slice...) or map contains the // specified substring or element. // -// assert.Contains(t, "Hello World", "World") -// assert.Contains(t, ["Hello", "World"], "World") -// assert.Contains(t, {"Hello": "World"}, "Hello") +// assert.Contains(t, "Hello World", "World") +// assert.Contains(t, ["Hello", "World"], "World") +// assert.Contains(t, {"Hello": "World"}, "Hello") func Contains(t TestingT, s, contains interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -784,9 +899,9 @@ func Contains(t TestingT, s, contains interface{}, msgAndArgs ...interface{}) bo // NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the // specified substring or element. // -// assert.NotContains(t, "Hello World", "Earth") -// assert.NotContains(t, ["Hello", "World"], "Earth") -// assert.NotContains(t, {"Hello": "World"}, "Earth") +// assert.NotContains(t, "Hello World", "Earth") +// assert.NotContains(t, ["Hello", "World"], "Earth") +// assert.NotContains(t, {"Hello": "World"}, "Earth") func NotContains(t TestingT, s, contains interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -794,10 +909,10 @@ func NotContains(t TestingT, s, contains interface{}, msgAndArgs ...interface{}) ok, found := containsElement(s, contains) if !ok { - return Fail(t, fmt.Sprintf("\"%s\" could not be applied builtin len()", s), msgAndArgs...) + return Fail(t, fmt.Sprintf("%#v could not be applied builtin len()", s), msgAndArgs...) } if found { - return Fail(t, fmt.Sprintf("\"%s\" should not contain \"%s\"", s, contains), msgAndArgs...) + return Fail(t, fmt.Sprintf("%#v should not contain %#v", s, contains), msgAndArgs...) } return true @@ -807,7 +922,7 @@ func NotContains(t TestingT, s, contains interface{}, msgAndArgs ...interface{}) // Subset asserts that the specified list(array, slice...) contains all // elements given in the specified subset(array, slice...). // -// assert.Subset(t, [1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]") +// assert.Subset(t, [1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]") func Subset(t TestingT, list, subset interface{}, msgAndArgs ...interface{}) (ok bool) { if h, ok := t.(tHelper); ok { h.Helper() @@ -863,7 +978,7 @@ func Subset(t TestingT, list, subset interface{}, msgAndArgs ...interface{}) (ok // NotSubset asserts that the specified list(array, slice...) contains not all // elements given in the specified subset(array, slice...). // -// assert.NotSubset(t, [1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]") +// assert.NotSubset(t, [1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]") func NotSubset(t TestingT, list, subset interface{}, msgAndArgs ...interface{}) (ok bool) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1048,7 +1163,7 @@ func didPanic(f PanicTestFunc) (didPanic bool, message interface{}, stack string // Panics asserts that the code inside the specified PanicTestFunc panics. // -// assert.Panics(t, func(){ GoCrazy() }) +// assert.Panics(t, func(){ GoCrazy() }) func Panics(t TestingT, f PanicTestFunc, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -1064,7 +1179,7 @@ func Panics(t TestingT, f PanicTestFunc, msgAndArgs ...interface{}) bool { // PanicsWithValue asserts that the code inside the specified PanicTestFunc panics, and that // the recovered panic value equals the expected panic value. // -// assert.PanicsWithValue(t, "crazy error", func(){ GoCrazy() }) +// assert.PanicsWithValue(t, "crazy error", func(){ GoCrazy() }) func PanicsWithValue(t TestingT, expected interface{}, f PanicTestFunc, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -1085,7 +1200,7 @@ func PanicsWithValue(t TestingT, expected interface{}, f PanicTestFunc, msgAndAr // panics, and that the recovered panic value is an error that satisfies the // EqualError comparison. // -// assert.PanicsWithError(t, "crazy error", func(){ GoCrazy() }) +// assert.PanicsWithError(t, "crazy error", func(){ GoCrazy() }) func PanicsWithError(t TestingT, errString string, f PanicTestFunc, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -1105,7 +1220,7 @@ func PanicsWithError(t TestingT, errString string, f PanicTestFunc, msgAndArgs . // NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic. // -// assert.NotPanics(t, func(){ RemainCalm() }) +// assert.NotPanics(t, func(){ RemainCalm() }) func NotPanics(t TestingT, f PanicTestFunc, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -1120,7 +1235,7 @@ func NotPanics(t TestingT, f PanicTestFunc, msgAndArgs ...interface{}) bool { // WithinDuration asserts that the two times are within duration delta of each other. // -// assert.WithinDuration(t, time.Now(), time.Now(), 10*time.Second) +// assert.WithinDuration(t, time.Now(), time.Now(), 10*time.Second) func WithinDuration(t TestingT, expected, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -1136,7 +1251,7 @@ func WithinDuration(t TestingT, expected, actual time.Time, delta time.Duration, // WithinRange asserts that a time is within a time range (inclusive). // -// assert.WithinRange(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second)) +// assert.WithinRange(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second)) func WithinRange(t TestingT, actual, start, end time.Time, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -1195,7 +1310,7 @@ func toFloat(x interface{}) (float64, bool) { // InDelta asserts that the two numerals are within delta of each other. // -// assert.InDelta(t, math.Pi, 22/7.0, 0.01) +// assert.InDelta(t, math.Pi, 22/7.0, 0.01) func InDelta(t TestingT, expected, actual interface{}, delta float64, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -1368,10 +1483,10 @@ func InEpsilonSlice(t TestingT, expected, actual interface{}, epsilon float64, m // NoError asserts that a function returned no error (i.e. `nil`). // -// actualObj, err := SomeFunction() -// if assert.NoError(t, err) { -// assert.Equal(t, expectedObj, actualObj) -// } +// actualObj, err := SomeFunction() +// if assert.NoError(t, err) { +// assert.Equal(t, expectedObj, actualObj) +// } func NoError(t TestingT, err error, msgAndArgs ...interface{}) bool { if err != nil { if h, ok := t.(tHelper); ok { @@ -1385,10 +1500,10 @@ func NoError(t TestingT, err error, msgAndArgs ...interface{}) bool { // Error asserts that a function returned an error (i.e. not `nil`). // -// actualObj, err := SomeFunction() -// if assert.Error(t, err) { -// assert.Equal(t, expectedError, err) -// } +// actualObj, err := SomeFunction() +// if assert.Error(t, err) { +// assert.Equal(t, expectedError, err) +// } func Error(t TestingT, err error, msgAndArgs ...interface{}) bool { if err == nil { if h, ok := t.(tHelper); ok { @@ -1403,8 +1518,8 @@ func Error(t TestingT, err error, msgAndArgs ...interface{}) bool { // EqualError asserts that a function returned an error (i.e. not `nil`) // and that it is equal to the provided error. // -// actualObj, err := SomeFunction() -// assert.EqualError(t, err, expectedErrorString) +// actualObj, err := SomeFunction() +// assert.EqualError(t, err, expectedErrorString) func EqualError(t TestingT, theError error, errString string, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -1426,8 +1541,8 @@ func EqualError(t TestingT, theError error, errString string, msgAndArgs ...inte // ErrorContains asserts that a function returned an error (i.e. not `nil`) // and that the error contains the specified substring. // -// actualObj, err := SomeFunction() -// assert.ErrorContains(t, err, expectedErrorSubString) +// actualObj, err := SomeFunction() +// assert.ErrorContains(t, err, expectedErrorSubString) func ErrorContains(t TestingT, theError error, contains string, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -1460,8 +1575,8 @@ func matchRegexp(rx interface{}, str interface{}) bool { // Regexp asserts that a specified regexp matches a string. // -// assert.Regexp(t, regexp.MustCompile("start"), "it's starting") -// assert.Regexp(t, "start...$", "it's not starting") +// assert.Regexp(t, regexp.MustCompile("start"), "it's starting") +// assert.Regexp(t, "start...$", "it's not starting") func Regexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -1478,8 +1593,8 @@ func Regexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface // NotRegexp asserts that a specified regexp does not match a string. // -// assert.NotRegexp(t, regexp.MustCompile("starts"), "it's starting") -// assert.NotRegexp(t, "^start", "it's not starting") +// assert.NotRegexp(t, regexp.MustCompile("starts"), "it's starting") +// assert.NotRegexp(t, "^start", "it's not starting") func NotRegexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -1591,7 +1706,7 @@ func NoDirExists(t TestingT, path string, msgAndArgs ...interface{}) bool { // JSONEq asserts that two JSON strings are equivalent. // -// assert.JSONEq(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`) +// assert.JSONEq(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`) func JSONEq(t TestingT, expected string, actual string, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -1714,7 +1829,7 @@ type tHelper interface { // Eventually asserts that given condition will be met in waitFor time, // periodically checking target function each tick. // -// assert.Eventually(t, func() bool { return true; }, time.Second, 10*time.Millisecond) +// assert.Eventually(t, func() bool { return true; }, time.Second, 10*time.Millisecond) func Eventually(t TestingT, condition func() bool, waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() @@ -1744,10 +1859,93 @@ func Eventually(t TestingT, condition func() bool, waitFor time.Duration, tick t } } +// CollectT implements the TestingT interface and collects all errors. +type CollectT struct { + errors []error +} + +// Errorf collects the error. +func (c *CollectT) Errorf(format string, args ...interface{}) { + c.errors = append(c.errors, fmt.Errorf(format, args...)) +} + +// FailNow panics. +func (c *CollectT) FailNow() { + panic("Assertion failed") +} + +// Reset clears the collected errors. +func (c *CollectT) Reset() { + c.errors = nil +} + +// Copy copies the collected errors to the supplied t. +func (c *CollectT) Copy(t TestingT) { + if tt, ok := t.(tHelper); ok { + tt.Helper() + } + for _, err := range c.errors { + t.Errorf("%v", err) + } +} + +// EventuallyWithT asserts that given condition will be met in waitFor time, +// periodically checking target function each tick. In contrast to Eventually, +// it supplies a CollectT to the condition function, so that the condition +// function can use the CollectT to call other assertions. +// The condition is considered "met" if no errors are raised in a tick. +// The supplied CollectT collects all errors from one tick (if there are any). +// If the condition is not met before waitFor, the collected errors of +// the last tick are copied to t. +// +// externalValue := false +// go func() { +// time.Sleep(8*time.Second) +// externalValue = true +// }() +// assert.EventuallyWithT(t, func(c *assert.CollectT) { +// // add assertions as needed; any assertion failure will fail the current tick +// assert.True(c, externalValue, "expected 'externalValue' to be true") +// }, 1*time.Second, 10*time.Second, "external state has not changed to 'true'; still false") +func EventuallyWithT(t TestingT, condition func(collect *CollectT), waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) bool { + if h, ok := t.(tHelper); ok { + h.Helper() + } + + collect := new(CollectT) + ch := make(chan bool, 1) + + timer := time.NewTimer(waitFor) + defer timer.Stop() + + ticker := time.NewTicker(tick) + defer ticker.Stop() + + for tick := ticker.C; ; { + select { + case <-timer.C: + collect.Copy(t) + return Fail(t, "Condition never satisfied", msgAndArgs...) + case <-tick: + tick = nil + collect.Reset() + go func() { + condition(collect) + ch <- len(collect.errors) == 0 + }() + case v := <-ch: + if v { + return true + } + tick = ticker.C + } + } +} + // Never asserts that the given condition doesn't satisfy in waitFor time, // periodically checking the target function each tick. // -// assert.Never(t, func() bool { return false; }, time.Second, 10*time.Millisecond) +// assert.Never(t, func() bool { return false; }, time.Second, 10*time.Millisecond) func Never(t TestingT, condition func() bool, waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() diff --git a/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/doc.go b/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/doc.go index c9dccc4d6cd0..4953981d3878 100644 --- a/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/doc.go +++ b/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/doc.go @@ -1,39 +1,40 @@ // Package assert provides a set of comprehensive testing tools for use with the normal Go testing system. // -// Example Usage +// # Example Usage // // The following is a complete example using assert in a standard test function: -// import ( -// "testing" -// "github.com/stretchr/testify/assert" -// ) // -// func TestSomething(t *testing.T) { +// import ( +// "testing" +// "github.com/stretchr/testify/assert" +// ) // -// var a string = "Hello" -// var b string = "Hello" +// func TestSomething(t *testing.T) { // -// assert.Equal(t, a, b, "The two words should be the same.") +// var a string = "Hello" +// var b string = "Hello" // -// } +// assert.Equal(t, a, b, "The two words should be the same.") +// +// } // // if you assert many times, use the format below: // -// import ( -// "testing" -// "github.com/stretchr/testify/assert" -// ) +// import ( +// "testing" +// "github.com/stretchr/testify/assert" +// ) // -// func TestSomething(t *testing.T) { -// assert := assert.New(t) +// func TestSomething(t *testing.T) { +// assert := assert.New(t) // -// var a string = "Hello" -// var b string = "Hello" +// var a string = "Hello" +// var b string = "Hello" // -// assert.Equal(a, b, "The two words should be the same.") -// } +// assert.Equal(a, b, "The two words should be the same.") +// } // -// Assertions +// # Assertions // // Assertions allow you to easily write test code, and are global funcs in the `assert` package. // All assertion functions take, as the first argument, the `*testing.T` object provided by the diff --git a/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/http_assertions.go b/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/http_assertions.go index 4ed341dd2893..d8038c28a758 100644 --- a/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/http_assertions.go +++ b/cluster-autoscaler/vendor/github.com/stretchr/testify/assert/http_assertions.go @@ -23,7 +23,7 @@ func httpCode(handler http.HandlerFunc, method, url string, values url.Values) ( // HTTPSuccess asserts that a specified handler returns a success status code. // -// assert.HTTPSuccess(t, myHandler, "POST", "http://www.google.com", nil) +// assert.HTTPSuccess(t, myHandler, "POST", "http://www.google.com", nil) // // Returns whether the assertion was successful (true) or not (false). func HTTPSuccess(t TestingT, handler http.HandlerFunc, method, url string, values url.Values, msgAndArgs ...interface{}) bool { @@ -45,7 +45,7 @@ func HTTPSuccess(t TestingT, handler http.HandlerFunc, method, url string, value // HTTPRedirect asserts that a specified handler returns a redirect status code. // -// assert.HTTPRedirect(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} +// assert.HTTPRedirect(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} // // Returns whether the assertion was successful (true) or not (false). func HTTPRedirect(t TestingT, handler http.HandlerFunc, method, url string, values url.Values, msgAndArgs ...interface{}) bool { @@ -67,7 +67,7 @@ func HTTPRedirect(t TestingT, handler http.HandlerFunc, method, url string, valu // HTTPError asserts that a specified handler returns an error status code. // -// assert.HTTPError(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} +// assert.HTTPError(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} // // Returns whether the assertion was successful (true) or not (false). func HTTPError(t TestingT, handler http.HandlerFunc, method, url string, values url.Values, msgAndArgs ...interface{}) bool { @@ -89,7 +89,7 @@ func HTTPError(t TestingT, handler http.HandlerFunc, method, url string, values // HTTPStatusCode asserts that a specified handler returns a specified status code. // -// assert.HTTPStatusCode(t, myHandler, "GET", "/notImplemented", nil, 501) +// assert.HTTPStatusCode(t, myHandler, "GET", "/notImplemented", nil, 501) // // Returns whether the assertion was successful (true) or not (false). func HTTPStatusCode(t TestingT, handler http.HandlerFunc, method, url string, values url.Values, statuscode int, msgAndArgs ...interface{}) bool { @@ -124,7 +124,7 @@ func HTTPBody(handler http.HandlerFunc, method, url string, values url.Values) s // HTTPBodyContains asserts that a specified handler returns a // body that contains a string. // -// assert.HTTPBodyContains(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") +// assert.HTTPBodyContains(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") // // Returns whether the assertion was successful (true) or not (false). func HTTPBodyContains(t TestingT, handler http.HandlerFunc, method, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) bool { @@ -144,7 +144,7 @@ func HTTPBodyContains(t TestingT, handler http.HandlerFunc, method, url string, // HTTPBodyNotContains asserts that a specified handler returns a // body that does not contain a string. // -// assert.HTTPBodyNotContains(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") +// assert.HTTPBodyNotContains(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") // // Returns whether the assertion was successful (true) or not (false). func HTTPBodyNotContains(t TestingT, handler http.HandlerFunc, method, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) bool { diff --git a/cluster-autoscaler/vendor/github.com/stretchr/testify/mock/doc.go b/cluster-autoscaler/vendor/github.com/stretchr/testify/mock/doc.go index 7324128ef19c..d6b3c844cc8b 100644 --- a/cluster-autoscaler/vendor/github.com/stretchr/testify/mock/doc.go +++ b/cluster-autoscaler/vendor/github.com/stretchr/testify/mock/doc.go @@ -1,17 +1,17 @@ // Package mock provides a system by which it is possible to mock your objects // and verify calls are happening as expected. // -// Example Usage +// # Example Usage // // The mock package provides an object, Mock, that tracks activity on another object. It is usually // embedded into a test object as shown below: // -// type MyTestObject struct { -// // add a Mock object instance -// mock.Mock +// type MyTestObject struct { +// // add a Mock object instance +// mock.Mock // -// // other fields go here as normal -// } +// // other fields go here as normal +// } // // When implementing the methods of an interface, you wire your functions up // to call the Mock.Called(args...) method, and return the appropriate values. @@ -19,25 +19,25 @@ // For example, to mock a method that saves the name and age of a person and returns // the year of their birth or an error, you might write this: // -// func (o *MyTestObject) SavePersonDetails(firstname, lastname string, age int) (int, error) { -// args := o.Called(firstname, lastname, age) -// return args.Int(0), args.Error(1) -// } +// func (o *MyTestObject) SavePersonDetails(firstname, lastname string, age int) (int, error) { +// args := o.Called(firstname, lastname, age) +// return args.Int(0), args.Error(1) +// } // // The Int, Error and Bool methods are examples of strongly typed getters that take the argument // index position. Given this argument list: // -// (12, true, "Something") +// (12, true, "Something") // // You could read them out strongly typed like this: // -// args.Int(0) -// args.Bool(1) -// args.String(2) +// args.Int(0) +// args.Bool(1) +// args.String(2) // // For objects of your own type, use the generic Arguments.Get(index) method and make a type assertion: // -// return args.Get(0).(*MyObject), args.Get(1).(*AnotherObjectOfMine) +// return args.Get(0).(*MyObject), args.Get(1).(*AnotherObjectOfMine) // // This may cause a panic if the object you are getting is nil (the type assertion will fail), in those // cases you should check for nil first. diff --git a/cluster-autoscaler/vendor/github.com/stretchr/testify/mock/mock.go b/cluster-autoscaler/vendor/github.com/stretchr/testify/mock/mock.go index e6ff8dfeb201..f4b42e44ffe9 100644 --- a/cluster-autoscaler/vendor/github.com/stretchr/testify/mock/mock.go +++ b/cluster-autoscaler/vendor/github.com/stretchr/testify/mock/mock.go @@ -3,6 +3,7 @@ package mock import ( "errors" "fmt" + "path" "reflect" "regexp" "runtime" @@ -13,6 +14,7 @@ import ( "github.com/davecgh/go-spew/spew" "github.com/pmezard/go-difflib/difflib" "github.com/stretchr/objx" + "github.com/stretchr/testify/assert" ) @@ -99,7 +101,7 @@ func (c *Call) unlock() { // Return specifies the return arguments for the expectation. // -// Mock.On("DoSomething").Return(errors.New("failed")) +// Mock.On("DoSomething").Return(errors.New("failed")) func (c *Call) Return(returnArguments ...interface{}) *Call { c.lock() defer c.unlock() @@ -111,7 +113,7 @@ func (c *Call) Return(returnArguments ...interface{}) *Call { // Panic specifies if the functon call should fail and the panic message // -// Mock.On("DoSomething").Panic("test panic") +// Mock.On("DoSomething").Panic("test panic") func (c *Call) Panic(msg string) *Call { c.lock() defer c.unlock() @@ -123,14 +125,14 @@ func (c *Call) Panic(msg string) *Call { // Once indicates that that the mock should only return the value once. // -// Mock.On("MyMethod", arg1, arg2).Return(returnArg1, returnArg2).Once() +// Mock.On("MyMethod", arg1, arg2).Return(returnArg1, returnArg2).Once() func (c *Call) Once() *Call { return c.Times(1) } // Twice indicates that that the mock should only return the value twice. // -// Mock.On("MyMethod", arg1, arg2).Return(returnArg1, returnArg2).Twice() +// Mock.On("MyMethod", arg1, arg2).Return(returnArg1, returnArg2).Twice() func (c *Call) Twice() *Call { return c.Times(2) } @@ -138,7 +140,7 @@ func (c *Call) Twice() *Call { // Times indicates that that the mock should only return the indicated number // of times. // -// Mock.On("MyMethod", arg1, arg2).Return(returnArg1, returnArg2).Times(5) +// Mock.On("MyMethod", arg1, arg2).Return(returnArg1, returnArg2).Times(5) func (c *Call) Times(i int) *Call { c.lock() defer c.unlock() @@ -149,7 +151,7 @@ func (c *Call) Times(i int) *Call { // WaitUntil sets the channel that will block the mock's return until its closed // or a message is received. // -// Mock.On("MyMethod", arg1, arg2).WaitUntil(time.After(time.Second)) +// Mock.On("MyMethod", arg1, arg2).WaitUntil(time.After(time.Second)) func (c *Call) WaitUntil(w <-chan time.Time) *Call { c.lock() defer c.unlock() @@ -159,7 +161,7 @@ func (c *Call) WaitUntil(w <-chan time.Time) *Call { // After sets how long to block until the call returns // -// Mock.On("MyMethod", arg1, arg2).After(time.Second) +// Mock.On("MyMethod", arg1, arg2).After(time.Second) func (c *Call) After(d time.Duration) *Call { c.lock() defer c.unlock() @@ -171,10 +173,10 @@ func (c *Call) After(d time.Duration) *Call { // mocking a method (such as an unmarshaler) that takes a pointer to a struct and // sets properties in such struct // -// Mock.On("Unmarshal", AnythingOfType("*map[string]interface{}")).Return().Run(func(args Arguments) { -// arg := args.Get(0).(*map[string]interface{}) -// arg["foo"] = "bar" -// }) +// Mock.On("Unmarshal", AnythingOfType("*map[string]interface{}")).Return().Run(func(args Arguments) { +// arg := args.Get(0).(*map[string]interface{}) +// arg["foo"] = "bar" +// }) func (c *Call) Run(fn func(args Arguments)) *Call { c.lock() defer c.unlock() @@ -194,16 +196,18 @@ func (c *Call) Maybe() *Call { // On chains a new expectation description onto the mocked interface. This // allows syntax like. // -// Mock. -// On("MyMethod", 1).Return(nil). -// On("MyOtherMethod", 'a', 'b', 'c').Return(errors.New("Some Error")) +// Mock. +// On("MyMethod", 1).Return(nil). +// On("MyOtherMethod", 'a', 'b', 'c').Return(errors.New("Some Error")) +// //go:noinline func (c *Call) On(methodName string, arguments ...interface{}) *Call { return c.Parent.On(methodName, arguments...) } // Unset removes a mock handler from being called. -// test.On("func", mock.Anything).Unset() +// +// test.On("func", mock.Anything).Unset() func (c *Call) Unset() *Call { var unlockOnce sync.Once @@ -249,9 +253,9 @@ func (c *Call) Unset() *Call { // calls have been called as expected. The referenced calls may be from the // same mock instance and/or other mock instances. // -// Mock.On("Do").Return(nil).Notbefore( -// Mock.On("Init").Return(nil) -// ) +// Mock.On("Do").Return(nil).Notbefore( +// Mock.On("Init").Return(nil) +// ) func (c *Call) NotBefore(calls ...*Call) *Call { c.lock() defer c.unlock() @@ -334,7 +338,7 @@ func (m *Mock) fail(format string, args ...interface{}) { // On starts a description of an expectation of the specified method // being called. // -// Mock.On("MyMethod", arg1, arg2) +// Mock.On("MyMethod", arg1, arg2) func (m *Mock) On(methodName string, arguments ...interface{}) *Call { for _, arg := range arguments { if v := reflect.ValueOf(arg); v.Kind() == reflect.Func { @@ -424,6 +428,10 @@ func callString(method string, arguments Arguments, includeArgumentValues bool) if includeArgumentValues { var argVals []string for argIndex, arg := range arguments { + if _, ok := arg.(*FunctionalOptionsArgument); ok { + argVals = append(argVals, fmt.Sprintf("%d: %s", argIndex, arg)) + continue + } argVals = append(argVals, fmt.Sprintf("%d: %#v", argIndex, arg)) } argValsString = fmt.Sprintf("\n\t\t%s", strings.Join(argVals, "\n\t\t")) @@ -758,6 +766,7 @@ type AnythingOfTypeArgument string // name of the type to check for. Used in Diff and Assert. // // For example: +// // Assert(t, AnythingOfType("string"), AnythingOfType("int")) func AnythingOfType(t string) AnythingOfTypeArgument { return AnythingOfTypeArgument(t) @@ -780,6 +789,34 @@ func IsType(t interface{}) *IsTypeArgument { return &IsTypeArgument{t: t} } +// FunctionalOptionsArgument is a struct that contains the type and value of an functional option argument +// for use when type checking. +type FunctionalOptionsArgument struct { + value interface{} +} + +// String returns the string representation of FunctionalOptionsArgument +func (f *FunctionalOptionsArgument) String() string { + var name string + tValue := reflect.ValueOf(f.value) + if tValue.Len() > 0 { + name = "[]" + reflect.TypeOf(tValue.Index(0).Interface()).String() + } + + return strings.Replace(fmt.Sprintf("%#v", f.value), "[]interface {}", name, 1) +} + +// FunctionalOptions returns an FunctionalOptionsArgument object containing the functional option type +// and the values to check of +// +// For example: +// Assert(t, FunctionalOptions("[]foo.FunctionalOption", foo.Opt1(), foo.Opt2())) +func FunctionalOptions(value ...interface{}) *FunctionalOptionsArgument { + return &FunctionalOptionsArgument{ + value: value, + } +} + // argumentMatcher performs custom argument matching, returning whether or // not the argument is matched by the expectation fixture function. type argumentMatcher struct { @@ -926,6 +963,29 @@ func (args Arguments) Diff(objects []interface{}) (string, int) { differences++ output = fmt.Sprintf("%s\t%d: FAIL: type %s != type %s - %s\n", output, i, reflect.TypeOf(t).Name(), reflect.TypeOf(actual).Name(), actualFmt) } + } else if reflect.TypeOf(expected) == reflect.TypeOf((*FunctionalOptionsArgument)(nil)) { + t := expected.(*FunctionalOptionsArgument).value + + var name string + tValue := reflect.ValueOf(t) + if tValue.Len() > 0 { + name = "[]" + reflect.TypeOf(tValue.Index(0).Interface()).String() + } + + tName := reflect.TypeOf(t).Name() + if name != reflect.TypeOf(actual).String() && tValue.Len() != 0 { + differences++ + output = fmt.Sprintf("%s\t%d: FAIL: type %s != type %s - %s\n", output, i, tName, reflect.TypeOf(actual).Name(), actualFmt) + } else { + if ef, af := assertOpts(t, actual); ef == "" && af == "" { + // match + output = fmt.Sprintf("%s\t%d: PASS: %s == %s\n", output, i, tName, tName) + } else { + // not match + differences++ + output = fmt.Sprintf("%s\t%d: FAIL: %s != %s\n", output, i, af, ef) + } + } } else { // normal checking @@ -1102,3 +1162,65 @@ var spewConfig = spew.ConfigState{ type tHelper interface { Helper() } + +func assertOpts(expected, actual interface{}) (expectedFmt, actualFmt string) { + expectedOpts := reflect.ValueOf(expected) + actualOpts := reflect.ValueOf(actual) + var expectedNames []string + for i := 0; i < expectedOpts.Len(); i++ { + expectedNames = append(expectedNames, funcName(expectedOpts.Index(i).Interface())) + } + var actualNames []string + for i := 0; i < actualOpts.Len(); i++ { + actualNames = append(actualNames, funcName(actualOpts.Index(i).Interface())) + } + if !assert.ObjectsAreEqual(expectedNames, actualNames) { + expectedFmt = fmt.Sprintf("%v", expectedNames) + actualFmt = fmt.Sprintf("%v", actualNames) + return + } + + for i := 0; i < expectedOpts.Len(); i++ { + expectedOpt := expectedOpts.Index(i).Interface() + actualOpt := actualOpts.Index(i).Interface() + + expectedFunc := expectedNames[i] + actualFunc := actualNames[i] + if expectedFunc != actualFunc { + expectedFmt = expectedFunc + actualFmt = actualFunc + return + } + + ot := reflect.TypeOf(expectedOpt) + var expectedValues []reflect.Value + var actualValues []reflect.Value + if ot.NumIn() == 0 { + return + } + + for i := 0; i < ot.NumIn(); i++ { + vt := ot.In(i).Elem() + expectedValues = append(expectedValues, reflect.New(vt)) + actualValues = append(actualValues, reflect.New(vt)) + } + + reflect.ValueOf(expectedOpt).Call(expectedValues) + reflect.ValueOf(actualOpt).Call(actualValues) + + for i := 0; i < ot.NumIn(); i++ { + if !assert.ObjectsAreEqual(expectedValues[i].Interface(), actualValues[i].Interface()) { + expectedFmt = fmt.Sprintf("%s %+v", expectedNames[i], expectedValues[i].Interface()) + actualFmt = fmt.Sprintf("%s %+v", expectedNames[i], actualValues[i].Interface()) + return + } + } + } + + return "", "" +} + +func funcName(opt interface{}) string { + n := runtime.FuncForPC(reflect.ValueOf(opt).Pointer()).Name() + return strings.TrimSuffix(path.Base(n), path.Ext(n)) +} diff --git a/cluster-autoscaler/vendor/github.com/stretchr/testify/require/doc.go b/cluster-autoscaler/vendor/github.com/stretchr/testify/require/doc.go index 169de39221c7..968434724559 100644 --- a/cluster-autoscaler/vendor/github.com/stretchr/testify/require/doc.go +++ b/cluster-autoscaler/vendor/github.com/stretchr/testify/require/doc.go @@ -1,24 +1,25 @@ // Package require implements the same assertions as the `assert` package but // stops test execution when a test fails. // -// Example Usage +// # Example Usage // // The following is a complete example using require in a standard test function: -// import ( -// "testing" -// "github.com/stretchr/testify/require" -// ) // -// func TestSomething(t *testing.T) { +// import ( +// "testing" +// "github.com/stretchr/testify/require" +// ) // -// var a string = "Hello" -// var b string = "Hello" +// func TestSomething(t *testing.T) { // -// require.Equal(t, a, b, "The two words should be the same.") +// var a string = "Hello" +// var b string = "Hello" // -// } +// require.Equal(t, a, b, "The two words should be the same.") // -// Assertions +// } +// +// # Assertions // // The `require` package have same global functions as in the `assert` package, // but instead of returning a boolean result they call `t.FailNow()`. diff --git a/cluster-autoscaler/vendor/github.com/stretchr/testify/require/require.go b/cluster-autoscaler/vendor/github.com/stretchr/testify/require/require.go index 880853f5a2c5..63f852147675 100644 --- a/cluster-autoscaler/vendor/github.com/stretchr/testify/require/require.go +++ b/cluster-autoscaler/vendor/github.com/stretchr/testify/require/require.go @@ -37,9 +37,9 @@ func Conditionf(t TestingT, comp assert.Comparison, msg string, args ...interfac // Contains asserts that the specified string, list(array, slice...) or map contains the // specified substring or element. // -// assert.Contains(t, "Hello World", "World") -// assert.Contains(t, ["Hello", "World"], "World") -// assert.Contains(t, {"Hello": "World"}, "Hello") +// assert.Contains(t, "Hello World", "World") +// assert.Contains(t, ["Hello", "World"], "World") +// assert.Contains(t, {"Hello": "World"}, "Hello") func Contains(t TestingT, s interface{}, contains interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -53,9 +53,9 @@ func Contains(t TestingT, s interface{}, contains interface{}, msgAndArgs ...int // Containsf asserts that the specified string, list(array, slice...) or map contains the // specified substring or element. // -// assert.Containsf(t, "Hello World", "World", "error message %s", "formatted") -// assert.Containsf(t, ["Hello", "World"], "World", "error message %s", "formatted") -// assert.Containsf(t, {"Hello": "World"}, "Hello", "error message %s", "formatted") +// assert.Containsf(t, "Hello World", "World", "error message %s", "formatted") +// assert.Containsf(t, ["Hello", "World"], "World", "error message %s", "formatted") +// assert.Containsf(t, {"Hello": "World"}, "Hello", "error message %s", "formatted") func Containsf(t TestingT, s interface{}, contains interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -123,7 +123,7 @@ func ElementsMatchf(t TestingT, listA interface{}, listB interface{}, msg string // Empty asserts that the specified object is empty. I.e. nil, "", false, 0 or either // a slice or a channel with len == 0. // -// assert.Empty(t, obj) +// assert.Empty(t, obj) func Empty(t TestingT, object interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -137,7 +137,7 @@ func Empty(t TestingT, object interface{}, msgAndArgs ...interface{}) { // Emptyf asserts that the specified object is empty. I.e. nil, "", false, 0 or either // a slice or a channel with len == 0. // -// assert.Emptyf(t, obj, "error message %s", "formatted") +// assert.Emptyf(t, obj, "error message %s", "formatted") func Emptyf(t TestingT, object interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -150,7 +150,7 @@ func Emptyf(t TestingT, object interface{}, msg string, args ...interface{}) { // Equal asserts that two objects are equal. // -// assert.Equal(t, 123, 123) +// assert.Equal(t, 123, 123) // // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). Function equality @@ -168,8 +168,8 @@ func Equal(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...i // EqualError asserts that a function returned an error (i.e. not `nil`) // and that it is equal to the provided error. // -// actualObj, err := SomeFunction() -// assert.EqualError(t, err, expectedErrorString) +// actualObj, err := SomeFunction() +// assert.EqualError(t, err, expectedErrorString) func EqualError(t TestingT, theError error, errString string, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -183,8 +183,8 @@ func EqualError(t TestingT, theError error, errString string, msgAndArgs ...inte // EqualErrorf asserts that a function returned an error (i.e. not `nil`) // and that it is equal to the provided error. // -// actualObj, err := SomeFunction() -// assert.EqualErrorf(t, err, expectedErrorString, "error message %s", "formatted") +// actualObj, err := SomeFunction() +// assert.EqualErrorf(t, err, expectedErrorString, "error message %s", "formatted") func EqualErrorf(t TestingT, theError error, errString string, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -195,10 +195,50 @@ func EqualErrorf(t TestingT, theError error, errString string, msg string, args t.FailNow() } +// EqualExportedValues asserts that the types of two objects are equal and their public +// fields are also equal. This is useful for comparing structs that have private fields +// that could potentially differ. +// +// type S struct { +// Exported int +// notExported int +// } +// assert.EqualExportedValues(t, S{1, 2}, S{1, 3}) => true +// assert.EqualExportedValues(t, S{1, 2}, S{2, 3}) => false +func EqualExportedValues(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.EqualExportedValues(t, expected, actual, msgAndArgs...) { + return + } + t.FailNow() +} + +// EqualExportedValuesf asserts that the types of two objects are equal and their public +// fields are also equal. This is useful for comparing structs that have private fields +// that could potentially differ. +// +// type S struct { +// Exported int +// notExported int +// } +// assert.EqualExportedValuesf(t, S{1, 2}, S{1, 3}, "error message %s", "formatted") => true +// assert.EqualExportedValuesf(t, S{1, 2}, S{2, 3}, "error message %s", "formatted") => false +func EqualExportedValuesf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.EqualExportedValuesf(t, expected, actual, msg, args...) { + return + } + t.FailNow() +} + // EqualValues asserts that two objects are equal or convertable to the same types // and equal. // -// assert.EqualValues(t, uint32(123), int32(123)) +// assert.EqualValues(t, uint32(123), int32(123)) func EqualValues(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -212,7 +252,7 @@ func EqualValues(t TestingT, expected interface{}, actual interface{}, msgAndArg // EqualValuesf asserts that two objects are equal or convertable to the same types // and equal. // -// assert.EqualValuesf(t, uint32(123), int32(123), "error message %s", "formatted") +// assert.EqualValuesf(t, uint32(123), int32(123), "error message %s", "formatted") func EqualValuesf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -225,7 +265,7 @@ func EqualValuesf(t TestingT, expected interface{}, actual interface{}, msg stri // Equalf asserts that two objects are equal. // -// assert.Equalf(t, 123, 123, "error message %s", "formatted") +// assert.Equalf(t, 123, 123, "error message %s", "formatted") // // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). Function equality @@ -242,10 +282,10 @@ func Equalf(t TestingT, expected interface{}, actual interface{}, msg string, ar // Error asserts that a function returned an error (i.e. not `nil`). // -// actualObj, err := SomeFunction() -// if assert.Error(t, err) { -// assert.Equal(t, expectedError, err) -// } +// actualObj, err := SomeFunction() +// if assert.Error(t, err) { +// assert.Equal(t, expectedError, err) +// } func Error(t TestingT, err error, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -283,8 +323,8 @@ func ErrorAsf(t TestingT, err error, target interface{}, msg string, args ...int // ErrorContains asserts that a function returned an error (i.e. not `nil`) // and that the error contains the specified substring. // -// actualObj, err := SomeFunction() -// assert.ErrorContains(t, err, expectedErrorSubString) +// actualObj, err := SomeFunction() +// assert.ErrorContains(t, err, expectedErrorSubString) func ErrorContains(t TestingT, theError error, contains string, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -298,8 +338,8 @@ func ErrorContains(t TestingT, theError error, contains string, msgAndArgs ...in // ErrorContainsf asserts that a function returned an error (i.e. not `nil`) // and that the error contains the specified substring. // -// actualObj, err := SomeFunction() -// assert.ErrorContainsf(t, err, expectedErrorSubString, "error message %s", "formatted") +// actualObj, err := SomeFunction() +// assert.ErrorContainsf(t, err, expectedErrorSubString, "error message %s", "formatted") func ErrorContainsf(t TestingT, theError error, contains string, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -336,10 +376,10 @@ func ErrorIsf(t TestingT, err error, target error, msg string, args ...interface // Errorf asserts that a function returned an error (i.e. not `nil`). // -// actualObj, err := SomeFunction() -// if assert.Errorf(t, err, "error message %s", "formatted") { -// assert.Equal(t, expectedErrorf, err) -// } +// actualObj, err := SomeFunction() +// if assert.Errorf(t, err, "error message %s", "formatted") { +// assert.Equal(t, expectedErrorf, err) +// } func Errorf(t TestingT, err error, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -353,7 +393,7 @@ func Errorf(t TestingT, err error, msg string, args ...interface{}) { // Eventually asserts that given condition will be met in waitFor time, // periodically checking target function each tick. // -// assert.Eventually(t, func() bool { return true; }, time.Second, 10*time.Millisecond) +// assert.Eventually(t, func() bool { return true; }, time.Second, 10*time.Millisecond) func Eventually(t TestingT, condition func() bool, waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -364,10 +404,66 @@ func Eventually(t TestingT, condition func() bool, waitFor time.Duration, tick t t.FailNow() } +// EventuallyWithT asserts that given condition will be met in waitFor time, +// periodically checking target function each tick. In contrast to Eventually, +// it supplies a CollectT to the condition function, so that the condition +// function can use the CollectT to call other assertions. +// The condition is considered "met" if no errors are raised in a tick. +// The supplied CollectT collects all errors from one tick (if there are any). +// If the condition is not met before waitFor, the collected errors of +// the last tick are copied to t. +// +// externalValue := false +// go func() { +// time.Sleep(8*time.Second) +// externalValue = true +// }() +// assert.EventuallyWithT(t, func(c *assert.CollectT) { +// // add assertions as needed; any assertion failure will fail the current tick +// assert.True(c, externalValue, "expected 'externalValue' to be true") +// }, 1*time.Second, 10*time.Second, "external state has not changed to 'true'; still false") +func EventuallyWithT(t TestingT, condition func(collect *assert.CollectT), waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.EventuallyWithT(t, condition, waitFor, tick, msgAndArgs...) { + return + } + t.FailNow() +} + +// EventuallyWithTf asserts that given condition will be met in waitFor time, +// periodically checking target function each tick. In contrast to Eventually, +// it supplies a CollectT to the condition function, so that the condition +// function can use the CollectT to call other assertions. +// The condition is considered "met" if no errors are raised in a tick. +// The supplied CollectT collects all errors from one tick (if there are any). +// If the condition is not met before waitFor, the collected errors of +// the last tick are copied to t. +// +// externalValue := false +// go func() { +// time.Sleep(8*time.Second) +// externalValue = true +// }() +// assert.EventuallyWithTf(t, func(c *assert.CollectT, "error message %s", "formatted") { +// // add assertions as needed; any assertion failure will fail the current tick +// assert.True(c, externalValue, "expected 'externalValue' to be true") +// }, 1*time.Second, 10*time.Second, "external state has not changed to 'true'; still false") +func EventuallyWithTf(t TestingT, condition func(collect *assert.CollectT), waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) { + if h, ok := t.(tHelper); ok { + h.Helper() + } + if assert.EventuallyWithTf(t, condition, waitFor, tick, msg, args...) { + return + } + t.FailNow() +} + // Eventuallyf asserts that given condition will be met in waitFor time, // periodically checking target function each tick. // -// assert.Eventuallyf(t, func() bool { return true; }, time.Second, 10*time.Millisecond, "error message %s", "formatted") +// assert.Eventuallyf(t, func() bool { return true; }, time.Second, 10*time.Millisecond, "error message %s", "formatted") func Eventuallyf(t TestingT, condition func() bool, waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -380,7 +476,7 @@ func Eventuallyf(t TestingT, condition func() bool, waitFor time.Duration, tick // Exactly asserts that two objects are equal in value and type. // -// assert.Exactly(t, int32(123), int64(123)) +// assert.Exactly(t, int32(123), int64(123)) func Exactly(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -393,7 +489,7 @@ func Exactly(t TestingT, expected interface{}, actual interface{}, msgAndArgs .. // Exactlyf asserts that two objects are equal in value and type. // -// assert.Exactlyf(t, int32(123), int64(123), "error message %s", "formatted") +// assert.Exactlyf(t, int32(123), int64(123), "error message %s", "formatted") func Exactlyf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -450,7 +546,7 @@ func Failf(t TestingT, failureMessage string, msg string, args ...interface{}) { // False asserts that the specified value is false. // -// assert.False(t, myBool) +// assert.False(t, myBool) func False(t TestingT, value bool, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -463,7 +559,7 @@ func False(t TestingT, value bool, msgAndArgs ...interface{}) { // Falsef asserts that the specified value is false. // -// assert.Falsef(t, myBool, "error message %s", "formatted") +// assert.Falsef(t, myBool, "error message %s", "formatted") func Falsef(t TestingT, value bool, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -500,9 +596,9 @@ func FileExistsf(t TestingT, path string, msg string, args ...interface{}) { // Greater asserts that the first element is greater than the second // -// assert.Greater(t, 2, 1) -// assert.Greater(t, float64(2), float64(1)) -// assert.Greater(t, "b", "a") +// assert.Greater(t, 2, 1) +// assert.Greater(t, float64(2), float64(1)) +// assert.Greater(t, "b", "a") func Greater(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -515,10 +611,10 @@ func Greater(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface // GreaterOrEqual asserts that the first element is greater than or equal to the second // -// assert.GreaterOrEqual(t, 2, 1) -// assert.GreaterOrEqual(t, 2, 2) -// assert.GreaterOrEqual(t, "b", "a") -// assert.GreaterOrEqual(t, "b", "b") +// assert.GreaterOrEqual(t, 2, 1) +// assert.GreaterOrEqual(t, 2, 2) +// assert.GreaterOrEqual(t, "b", "a") +// assert.GreaterOrEqual(t, "b", "b") func GreaterOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -531,10 +627,10 @@ func GreaterOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...in // GreaterOrEqualf asserts that the first element is greater than or equal to the second // -// assert.GreaterOrEqualf(t, 2, 1, "error message %s", "formatted") -// assert.GreaterOrEqualf(t, 2, 2, "error message %s", "formatted") -// assert.GreaterOrEqualf(t, "b", "a", "error message %s", "formatted") -// assert.GreaterOrEqualf(t, "b", "b", "error message %s", "formatted") +// assert.GreaterOrEqualf(t, 2, 1, "error message %s", "formatted") +// assert.GreaterOrEqualf(t, 2, 2, "error message %s", "formatted") +// assert.GreaterOrEqualf(t, "b", "a", "error message %s", "formatted") +// assert.GreaterOrEqualf(t, "b", "b", "error message %s", "formatted") func GreaterOrEqualf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -547,9 +643,9 @@ func GreaterOrEqualf(t TestingT, e1 interface{}, e2 interface{}, msg string, arg // Greaterf asserts that the first element is greater than the second // -// assert.Greaterf(t, 2, 1, "error message %s", "formatted") -// assert.Greaterf(t, float64(2), float64(1), "error message %s", "formatted") -// assert.Greaterf(t, "b", "a", "error message %s", "formatted") +// assert.Greaterf(t, 2, 1, "error message %s", "formatted") +// assert.Greaterf(t, float64(2), float64(1), "error message %s", "formatted") +// assert.Greaterf(t, "b", "a", "error message %s", "formatted") func Greaterf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -563,7 +659,7 @@ func Greaterf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...in // HTTPBodyContains asserts that a specified handler returns a // body that contains a string. // -// assert.HTTPBodyContains(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") +// assert.HTTPBodyContains(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") // // Returns whether the assertion was successful (true) or not (false). func HTTPBodyContains(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) { @@ -579,7 +675,7 @@ func HTTPBodyContains(t TestingT, handler http.HandlerFunc, method string, url s // HTTPBodyContainsf asserts that a specified handler returns a // body that contains a string. // -// assert.HTTPBodyContainsf(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") +// assert.HTTPBodyContainsf(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func HTTPBodyContainsf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) { @@ -595,7 +691,7 @@ func HTTPBodyContainsf(t TestingT, handler http.HandlerFunc, method string, url // HTTPBodyNotContains asserts that a specified handler returns a // body that does not contain a string. // -// assert.HTTPBodyNotContains(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") +// assert.HTTPBodyNotContains(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") // // Returns whether the assertion was successful (true) or not (false). func HTTPBodyNotContains(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) { @@ -611,7 +707,7 @@ func HTTPBodyNotContains(t TestingT, handler http.HandlerFunc, method string, ur // HTTPBodyNotContainsf asserts that a specified handler returns a // body that does not contain a string. // -// assert.HTTPBodyNotContainsf(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") +// assert.HTTPBodyNotContainsf(t, myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func HTTPBodyNotContainsf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) { @@ -626,7 +722,7 @@ func HTTPBodyNotContainsf(t TestingT, handler http.HandlerFunc, method string, u // HTTPError asserts that a specified handler returns an error status code. // -// assert.HTTPError(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} +// assert.HTTPError(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} // // Returns whether the assertion was successful (true) or not (false). func HTTPError(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) { @@ -641,7 +737,7 @@ func HTTPError(t TestingT, handler http.HandlerFunc, method string, url string, // HTTPErrorf asserts that a specified handler returns an error status code. // -// assert.HTTPErrorf(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} +// assert.HTTPErrorf(t, myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} // // Returns whether the assertion was successful (true) or not (false). func HTTPErrorf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) { @@ -656,7 +752,7 @@ func HTTPErrorf(t TestingT, handler http.HandlerFunc, method string, url string, // HTTPRedirect asserts that a specified handler returns a redirect status code. // -// assert.HTTPRedirect(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} +// assert.HTTPRedirect(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} // // Returns whether the assertion was successful (true) or not (false). func HTTPRedirect(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) { @@ -671,7 +767,7 @@ func HTTPRedirect(t TestingT, handler http.HandlerFunc, method string, url strin // HTTPRedirectf asserts that a specified handler returns a redirect status code. // -// assert.HTTPRedirectf(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} +// assert.HTTPRedirectf(t, myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} // // Returns whether the assertion was successful (true) or not (false). func HTTPRedirectf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) { @@ -686,7 +782,7 @@ func HTTPRedirectf(t TestingT, handler http.HandlerFunc, method string, url stri // HTTPStatusCode asserts that a specified handler returns a specified status code. // -// assert.HTTPStatusCode(t, myHandler, "GET", "/notImplemented", nil, 501) +// assert.HTTPStatusCode(t, myHandler, "GET", "/notImplemented", nil, 501) // // Returns whether the assertion was successful (true) or not (false). func HTTPStatusCode(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msgAndArgs ...interface{}) { @@ -701,7 +797,7 @@ func HTTPStatusCode(t TestingT, handler http.HandlerFunc, method string, url str // HTTPStatusCodef asserts that a specified handler returns a specified status code. // -// assert.HTTPStatusCodef(t, myHandler, "GET", "/notImplemented", nil, 501, "error message %s", "formatted") +// assert.HTTPStatusCodef(t, myHandler, "GET", "/notImplemented", nil, 501, "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func HTTPStatusCodef(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msg string, args ...interface{}) { @@ -716,7 +812,7 @@ func HTTPStatusCodef(t TestingT, handler http.HandlerFunc, method string, url st // HTTPSuccess asserts that a specified handler returns a success status code. // -// assert.HTTPSuccess(t, myHandler, "POST", "http://www.google.com", nil) +// assert.HTTPSuccess(t, myHandler, "POST", "http://www.google.com", nil) // // Returns whether the assertion was successful (true) or not (false). func HTTPSuccess(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) { @@ -731,7 +827,7 @@ func HTTPSuccess(t TestingT, handler http.HandlerFunc, method string, url string // HTTPSuccessf asserts that a specified handler returns a success status code. // -// assert.HTTPSuccessf(t, myHandler, "POST", "http://www.google.com", nil, "error message %s", "formatted") +// assert.HTTPSuccessf(t, myHandler, "POST", "http://www.google.com", nil, "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func HTTPSuccessf(t TestingT, handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) { @@ -746,7 +842,7 @@ func HTTPSuccessf(t TestingT, handler http.HandlerFunc, method string, url strin // Implements asserts that an object is implemented by the specified interface. // -// assert.Implements(t, (*MyInterface)(nil), new(MyObject)) +// assert.Implements(t, (*MyInterface)(nil), new(MyObject)) func Implements(t TestingT, interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -759,7 +855,7 @@ func Implements(t TestingT, interfaceObject interface{}, object interface{}, msg // Implementsf asserts that an object is implemented by the specified interface. // -// assert.Implementsf(t, (*MyInterface)(nil), new(MyObject), "error message %s", "formatted") +// assert.Implementsf(t, (*MyInterface)(nil), new(MyObject), "error message %s", "formatted") func Implementsf(t TestingT, interfaceObject interface{}, object interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -772,7 +868,7 @@ func Implementsf(t TestingT, interfaceObject interface{}, object interface{}, ms // InDelta asserts that the two numerals are within delta of each other. // -// assert.InDelta(t, math.Pi, 22/7.0, 0.01) +// assert.InDelta(t, math.Pi, 22/7.0, 0.01) func InDelta(t TestingT, expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -829,7 +925,7 @@ func InDeltaSlicef(t TestingT, expected interface{}, actual interface{}, delta f // InDeltaf asserts that the two numerals are within delta of each other. // -// assert.InDeltaf(t, math.Pi, 22/7.0, 0.01, "error message %s", "formatted") +// assert.InDeltaf(t, math.Pi, 22/7.0, 0.01, "error message %s", "formatted") func InDeltaf(t TestingT, expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -886,9 +982,9 @@ func InEpsilonf(t TestingT, expected interface{}, actual interface{}, epsilon fl // IsDecreasing asserts that the collection is decreasing // -// assert.IsDecreasing(t, []int{2, 1, 0}) -// assert.IsDecreasing(t, []float{2, 1}) -// assert.IsDecreasing(t, []string{"b", "a"}) +// assert.IsDecreasing(t, []int{2, 1, 0}) +// assert.IsDecreasing(t, []float{2, 1}) +// assert.IsDecreasing(t, []string{"b", "a"}) func IsDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -901,9 +997,9 @@ func IsDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) { // IsDecreasingf asserts that the collection is decreasing // -// assert.IsDecreasingf(t, []int{2, 1, 0}, "error message %s", "formatted") -// assert.IsDecreasingf(t, []float{2, 1}, "error message %s", "formatted") -// assert.IsDecreasingf(t, []string{"b", "a"}, "error message %s", "formatted") +// assert.IsDecreasingf(t, []int{2, 1, 0}, "error message %s", "formatted") +// assert.IsDecreasingf(t, []float{2, 1}, "error message %s", "formatted") +// assert.IsDecreasingf(t, []string{"b", "a"}, "error message %s", "formatted") func IsDecreasingf(t TestingT, object interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -916,9 +1012,9 @@ func IsDecreasingf(t TestingT, object interface{}, msg string, args ...interface // IsIncreasing asserts that the collection is increasing // -// assert.IsIncreasing(t, []int{1, 2, 3}) -// assert.IsIncreasing(t, []float{1, 2}) -// assert.IsIncreasing(t, []string{"a", "b"}) +// assert.IsIncreasing(t, []int{1, 2, 3}) +// assert.IsIncreasing(t, []float{1, 2}) +// assert.IsIncreasing(t, []string{"a", "b"}) func IsIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -931,9 +1027,9 @@ func IsIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) { // IsIncreasingf asserts that the collection is increasing // -// assert.IsIncreasingf(t, []int{1, 2, 3}, "error message %s", "formatted") -// assert.IsIncreasingf(t, []float{1, 2}, "error message %s", "formatted") -// assert.IsIncreasingf(t, []string{"a", "b"}, "error message %s", "formatted") +// assert.IsIncreasingf(t, []int{1, 2, 3}, "error message %s", "formatted") +// assert.IsIncreasingf(t, []float{1, 2}, "error message %s", "formatted") +// assert.IsIncreasingf(t, []string{"a", "b"}, "error message %s", "formatted") func IsIncreasingf(t TestingT, object interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -946,9 +1042,9 @@ func IsIncreasingf(t TestingT, object interface{}, msg string, args ...interface // IsNonDecreasing asserts that the collection is not decreasing // -// assert.IsNonDecreasing(t, []int{1, 1, 2}) -// assert.IsNonDecreasing(t, []float{1, 2}) -// assert.IsNonDecreasing(t, []string{"a", "b"}) +// assert.IsNonDecreasing(t, []int{1, 1, 2}) +// assert.IsNonDecreasing(t, []float{1, 2}) +// assert.IsNonDecreasing(t, []string{"a", "b"}) func IsNonDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -961,9 +1057,9 @@ func IsNonDecreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) // IsNonDecreasingf asserts that the collection is not decreasing // -// assert.IsNonDecreasingf(t, []int{1, 1, 2}, "error message %s", "formatted") -// assert.IsNonDecreasingf(t, []float{1, 2}, "error message %s", "formatted") -// assert.IsNonDecreasingf(t, []string{"a", "b"}, "error message %s", "formatted") +// assert.IsNonDecreasingf(t, []int{1, 1, 2}, "error message %s", "formatted") +// assert.IsNonDecreasingf(t, []float{1, 2}, "error message %s", "formatted") +// assert.IsNonDecreasingf(t, []string{"a", "b"}, "error message %s", "formatted") func IsNonDecreasingf(t TestingT, object interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -976,9 +1072,9 @@ func IsNonDecreasingf(t TestingT, object interface{}, msg string, args ...interf // IsNonIncreasing asserts that the collection is not increasing // -// assert.IsNonIncreasing(t, []int{2, 1, 1}) -// assert.IsNonIncreasing(t, []float{2, 1}) -// assert.IsNonIncreasing(t, []string{"b", "a"}) +// assert.IsNonIncreasing(t, []int{2, 1, 1}) +// assert.IsNonIncreasing(t, []float{2, 1}) +// assert.IsNonIncreasing(t, []string{"b", "a"}) func IsNonIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -991,9 +1087,9 @@ func IsNonIncreasing(t TestingT, object interface{}, msgAndArgs ...interface{}) // IsNonIncreasingf asserts that the collection is not increasing // -// assert.IsNonIncreasingf(t, []int{2, 1, 1}, "error message %s", "formatted") -// assert.IsNonIncreasingf(t, []float{2, 1}, "error message %s", "formatted") -// assert.IsNonIncreasingf(t, []string{"b", "a"}, "error message %s", "formatted") +// assert.IsNonIncreasingf(t, []int{2, 1, 1}, "error message %s", "formatted") +// assert.IsNonIncreasingf(t, []float{2, 1}, "error message %s", "formatted") +// assert.IsNonIncreasingf(t, []string{"b", "a"}, "error message %s", "formatted") func IsNonIncreasingf(t TestingT, object interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1028,7 +1124,7 @@ func IsTypef(t TestingT, expectedType interface{}, object interface{}, msg strin // JSONEq asserts that two JSON strings are equivalent. // -// assert.JSONEq(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`) +// assert.JSONEq(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`) func JSONEq(t TestingT, expected string, actual string, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1041,7 +1137,7 @@ func JSONEq(t TestingT, expected string, actual string, msgAndArgs ...interface{ // JSONEqf asserts that two JSON strings are equivalent. // -// assert.JSONEqf(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`, "error message %s", "formatted") +// assert.JSONEqf(t, `{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`, "error message %s", "formatted") func JSONEqf(t TestingT, expected string, actual string, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1055,7 +1151,7 @@ func JSONEqf(t TestingT, expected string, actual string, msg string, args ...int // Len asserts that the specified object has specific length. // Len also fails if the object has a type that len() not accept. // -// assert.Len(t, mySlice, 3) +// assert.Len(t, mySlice, 3) func Len(t TestingT, object interface{}, length int, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1069,7 +1165,7 @@ func Len(t TestingT, object interface{}, length int, msgAndArgs ...interface{}) // Lenf asserts that the specified object has specific length. // Lenf also fails if the object has a type that len() not accept. // -// assert.Lenf(t, mySlice, 3, "error message %s", "formatted") +// assert.Lenf(t, mySlice, 3, "error message %s", "formatted") func Lenf(t TestingT, object interface{}, length int, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1082,9 +1178,9 @@ func Lenf(t TestingT, object interface{}, length int, msg string, args ...interf // Less asserts that the first element is less than the second // -// assert.Less(t, 1, 2) -// assert.Less(t, float64(1), float64(2)) -// assert.Less(t, "a", "b") +// assert.Less(t, 1, 2) +// assert.Less(t, float64(1), float64(2)) +// assert.Less(t, "a", "b") func Less(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1097,10 +1193,10 @@ func Less(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) // LessOrEqual asserts that the first element is less than or equal to the second // -// assert.LessOrEqual(t, 1, 2) -// assert.LessOrEqual(t, 2, 2) -// assert.LessOrEqual(t, "a", "b") -// assert.LessOrEqual(t, "b", "b") +// assert.LessOrEqual(t, 1, 2) +// assert.LessOrEqual(t, 2, 2) +// assert.LessOrEqual(t, "a", "b") +// assert.LessOrEqual(t, "b", "b") func LessOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1113,10 +1209,10 @@ func LessOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...inter // LessOrEqualf asserts that the first element is less than or equal to the second // -// assert.LessOrEqualf(t, 1, 2, "error message %s", "formatted") -// assert.LessOrEqualf(t, 2, 2, "error message %s", "formatted") -// assert.LessOrEqualf(t, "a", "b", "error message %s", "formatted") -// assert.LessOrEqualf(t, "b", "b", "error message %s", "formatted") +// assert.LessOrEqualf(t, 1, 2, "error message %s", "formatted") +// assert.LessOrEqualf(t, 2, 2, "error message %s", "formatted") +// assert.LessOrEqualf(t, "a", "b", "error message %s", "formatted") +// assert.LessOrEqualf(t, "b", "b", "error message %s", "formatted") func LessOrEqualf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1129,9 +1225,9 @@ func LessOrEqualf(t TestingT, e1 interface{}, e2 interface{}, msg string, args . // Lessf asserts that the first element is less than the second // -// assert.Lessf(t, 1, 2, "error message %s", "formatted") -// assert.Lessf(t, float64(1), float64(2), "error message %s", "formatted") -// assert.Lessf(t, "a", "b", "error message %s", "formatted") +// assert.Lessf(t, 1, 2, "error message %s", "formatted") +// assert.Lessf(t, float64(1), float64(2), "error message %s", "formatted") +// assert.Lessf(t, "a", "b", "error message %s", "formatted") func Lessf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1144,8 +1240,8 @@ func Lessf(t TestingT, e1 interface{}, e2 interface{}, msg string, args ...inter // Negative asserts that the specified element is negative // -// assert.Negative(t, -1) -// assert.Negative(t, -1.23) +// assert.Negative(t, -1) +// assert.Negative(t, -1.23) func Negative(t TestingT, e interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1158,8 +1254,8 @@ func Negative(t TestingT, e interface{}, msgAndArgs ...interface{}) { // Negativef asserts that the specified element is negative // -// assert.Negativef(t, -1, "error message %s", "formatted") -// assert.Negativef(t, -1.23, "error message %s", "formatted") +// assert.Negativef(t, -1, "error message %s", "formatted") +// assert.Negativef(t, -1.23, "error message %s", "formatted") func Negativef(t TestingT, e interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1173,7 +1269,7 @@ func Negativef(t TestingT, e interface{}, msg string, args ...interface{}) { // Never asserts that the given condition doesn't satisfy in waitFor time, // periodically checking the target function each tick. // -// assert.Never(t, func() bool { return false; }, time.Second, 10*time.Millisecond) +// assert.Never(t, func() bool { return false; }, time.Second, 10*time.Millisecond) func Never(t TestingT, condition func() bool, waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1187,7 +1283,7 @@ func Never(t TestingT, condition func() bool, waitFor time.Duration, tick time.D // Neverf asserts that the given condition doesn't satisfy in waitFor time, // periodically checking the target function each tick. // -// assert.Neverf(t, func() bool { return false; }, time.Second, 10*time.Millisecond, "error message %s", "formatted") +// assert.Neverf(t, func() bool { return false; }, time.Second, 10*time.Millisecond, "error message %s", "formatted") func Neverf(t TestingT, condition func() bool, waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1200,7 +1296,7 @@ func Neverf(t TestingT, condition func() bool, waitFor time.Duration, tick time. // Nil asserts that the specified object is nil. // -// assert.Nil(t, err) +// assert.Nil(t, err) func Nil(t TestingT, object interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1213,7 +1309,7 @@ func Nil(t TestingT, object interface{}, msgAndArgs ...interface{}) { // Nilf asserts that the specified object is nil. // -// assert.Nilf(t, err, "error message %s", "formatted") +// assert.Nilf(t, err, "error message %s", "formatted") func Nilf(t TestingT, object interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1250,10 +1346,10 @@ func NoDirExistsf(t TestingT, path string, msg string, args ...interface{}) { // NoError asserts that a function returned no error (i.e. `nil`). // -// actualObj, err := SomeFunction() -// if assert.NoError(t, err) { -// assert.Equal(t, expectedObj, actualObj) -// } +// actualObj, err := SomeFunction() +// if assert.NoError(t, err) { +// assert.Equal(t, expectedObj, actualObj) +// } func NoError(t TestingT, err error, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1266,10 +1362,10 @@ func NoError(t TestingT, err error, msgAndArgs ...interface{}) { // NoErrorf asserts that a function returned no error (i.e. `nil`). // -// actualObj, err := SomeFunction() -// if assert.NoErrorf(t, err, "error message %s", "formatted") { -// assert.Equal(t, expectedObj, actualObj) -// } +// actualObj, err := SomeFunction() +// if assert.NoErrorf(t, err, "error message %s", "formatted") { +// assert.Equal(t, expectedObj, actualObj) +// } func NoErrorf(t TestingT, err error, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1307,9 +1403,9 @@ func NoFileExistsf(t TestingT, path string, msg string, args ...interface{}) { // NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the // specified substring or element. // -// assert.NotContains(t, "Hello World", "Earth") -// assert.NotContains(t, ["Hello", "World"], "Earth") -// assert.NotContains(t, {"Hello": "World"}, "Earth") +// assert.NotContains(t, "Hello World", "Earth") +// assert.NotContains(t, ["Hello", "World"], "Earth") +// assert.NotContains(t, {"Hello": "World"}, "Earth") func NotContains(t TestingT, s interface{}, contains interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1323,9 +1419,9 @@ func NotContains(t TestingT, s interface{}, contains interface{}, msgAndArgs ... // NotContainsf asserts that the specified string, list(array, slice...) or map does NOT contain the // specified substring or element. // -// assert.NotContainsf(t, "Hello World", "Earth", "error message %s", "formatted") -// assert.NotContainsf(t, ["Hello", "World"], "Earth", "error message %s", "formatted") -// assert.NotContainsf(t, {"Hello": "World"}, "Earth", "error message %s", "formatted") +// assert.NotContainsf(t, "Hello World", "Earth", "error message %s", "formatted") +// assert.NotContainsf(t, ["Hello", "World"], "Earth", "error message %s", "formatted") +// assert.NotContainsf(t, {"Hello": "World"}, "Earth", "error message %s", "formatted") func NotContainsf(t TestingT, s interface{}, contains interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1339,9 +1435,9 @@ func NotContainsf(t TestingT, s interface{}, contains interface{}, msg string, a // NotEmpty asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either // a slice or a channel with len == 0. // -// if assert.NotEmpty(t, obj) { -// assert.Equal(t, "two", obj[1]) -// } +// if assert.NotEmpty(t, obj) { +// assert.Equal(t, "two", obj[1]) +// } func NotEmpty(t TestingT, object interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1355,9 +1451,9 @@ func NotEmpty(t TestingT, object interface{}, msgAndArgs ...interface{}) { // NotEmptyf asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either // a slice or a channel with len == 0. // -// if assert.NotEmptyf(t, obj, "error message %s", "formatted") { -// assert.Equal(t, "two", obj[1]) -// } +// if assert.NotEmptyf(t, obj, "error message %s", "formatted") { +// assert.Equal(t, "two", obj[1]) +// } func NotEmptyf(t TestingT, object interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1370,7 +1466,7 @@ func NotEmptyf(t TestingT, object interface{}, msg string, args ...interface{}) // NotEqual asserts that the specified values are NOT equal. // -// assert.NotEqual(t, obj1, obj2) +// assert.NotEqual(t, obj1, obj2) // // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). @@ -1386,7 +1482,7 @@ func NotEqual(t TestingT, expected interface{}, actual interface{}, msgAndArgs . // NotEqualValues asserts that two objects are not equal even when converted to the same type // -// assert.NotEqualValues(t, obj1, obj2) +// assert.NotEqualValues(t, obj1, obj2) func NotEqualValues(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1399,7 +1495,7 @@ func NotEqualValues(t TestingT, expected interface{}, actual interface{}, msgAnd // NotEqualValuesf asserts that two objects are not equal even when converted to the same type // -// assert.NotEqualValuesf(t, obj1, obj2, "error message %s", "formatted") +// assert.NotEqualValuesf(t, obj1, obj2, "error message %s", "formatted") func NotEqualValuesf(t TestingT, expected interface{}, actual interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1412,7 +1508,7 @@ func NotEqualValuesf(t TestingT, expected interface{}, actual interface{}, msg s // NotEqualf asserts that the specified values are NOT equal. // -// assert.NotEqualf(t, obj1, obj2, "error message %s", "formatted") +// assert.NotEqualf(t, obj1, obj2, "error message %s", "formatted") // // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). @@ -1452,7 +1548,7 @@ func NotErrorIsf(t TestingT, err error, target error, msg string, args ...interf // NotNil asserts that the specified object is not nil. // -// assert.NotNil(t, err) +// assert.NotNil(t, err) func NotNil(t TestingT, object interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1465,7 +1561,7 @@ func NotNil(t TestingT, object interface{}, msgAndArgs ...interface{}) { // NotNilf asserts that the specified object is not nil. // -// assert.NotNilf(t, err, "error message %s", "formatted") +// assert.NotNilf(t, err, "error message %s", "formatted") func NotNilf(t TestingT, object interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1478,7 +1574,7 @@ func NotNilf(t TestingT, object interface{}, msg string, args ...interface{}) { // NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic. // -// assert.NotPanics(t, func(){ RemainCalm() }) +// assert.NotPanics(t, func(){ RemainCalm() }) func NotPanics(t TestingT, f assert.PanicTestFunc, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1491,7 +1587,7 @@ func NotPanics(t TestingT, f assert.PanicTestFunc, msgAndArgs ...interface{}) { // NotPanicsf asserts that the code inside the specified PanicTestFunc does NOT panic. // -// assert.NotPanicsf(t, func(){ RemainCalm() }, "error message %s", "formatted") +// assert.NotPanicsf(t, func(){ RemainCalm() }, "error message %s", "formatted") func NotPanicsf(t TestingT, f assert.PanicTestFunc, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1504,8 +1600,8 @@ func NotPanicsf(t TestingT, f assert.PanicTestFunc, msg string, args ...interfac // NotRegexp asserts that a specified regexp does not match a string. // -// assert.NotRegexp(t, regexp.MustCompile("starts"), "it's starting") -// assert.NotRegexp(t, "^start", "it's not starting") +// assert.NotRegexp(t, regexp.MustCompile("starts"), "it's starting") +// assert.NotRegexp(t, "^start", "it's not starting") func NotRegexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1518,8 +1614,8 @@ func NotRegexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interf // NotRegexpf asserts that a specified regexp does not match a string. // -// assert.NotRegexpf(t, regexp.MustCompile("starts"), "it's starting", "error message %s", "formatted") -// assert.NotRegexpf(t, "^start", "it's not starting", "error message %s", "formatted") +// assert.NotRegexpf(t, regexp.MustCompile("starts"), "it's starting", "error message %s", "formatted") +// assert.NotRegexpf(t, "^start", "it's not starting", "error message %s", "formatted") func NotRegexpf(t TestingT, rx interface{}, str interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1532,7 +1628,7 @@ func NotRegexpf(t TestingT, rx interface{}, str interface{}, msg string, args .. // NotSame asserts that two pointers do not reference the same object. // -// assert.NotSame(t, ptr1, ptr2) +// assert.NotSame(t, ptr1, ptr2) // // Both arguments must be pointer variables. Pointer variable sameness is // determined based on the equality of both type and value. @@ -1548,7 +1644,7 @@ func NotSame(t TestingT, expected interface{}, actual interface{}, msgAndArgs .. // NotSamef asserts that two pointers do not reference the same object. // -// assert.NotSamef(t, ptr1, ptr2, "error message %s", "formatted") +// assert.NotSamef(t, ptr1, ptr2, "error message %s", "formatted") // // Both arguments must be pointer variables. Pointer variable sameness is // determined based on the equality of both type and value. @@ -1565,7 +1661,7 @@ func NotSamef(t TestingT, expected interface{}, actual interface{}, msg string, // NotSubset asserts that the specified list(array, slice...) contains not all // elements given in the specified subset(array, slice...). // -// assert.NotSubset(t, [1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]") +// assert.NotSubset(t, [1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]") func NotSubset(t TestingT, list interface{}, subset interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1579,7 +1675,7 @@ func NotSubset(t TestingT, list interface{}, subset interface{}, msgAndArgs ...i // NotSubsetf asserts that the specified list(array, slice...) contains not all // elements given in the specified subset(array, slice...). // -// assert.NotSubsetf(t, [1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]", "error message %s", "formatted") +// assert.NotSubsetf(t, [1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]", "error message %s", "formatted") func NotSubsetf(t TestingT, list interface{}, subset interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1614,7 +1710,7 @@ func NotZerof(t TestingT, i interface{}, msg string, args ...interface{}) { // Panics asserts that the code inside the specified PanicTestFunc panics. // -// assert.Panics(t, func(){ GoCrazy() }) +// assert.Panics(t, func(){ GoCrazy() }) func Panics(t TestingT, f assert.PanicTestFunc, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1629,7 +1725,7 @@ func Panics(t TestingT, f assert.PanicTestFunc, msgAndArgs ...interface{}) { // panics, and that the recovered panic value is an error that satisfies the // EqualError comparison. // -// assert.PanicsWithError(t, "crazy error", func(){ GoCrazy() }) +// assert.PanicsWithError(t, "crazy error", func(){ GoCrazy() }) func PanicsWithError(t TestingT, errString string, f assert.PanicTestFunc, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1644,7 +1740,7 @@ func PanicsWithError(t TestingT, errString string, f assert.PanicTestFunc, msgAn // panics, and that the recovered panic value is an error that satisfies the // EqualError comparison. // -// assert.PanicsWithErrorf(t, "crazy error", func(){ GoCrazy() }, "error message %s", "formatted") +// assert.PanicsWithErrorf(t, "crazy error", func(){ GoCrazy() }, "error message %s", "formatted") func PanicsWithErrorf(t TestingT, errString string, f assert.PanicTestFunc, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1658,7 +1754,7 @@ func PanicsWithErrorf(t TestingT, errString string, f assert.PanicTestFunc, msg // PanicsWithValue asserts that the code inside the specified PanicTestFunc panics, and that // the recovered panic value equals the expected panic value. // -// assert.PanicsWithValue(t, "crazy error", func(){ GoCrazy() }) +// assert.PanicsWithValue(t, "crazy error", func(){ GoCrazy() }) func PanicsWithValue(t TestingT, expected interface{}, f assert.PanicTestFunc, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1672,7 +1768,7 @@ func PanicsWithValue(t TestingT, expected interface{}, f assert.PanicTestFunc, m // PanicsWithValuef asserts that the code inside the specified PanicTestFunc panics, and that // the recovered panic value equals the expected panic value. // -// assert.PanicsWithValuef(t, "crazy error", func(){ GoCrazy() }, "error message %s", "formatted") +// assert.PanicsWithValuef(t, "crazy error", func(){ GoCrazy() }, "error message %s", "formatted") func PanicsWithValuef(t TestingT, expected interface{}, f assert.PanicTestFunc, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1685,7 +1781,7 @@ func PanicsWithValuef(t TestingT, expected interface{}, f assert.PanicTestFunc, // Panicsf asserts that the code inside the specified PanicTestFunc panics. // -// assert.Panicsf(t, func(){ GoCrazy() }, "error message %s", "formatted") +// assert.Panicsf(t, func(){ GoCrazy() }, "error message %s", "formatted") func Panicsf(t TestingT, f assert.PanicTestFunc, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1698,8 +1794,8 @@ func Panicsf(t TestingT, f assert.PanicTestFunc, msg string, args ...interface{} // Positive asserts that the specified element is positive // -// assert.Positive(t, 1) -// assert.Positive(t, 1.23) +// assert.Positive(t, 1) +// assert.Positive(t, 1.23) func Positive(t TestingT, e interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1712,8 +1808,8 @@ func Positive(t TestingT, e interface{}, msgAndArgs ...interface{}) { // Positivef asserts that the specified element is positive // -// assert.Positivef(t, 1, "error message %s", "formatted") -// assert.Positivef(t, 1.23, "error message %s", "formatted") +// assert.Positivef(t, 1, "error message %s", "formatted") +// assert.Positivef(t, 1.23, "error message %s", "formatted") func Positivef(t TestingT, e interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1726,8 +1822,8 @@ func Positivef(t TestingT, e interface{}, msg string, args ...interface{}) { // Regexp asserts that a specified regexp matches a string. // -// assert.Regexp(t, regexp.MustCompile("start"), "it's starting") -// assert.Regexp(t, "start...$", "it's not starting") +// assert.Regexp(t, regexp.MustCompile("start"), "it's starting") +// assert.Regexp(t, "start...$", "it's not starting") func Regexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1740,8 +1836,8 @@ func Regexp(t TestingT, rx interface{}, str interface{}, msgAndArgs ...interface // Regexpf asserts that a specified regexp matches a string. // -// assert.Regexpf(t, regexp.MustCompile("start"), "it's starting", "error message %s", "formatted") -// assert.Regexpf(t, "start...$", "it's not starting", "error message %s", "formatted") +// assert.Regexpf(t, regexp.MustCompile("start"), "it's starting", "error message %s", "formatted") +// assert.Regexpf(t, "start...$", "it's not starting", "error message %s", "formatted") func Regexpf(t TestingT, rx interface{}, str interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1754,7 +1850,7 @@ func Regexpf(t TestingT, rx interface{}, str interface{}, msg string, args ...in // Same asserts that two pointers reference the same object. // -// assert.Same(t, ptr1, ptr2) +// assert.Same(t, ptr1, ptr2) // // Both arguments must be pointer variables. Pointer variable sameness is // determined based on the equality of both type and value. @@ -1770,7 +1866,7 @@ func Same(t TestingT, expected interface{}, actual interface{}, msgAndArgs ...in // Samef asserts that two pointers reference the same object. // -// assert.Samef(t, ptr1, ptr2, "error message %s", "formatted") +// assert.Samef(t, ptr1, ptr2, "error message %s", "formatted") // // Both arguments must be pointer variables. Pointer variable sameness is // determined based on the equality of both type and value. @@ -1787,7 +1883,7 @@ func Samef(t TestingT, expected interface{}, actual interface{}, msg string, arg // Subset asserts that the specified list(array, slice...) contains all // elements given in the specified subset(array, slice...). // -// assert.Subset(t, [1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]") +// assert.Subset(t, [1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]") func Subset(t TestingT, list interface{}, subset interface{}, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1801,7 +1897,7 @@ func Subset(t TestingT, list interface{}, subset interface{}, msgAndArgs ...inte // Subsetf asserts that the specified list(array, slice...) contains all // elements given in the specified subset(array, slice...). // -// assert.Subsetf(t, [1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]", "error message %s", "formatted") +// assert.Subsetf(t, [1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]", "error message %s", "formatted") func Subsetf(t TestingT, list interface{}, subset interface{}, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1814,7 +1910,7 @@ func Subsetf(t TestingT, list interface{}, subset interface{}, msg string, args // True asserts that the specified value is true. // -// assert.True(t, myBool) +// assert.True(t, myBool) func True(t TestingT, value bool, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1827,7 +1923,7 @@ func True(t TestingT, value bool, msgAndArgs ...interface{}) { // Truef asserts that the specified value is true. // -// assert.Truef(t, myBool, "error message %s", "formatted") +// assert.Truef(t, myBool, "error message %s", "formatted") func Truef(t TestingT, value bool, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1840,7 +1936,7 @@ func Truef(t TestingT, value bool, msg string, args ...interface{}) { // WithinDuration asserts that the two times are within duration delta of each other. // -// assert.WithinDuration(t, time.Now(), time.Now(), 10*time.Second) +// assert.WithinDuration(t, time.Now(), time.Now(), 10*time.Second) func WithinDuration(t TestingT, expected time.Time, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1853,7 +1949,7 @@ func WithinDuration(t TestingT, expected time.Time, actual time.Time, delta time // WithinDurationf asserts that the two times are within duration delta of each other. // -// assert.WithinDurationf(t, time.Now(), time.Now(), 10*time.Second, "error message %s", "formatted") +// assert.WithinDurationf(t, time.Now(), time.Now(), 10*time.Second, "error message %s", "formatted") func WithinDurationf(t TestingT, expected time.Time, actual time.Time, delta time.Duration, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1866,7 +1962,7 @@ func WithinDurationf(t TestingT, expected time.Time, actual time.Time, delta tim // WithinRange asserts that a time is within a time range (inclusive). // -// assert.WithinRange(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second)) +// assert.WithinRange(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second)) func WithinRange(t TestingT, actual time.Time, start time.Time, end time.Time, msgAndArgs ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() @@ -1879,7 +1975,7 @@ func WithinRange(t TestingT, actual time.Time, start time.Time, end time.Time, m // WithinRangef asserts that a time is within a time range (inclusive). // -// assert.WithinRangef(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second), "error message %s", "formatted") +// assert.WithinRangef(t, time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second), "error message %s", "formatted") func WithinRangef(t TestingT, actual time.Time, start time.Time, end time.Time, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() diff --git a/cluster-autoscaler/vendor/github.com/stretchr/testify/require/require_forward.go b/cluster-autoscaler/vendor/github.com/stretchr/testify/require/require_forward.go index 960bf6f2cabf..3b5b09330a43 100644 --- a/cluster-autoscaler/vendor/github.com/stretchr/testify/require/require_forward.go +++ b/cluster-autoscaler/vendor/github.com/stretchr/testify/require/require_forward.go @@ -31,9 +31,9 @@ func (a *Assertions) Conditionf(comp assert.Comparison, msg string, args ...inte // Contains asserts that the specified string, list(array, slice...) or map contains the // specified substring or element. // -// a.Contains("Hello World", "World") -// a.Contains(["Hello", "World"], "World") -// a.Contains({"Hello": "World"}, "Hello") +// a.Contains("Hello World", "World") +// a.Contains(["Hello", "World"], "World") +// a.Contains({"Hello": "World"}, "Hello") func (a *Assertions) Contains(s interface{}, contains interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -44,9 +44,9 @@ func (a *Assertions) Contains(s interface{}, contains interface{}, msgAndArgs .. // Containsf asserts that the specified string, list(array, slice...) or map contains the // specified substring or element. // -// a.Containsf("Hello World", "World", "error message %s", "formatted") -// a.Containsf(["Hello", "World"], "World", "error message %s", "formatted") -// a.Containsf({"Hello": "World"}, "Hello", "error message %s", "formatted") +// a.Containsf("Hello World", "World", "error message %s", "formatted") +// a.Containsf(["Hello", "World"], "World", "error message %s", "formatted") +// a.Containsf({"Hello": "World"}, "Hello", "error message %s", "formatted") func (a *Assertions) Containsf(s interface{}, contains interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -99,7 +99,7 @@ func (a *Assertions) ElementsMatchf(listA interface{}, listB interface{}, msg st // Empty asserts that the specified object is empty. I.e. nil, "", false, 0 or either // a slice or a channel with len == 0. // -// a.Empty(obj) +// a.Empty(obj) func (a *Assertions) Empty(object interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -110,7 +110,7 @@ func (a *Assertions) Empty(object interface{}, msgAndArgs ...interface{}) { // Emptyf asserts that the specified object is empty. I.e. nil, "", false, 0 or either // a slice or a channel with len == 0. // -// a.Emptyf(obj, "error message %s", "formatted") +// a.Emptyf(obj, "error message %s", "formatted") func (a *Assertions) Emptyf(object interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -120,7 +120,7 @@ func (a *Assertions) Emptyf(object interface{}, msg string, args ...interface{}) // Equal asserts that two objects are equal. // -// a.Equal(123, 123) +// a.Equal(123, 123) // // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). Function equality @@ -135,8 +135,8 @@ func (a *Assertions) Equal(expected interface{}, actual interface{}, msgAndArgs // EqualError asserts that a function returned an error (i.e. not `nil`) // and that it is equal to the provided error. // -// actualObj, err := SomeFunction() -// a.EqualError(err, expectedErrorString) +// actualObj, err := SomeFunction() +// a.EqualError(err, expectedErrorString) func (a *Assertions) EqualError(theError error, errString string, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -147,8 +147,8 @@ func (a *Assertions) EqualError(theError error, errString string, msgAndArgs ... // EqualErrorf asserts that a function returned an error (i.e. not `nil`) // and that it is equal to the provided error. // -// actualObj, err := SomeFunction() -// a.EqualErrorf(err, expectedErrorString, "error message %s", "formatted") +// actualObj, err := SomeFunction() +// a.EqualErrorf(err, expectedErrorString, "error message %s", "formatted") func (a *Assertions) EqualErrorf(theError error, errString string, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -156,10 +156,44 @@ func (a *Assertions) EqualErrorf(theError error, errString string, msg string, a EqualErrorf(a.t, theError, errString, msg, args...) } +// EqualExportedValues asserts that the types of two objects are equal and their public +// fields are also equal. This is useful for comparing structs that have private fields +// that could potentially differ. +// +// type S struct { +// Exported int +// notExported int +// } +// a.EqualExportedValues(S{1, 2}, S{1, 3}) => true +// a.EqualExportedValues(S{1, 2}, S{2, 3}) => false +func (a *Assertions) EqualExportedValues(expected interface{}, actual interface{}, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + EqualExportedValues(a.t, expected, actual, msgAndArgs...) +} + +// EqualExportedValuesf asserts that the types of two objects are equal and their public +// fields are also equal. This is useful for comparing structs that have private fields +// that could potentially differ. +// +// type S struct { +// Exported int +// notExported int +// } +// a.EqualExportedValuesf(S{1, 2}, S{1, 3}, "error message %s", "formatted") => true +// a.EqualExportedValuesf(S{1, 2}, S{2, 3}, "error message %s", "formatted") => false +func (a *Assertions) EqualExportedValuesf(expected interface{}, actual interface{}, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + EqualExportedValuesf(a.t, expected, actual, msg, args...) +} + // EqualValues asserts that two objects are equal or convertable to the same types // and equal. // -// a.EqualValues(uint32(123), int32(123)) +// a.EqualValues(uint32(123), int32(123)) func (a *Assertions) EqualValues(expected interface{}, actual interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -170,7 +204,7 @@ func (a *Assertions) EqualValues(expected interface{}, actual interface{}, msgAn // EqualValuesf asserts that two objects are equal or convertable to the same types // and equal. // -// a.EqualValuesf(uint32(123), int32(123), "error message %s", "formatted") +// a.EqualValuesf(uint32(123), int32(123), "error message %s", "formatted") func (a *Assertions) EqualValuesf(expected interface{}, actual interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -180,7 +214,7 @@ func (a *Assertions) EqualValuesf(expected interface{}, actual interface{}, msg // Equalf asserts that two objects are equal. // -// a.Equalf(123, 123, "error message %s", "formatted") +// a.Equalf(123, 123, "error message %s", "formatted") // // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). Function equality @@ -194,10 +228,10 @@ func (a *Assertions) Equalf(expected interface{}, actual interface{}, msg string // Error asserts that a function returned an error (i.e. not `nil`). // -// actualObj, err := SomeFunction() -// if a.Error(err) { -// assert.Equal(t, expectedError, err) -// } +// actualObj, err := SomeFunction() +// if a.Error(err) { +// assert.Equal(t, expectedError, err) +// } func (a *Assertions) Error(err error, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -226,8 +260,8 @@ func (a *Assertions) ErrorAsf(err error, target interface{}, msg string, args .. // ErrorContains asserts that a function returned an error (i.e. not `nil`) // and that the error contains the specified substring. // -// actualObj, err := SomeFunction() -// a.ErrorContains(err, expectedErrorSubString) +// actualObj, err := SomeFunction() +// a.ErrorContains(err, expectedErrorSubString) func (a *Assertions) ErrorContains(theError error, contains string, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -238,8 +272,8 @@ func (a *Assertions) ErrorContains(theError error, contains string, msgAndArgs . // ErrorContainsf asserts that a function returned an error (i.e. not `nil`) // and that the error contains the specified substring. // -// actualObj, err := SomeFunction() -// a.ErrorContainsf(err, expectedErrorSubString, "error message %s", "formatted") +// actualObj, err := SomeFunction() +// a.ErrorContainsf(err, expectedErrorSubString, "error message %s", "formatted") func (a *Assertions) ErrorContainsf(theError error, contains string, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -267,10 +301,10 @@ func (a *Assertions) ErrorIsf(err error, target error, msg string, args ...inter // Errorf asserts that a function returned an error (i.e. not `nil`). // -// actualObj, err := SomeFunction() -// if a.Errorf(err, "error message %s", "formatted") { -// assert.Equal(t, expectedErrorf, err) -// } +// actualObj, err := SomeFunction() +// if a.Errorf(err, "error message %s", "formatted") { +// assert.Equal(t, expectedErrorf, err) +// } func (a *Assertions) Errorf(err error, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -281,7 +315,7 @@ func (a *Assertions) Errorf(err error, msg string, args ...interface{}) { // Eventually asserts that given condition will be met in waitFor time, // periodically checking target function each tick. // -// a.Eventually(func() bool { return true; }, time.Second, 10*time.Millisecond) +// a.Eventually(func() bool { return true; }, time.Second, 10*time.Millisecond) func (a *Assertions) Eventually(condition func() bool, waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -289,10 +323,60 @@ func (a *Assertions) Eventually(condition func() bool, waitFor time.Duration, ti Eventually(a.t, condition, waitFor, tick, msgAndArgs...) } +// EventuallyWithT asserts that given condition will be met in waitFor time, +// periodically checking target function each tick. In contrast to Eventually, +// it supplies a CollectT to the condition function, so that the condition +// function can use the CollectT to call other assertions. +// The condition is considered "met" if no errors are raised in a tick. +// The supplied CollectT collects all errors from one tick (if there are any). +// If the condition is not met before waitFor, the collected errors of +// the last tick are copied to t. +// +// externalValue := false +// go func() { +// time.Sleep(8*time.Second) +// externalValue = true +// }() +// a.EventuallyWithT(func(c *assert.CollectT) { +// // add assertions as needed; any assertion failure will fail the current tick +// assert.True(c, externalValue, "expected 'externalValue' to be true") +// }, 1*time.Second, 10*time.Second, "external state has not changed to 'true'; still false") +func (a *Assertions) EventuallyWithT(condition func(collect *assert.CollectT), waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + EventuallyWithT(a.t, condition, waitFor, tick, msgAndArgs...) +} + +// EventuallyWithTf asserts that given condition will be met in waitFor time, +// periodically checking target function each tick. In contrast to Eventually, +// it supplies a CollectT to the condition function, so that the condition +// function can use the CollectT to call other assertions. +// The condition is considered "met" if no errors are raised in a tick. +// The supplied CollectT collects all errors from one tick (if there are any). +// If the condition is not met before waitFor, the collected errors of +// the last tick are copied to t. +// +// externalValue := false +// go func() { +// time.Sleep(8*time.Second) +// externalValue = true +// }() +// a.EventuallyWithTf(func(c *assert.CollectT, "error message %s", "formatted") { +// // add assertions as needed; any assertion failure will fail the current tick +// assert.True(c, externalValue, "expected 'externalValue' to be true") +// }, 1*time.Second, 10*time.Second, "external state has not changed to 'true'; still false") +func (a *Assertions) EventuallyWithTf(condition func(collect *assert.CollectT), waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) { + if h, ok := a.t.(tHelper); ok { + h.Helper() + } + EventuallyWithTf(a.t, condition, waitFor, tick, msg, args...) +} + // Eventuallyf asserts that given condition will be met in waitFor time, // periodically checking target function each tick. // -// a.Eventuallyf(func() bool { return true; }, time.Second, 10*time.Millisecond, "error message %s", "formatted") +// a.Eventuallyf(func() bool { return true; }, time.Second, 10*time.Millisecond, "error message %s", "formatted") func (a *Assertions) Eventuallyf(condition func() bool, waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -302,7 +386,7 @@ func (a *Assertions) Eventuallyf(condition func() bool, waitFor time.Duration, t // Exactly asserts that two objects are equal in value and type. // -// a.Exactly(int32(123), int64(123)) +// a.Exactly(int32(123), int64(123)) func (a *Assertions) Exactly(expected interface{}, actual interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -312,7 +396,7 @@ func (a *Assertions) Exactly(expected interface{}, actual interface{}, msgAndArg // Exactlyf asserts that two objects are equal in value and type. // -// a.Exactlyf(int32(123), int64(123), "error message %s", "formatted") +// a.Exactlyf(int32(123), int64(123), "error message %s", "formatted") func (a *Assertions) Exactlyf(expected interface{}, actual interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -354,7 +438,7 @@ func (a *Assertions) Failf(failureMessage string, msg string, args ...interface{ // False asserts that the specified value is false. // -// a.False(myBool) +// a.False(myBool) func (a *Assertions) False(value bool, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -364,7 +448,7 @@ func (a *Assertions) False(value bool, msgAndArgs ...interface{}) { // Falsef asserts that the specified value is false. // -// a.Falsef(myBool, "error message %s", "formatted") +// a.Falsef(myBool, "error message %s", "formatted") func (a *Assertions) Falsef(value bool, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -392,9 +476,9 @@ func (a *Assertions) FileExistsf(path string, msg string, args ...interface{}) { // Greater asserts that the first element is greater than the second // -// a.Greater(2, 1) -// a.Greater(float64(2), float64(1)) -// a.Greater("b", "a") +// a.Greater(2, 1) +// a.Greater(float64(2), float64(1)) +// a.Greater("b", "a") func (a *Assertions) Greater(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -404,10 +488,10 @@ func (a *Assertions) Greater(e1 interface{}, e2 interface{}, msgAndArgs ...inter // GreaterOrEqual asserts that the first element is greater than or equal to the second // -// a.GreaterOrEqual(2, 1) -// a.GreaterOrEqual(2, 2) -// a.GreaterOrEqual("b", "a") -// a.GreaterOrEqual("b", "b") +// a.GreaterOrEqual(2, 1) +// a.GreaterOrEqual(2, 2) +// a.GreaterOrEqual("b", "a") +// a.GreaterOrEqual("b", "b") func (a *Assertions) GreaterOrEqual(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -417,10 +501,10 @@ func (a *Assertions) GreaterOrEqual(e1 interface{}, e2 interface{}, msgAndArgs . // GreaterOrEqualf asserts that the first element is greater than or equal to the second // -// a.GreaterOrEqualf(2, 1, "error message %s", "formatted") -// a.GreaterOrEqualf(2, 2, "error message %s", "formatted") -// a.GreaterOrEqualf("b", "a", "error message %s", "formatted") -// a.GreaterOrEqualf("b", "b", "error message %s", "formatted") +// a.GreaterOrEqualf(2, 1, "error message %s", "formatted") +// a.GreaterOrEqualf(2, 2, "error message %s", "formatted") +// a.GreaterOrEqualf("b", "a", "error message %s", "formatted") +// a.GreaterOrEqualf("b", "b", "error message %s", "formatted") func (a *Assertions) GreaterOrEqualf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -430,9 +514,9 @@ func (a *Assertions) GreaterOrEqualf(e1 interface{}, e2 interface{}, msg string, // Greaterf asserts that the first element is greater than the second // -// a.Greaterf(2, 1, "error message %s", "formatted") -// a.Greaterf(float64(2), float64(1), "error message %s", "formatted") -// a.Greaterf("b", "a", "error message %s", "formatted") +// a.Greaterf(2, 1, "error message %s", "formatted") +// a.Greaterf(float64(2), float64(1), "error message %s", "formatted") +// a.Greaterf("b", "a", "error message %s", "formatted") func (a *Assertions) Greaterf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -443,7 +527,7 @@ func (a *Assertions) Greaterf(e1 interface{}, e2 interface{}, msg string, args . // HTTPBodyContains asserts that a specified handler returns a // body that contains a string. // -// a.HTTPBodyContains(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") +// a.HTTPBodyContains(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPBodyContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) { @@ -456,7 +540,7 @@ func (a *Assertions) HTTPBodyContains(handler http.HandlerFunc, method string, u // HTTPBodyContainsf asserts that a specified handler returns a // body that contains a string. // -// a.HTTPBodyContainsf(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") +// a.HTTPBodyContainsf(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPBodyContainsf(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) { @@ -469,7 +553,7 @@ func (a *Assertions) HTTPBodyContainsf(handler http.HandlerFunc, method string, // HTTPBodyNotContains asserts that a specified handler returns a // body that does not contain a string. // -// a.HTTPBodyNotContains(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") +// a.HTTPBodyNotContains(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky") // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPBodyNotContains(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msgAndArgs ...interface{}) { @@ -482,7 +566,7 @@ func (a *Assertions) HTTPBodyNotContains(handler http.HandlerFunc, method string // HTTPBodyNotContainsf asserts that a specified handler returns a // body that does not contain a string. // -// a.HTTPBodyNotContainsf(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") +// a.HTTPBodyNotContainsf(myHandler, "GET", "www.google.com", nil, "I'm Feeling Lucky", "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPBodyNotContainsf(handler http.HandlerFunc, method string, url string, values url.Values, str interface{}, msg string, args ...interface{}) { @@ -494,7 +578,7 @@ func (a *Assertions) HTTPBodyNotContainsf(handler http.HandlerFunc, method strin // HTTPError asserts that a specified handler returns an error status code. // -// a.HTTPError(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} +// a.HTTPError(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPError(handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) { @@ -506,7 +590,7 @@ func (a *Assertions) HTTPError(handler http.HandlerFunc, method string, url stri // HTTPErrorf asserts that a specified handler returns an error status code. // -// a.HTTPErrorf(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} +// a.HTTPErrorf(myHandler, "POST", "/a/b/c", url.Values{"a": []string{"b", "c"}} // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPErrorf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) { @@ -518,7 +602,7 @@ func (a *Assertions) HTTPErrorf(handler http.HandlerFunc, method string, url str // HTTPRedirect asserts that a specified handler returns a redirect status code. // -// a.HTTPRedirect(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} +// a.HTTPRedirect(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPRedirect(handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) { @@ -530,7 +614,7 @@ func (a *Assertions) HTTPRedirect(handler http.HandlerFunc, method string, url s // HTTPRedirectf asserts that a specified handler returns a redirect status code. // -// a.HTTPRedirectf(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} +// a.HTTPRedirectf(myHandler, "GET", "/a/b/c", url.Values{"a": []string{"b", "c"}} // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPRedirectf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) { @@ -542,7 +626,7 @@ func (a *Assertions) HTTPRedirectf(handler http.HandlerFunc, method string, url // HTTPStatusCode asserts that a specified handler returns a specified status code. // -// a.HTTPStatusCode(myHandler, "GET", "/notImplemented", nil, 501) +// a.HTTPStatusCode(myHandler, "GET", "/notImplemented", nil, 501) // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPStatusCode(handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msgAndArgs ...interface{}) { @@ -554,7 +638,7 @@ func (a *Assertions) HTTPStatusCode(handler http.HandlerFunc, method string, url // HTTPStatusCodef asserts that a specified handler returns a specified status code. // -// a.HTTPStatusCodef(myHandler, "GET", "/notImplemented", nil, 501, "error message %s", "formatted") +// a.HTTPStatusCodef(myHandler, "GET", "/notImplemented", nil, 501, "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPStatusCodef(handler http.HandlerFunc, method string, url string, values url.Values, statuscode int, msg string, args ...interface{}) { @@ -566,7 +650,7 @@ func (a *Assertions) HTTPStatusCodef(handler http.HandlerFunc, method string, ur // HTTPSuccess asserts that a specified handler returns a success status code. // -// a.HTTPSuccess(myHandler, "POST", "http://www.google.com", nil) +// a.HTTPSuccess(myHandler, "POST", "http://www.google.com", nil) // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPSuccess(handler http.HandlerFunc, method string, url string, values url.Values, msgAndArgs ...interface{}) { @@ -578,7 +662,7 @@ func (a *Assertions) HTTPSuccess(handler http.HandlerFunc, method string, url st // HTTPSuccessf asserts that a specified handler returns a success status code. // -// a.HTTPSuccessf(myHandler, "POST", "http://www.google.com", nil, "error message %s", "formatted") +// a.HTTPSuccessf(myHandler, "POST", "http://www.google.com", nil, "error message %s", "formatted") // // Returns whether the assertion was successful (true) or not (false). func (a *Assertions) HTTPSuccessf(handler http.HandlerFunc, method string, url string, values url.Values, msg string, args ...interface{}) { @@ -590,7 +674,7 @@ func (a *Assertions) HTTPSuccessf(handler http.HandlerFunc, method string, url s // Implements asserts that an object is implemented by the specified interface. // -// a.Implements((*MyInterface)(nil), new(MyObject)) +// a.Implements((*MyInterface)(nil), new(MyObject)) func (a *Assertions) Implements(interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -600,7 +684,7 @@ func (a *Assertions) Implements(interfaceObject interface{}, object interface{}, // Implementsf asserts that an object is implemented by the specified interface. // -// a.Implementsf((*MyInterface)(nil), new(MyObject), "error message %s", "formatted") +// a.Implementsf((*MyInterface)(nil), new(MyObject), "error message %s", "formatted") func (a *Assertions) Implementsf(interfaceObject interface{}, object interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -610,7 +694,7 @@ func (a *Assertions) Implementsf(interfaceObject interface{}, object interface{} // InDelta asserts that the two numerals are within delta of each other. // -// a.InDelta(math.Pi, 22/7.0, 0.01) +// a.InDelta(math.Pi, 22/7.0, 0.01) func (a *Assertions) InDelta(expected interface{}, actual interface{}, delta float64, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -652,7 +736,7 @@ func (a *Assertions) InDeltaSlicef(expected interface{}, actual interface{}, del // InDeltaf asserts that the two numerals are within delta of each other. // -// a.InDeltaf(math.Pi, 22/7.0, 0.01, "error message %s", "formatted") +// a.InDeltaf(math.Pi, 22/7.0, 0.01, "error message %s", "formatted") func (a *Assertions) InDeltaf(expected interface{}, actual interface{}, delta float64, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -694,9 +778,9 @@ func (a *Assertions) InEpsilonf(expected interface{}, actual interface{}, epsilo // IsDecreasing asserts that the collection is decreasing // -// a.IsDecreasing([]int{2, 1, 0}) -// a.IsDecreasing([]float{2, 1}) -// a.IsDecreasing([]string{"b", "a"}) +// a.IsDecreasing([]int{2, 1, 0}) +// a.IsDecreasing([]float{2, 1}) +// a.IsDecreasing([]string{"b", "a"}) func (a *Assertions) IsDecreasing(object interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -706,9 +790,9 @@ func (a *Assertions) IsDecreasing(object interface{}, msgAndArgs ...interface{}) // IsDecreasingf asserts that the collection is decreasing // -// a.IsDecreasingf([]int{2, 1, 0}, "error message %s", "formatted") -// a.IsDecreasingf([]float{2, 1}, "error message %s", "formatted") -// a.IsDecreasingf([]string{"b", "a"}, "error message %s", "formatted") +// a.IsDecreasingf([]int{2, 1, 0}, "error message %s", "formatted") +// a.IsDecreasingf([]float{2, 1}, "error message %s", "formatted") +// a.IsDecreasingf([]string{"b", "a"}, "error message %s", "formatted") func (a *Assertions) IsDecreasingf(object interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -718,9 +802,9 @@ func (a *Assertions) IsDecreasingf(object interface{}, msg string, args ...inter // IsIncreasing asserts that the collection is increasing // -// a.IsIncreasing([]int{1, 2, 3}) -// a.IsIncreasing([]float{1, 2}) -// a.IsIncreasing([]string{"a", "b"}) +// a.IsIncreasing([]int{1, 2, 3}) +// a.IsIncreasing([]float{1, 2}) +// a.IsIncreasing([]string{"a", "b"}) func (a *Assertions) IsIncreasing(object interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -730,9 +814,9 @@ func (a *Assertions) IsIncreasing(object interface{}, msgAndArgs ...interface{}) // IsIncreasingf asserts that the collection is increasing // -// a.IsIncreasingf([]int{1, 2, 3}, "error message %s", "formatted") -// a.IsIncreasingf([]float{1, 2}, "error message %s", "formatted") -// a.IsIncreasingf([]string{"a", "b"}, "error message %s", "formatted") +// a.IsIncreasingf([]int{1, 2, 3}, "error message %s", "formatted") +// a.IsIncreasingf([]float{1, 2}, "error message %s", "formatted") +// a.IsIncreasingf([]string{"a", "b"}, "error message %s", "formatted") func (a *Assertions) IsIncreasingf(object interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -742,9 +826,9 @@ func (a *Assertions) IsIncreasingf(object interface{}, msg string, args ...inter // IsNonDecreasing asserts that the collection is not decreasing // -// a.IsNonDecreasing([]int{1, 1, 2}) -// a.IsNonDecreasing([]float{1, 2}) -// a.IsNonDecreasing([]string{"a", "b"}) +// a.IsNonDecreasing([]int{1, 1, 2}) +// a.IsNonDecreasing([]float{1, 2}) +// a.IsNonDecreasing([]string{"a", "b"}) func (a *Assertions) IsNonDecreasing(object interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -754,9 +838,9 @@ func (a *Assertions) IsNonDecreasing(object interface{}, msgAndArgs ...interface // IsNonDecreasingf asserts that the collection is not decreasing // -// a.IsNonDecreasingf([]int{1, 1, 2}, "error message %s", "formatted") -// a.IsNonDecreasingf([]float{1, 2}, "error message %s", "formatted") -// a.IsNonDecreasingf([]string{"a", "b"}, "error message %s", "formatted") +// a.IsNonDecreasingf([]int{1, 1, 2}, "error message %s", "formatted") +// a.IsNonDecreasingf([]float{1, 2}, "error message %s", "formatted") +// a.IsNonDecreasingf([]string{"a", "b"}, "error message %s", "formatted") func (a *Assertions) IsNonDecreasingf(object interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -766,9 +850,9 @@ func (a *Assertions) IsNonDecreasingf(object interface{}, msg string, args ...in // IsNonIncreasing asserts that the collection is not increasing // -// a.IsNonIncreasing([]int{2, 1, 1}) -// a.IsNonIncreasing([]float{2, 1}) -// a.IsNonIncreasing([]string{"b", "a"}) +// a.IsNonIncreasing([]int{2, 1, 1}) +// a.IsNonIncreasing([]float{2, 1}) +// a.IsNonIncreasing([]string{"b", "a"}) func (a *Assertions) IsNonIncreasing(object interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -778,9 +862,9 @@ func (a *Assertions) IsNonIncreasing(object interface{}, msgAndArgs ...interface // IsNonIncreasingf asserts that the collection is not increasing // -// a.IsNonIncreasingf([]int{2, 1, 1}, "error message %s", "formatted") -// a.IsNonIncreasingf([]float{2, 1}, "error message %s", "formatted") -// a.IsNonIncreasingf([]string{"b", "a"}, "error message %s", "formatted") +// a.IsNonIncreasingf([]int{2, 1, 1}, "error message %s", "formatted") +// a.IsNonIncreasingf([]float{2, 1}, "error message %s", "formatted") +// a.IsNonIncreasingf([]string{"b", "a"}, "error message %s", "formatted") func (a *Assertions) IsNonIncreasingf(object interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -806,7 +890,7 @@ func (a *Assertions) IsTypef(expectedType interface{}, object interface{}, msg s // JSONEq asserts that two JSON strings are equivalent. // -// a.JSONEq(`{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`) +// a.JSONEq(`{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`) func (a *Assertions) JSONEq(expected string, actual string, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -816,7 +900,7 @@ func (a *Assertions) JSONEq(expected string, actual string, msgAndArgs ...interf // JSONEqf asserts that two JSON strings are equivalent. // -// a.JSONEqf(`{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`, "error message %s", "formatted") +// a.JSONEqf(`{"hello": "world", "foo": "bar"}`, `{"foo": "bar", "hello": "world"}`, "error message %s", "formatted") func (a *Assertions) JSONEqf(expected string, actual string, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -827,7 +911,7 @@ func (a *Assertions) JSONEqf(expected string, actual string, msg string, args .. // Len asserts that the specified object has specific length. // Len also fails if the object has a type that len() not accept. // -// a.Len(mySlice, 3) +// a.Len(mySlice, 3) func (a *Assertions) Len(object interface{}, length int, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -838,7 +922,7 @@ func (a *Assertions) Len(object interface{}, length int, msgAndArgs ...interface // Lenf asserts that the specified object has specific length. // Lenf also fails if the object has a type that len() not accept. // -// a.Lenf(mySlice, 3, "error message %s", "formatted") +// a.Lenf(mySlice, 3, "error message %s", "formatted") func (a *Assertions) Lenf(object interface{}, length int, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -848,9 +932,9 @@ func (a *Assertions) Lenf(object interface{}, length int, msg string, args ...in // Less asserts that the first element is less than the second // -// a.Less(1, 2) -// a.Less(float64(1), float64(2)) -// a.Less("a", "b") +// a.Less(1, 2) +// a.Less(float64(1), float64(2)) +// a.Less("a", "b") func (a *Assertions) Less(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -860,10 +944,10 @@ func (a *Assertions) Less(e1 interface{}, e2 interface{}, msgAndArgs ...interfac // LessOrEqual asserts that the first element is less than or equal to the second // -// a.LessOrEqual(1, 2) -// a.LessOrEqual(2, 2) -// a.LessOrEqual("a", "b") -// a.LessOrEqual("b", "b") +// a.LessOrEqual(1, 2) +// a.LessOrEqual(2, 2) +// a.LessOrEqual("a", "b") +// a.LessOrEqual("b", "b") func (a *Assertions) LessOrEqual(e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -873,10 +957,10 @@ func (a *Assertions) LessOrEqual(e1 interface{}, e2 interface{}, msgAndArgs ...i // LessOrEqualf asserts that the first element is less than or equal to the second // -// a.LessOrEqualf(1, 2, "error message %s", "formatted") -// a.LessOrEqualf(2, 2, "error message %s", "formatted") -// a.LessOrEqualf("a", "b", "error message %s", "formatted") -// a.LessOrEqualf("b", "b", "error message %s", "formatted") +// a.LessOrEqualf(1, 2, "error message %s", "formatted") +// a.LessOrEqualf(2, 2, "error message %s", "formatted") +// a.LessOrEqualf("a", "b", "error message %s", "formatted") +// a.LessOrEqualf("b", "b", "error message %s", "formatted") func (a *Assertions) LessOrEqualf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -886,9 +970,9 @@ func (a *Assertions) LessOrEqualf(e1 interface{}, e2 interface{}, msg string, ar // Lessf asserts that the first element is less than the second // -// a.Lessf(1, 2, "error message %s", "formatted") -// a.Lessf(float64(1), float64(2), "error message %s", "formatted") -// a.Lessf("a", "b", "error message %s", "formatted") +// a.Lessf(1, 2, "error message %s", "formatted") +// a.Lessf(float64(1), float64(2), "error message %s", "formatted") +// a.Lessf("a", "b", "error message %s", "formatted") func (a *Assertions) Lessf(e1 interface{}, e2 interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -898,8 +982,8 @@ func (a *Assertions) Lessf(e1 interface{}, e2 interface{}, msg string, args ...i // Negative asserts that the specified element is negative // -// a.Negative(-1) -// a.Negative(-1.23) +// a.Negative(-1) +// a.Negative(-1.23) func (a *Assertions) Negative(e interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -909,8 +993,8 @@ func (a *Assertions) Negative(e interface{}, msgAndArgs ...interface{}) { // Negativef asserts that the specified element is negative // -// a.Negativef(-1, "error message %s", "formatted") -// a.Negativef(-1.23, "error message %s", "formatted") +// a.Negativef(-1, "error message %s", "formatted") +// a.Negativef(-1.23, "error message %s", "formatted") func (a *Assertions) Negativef(e interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -921,7 +1005,7 @@ func (a *Assertions) Negativef(e interface{}, msg string, args ...interface{}) { // Never asserts that the given condition doesn't satisfy in waitFor time, // periodically checking the target function each tick. // -// a.Never(func() bool { return false; }, time.Second, 10*time.Millisecond) +// a.Never(func() bool { return false; }, time.Second, 10*time.Millisecond) func (a *Assertions) Never(condition func() bool, waitFor time.Duration, tick time.Duration, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -932,7 +1016,7 @@ func (a *Assertions) Never(condition func() bool, waitFor time.Duration, tick ti // Neverf asserts that the given condition doesn't satisfy in waitFor time, // periodically checking the target function each tick. // -// a.Neverf(func() bool { return false; }, time.Second, 10*time.Millisecond, "error message %s", "formatted") +// a.Neverf(func() bool { return false; }, time.Second, 10*time.Millisecond, "error message %s", "formatted") func (a *Assertions) Neverf(condition func() bool, waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -942,7 +1026,7 @@ func (a *Assertions) Neverf(condition func() bool, waitFor time.Duration, tick t // Nil asserts that the specified object is nil. // -// a.Nil(err) +// a.Nil(err) func (a *Assertions) Nil(object interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -952,7 +1036,7 @@ func (a *Assertions) Nil(object interface{}, msgAndArgs ...interface{}) { // Nilf asserts that the specified object is nil. // -// a.Nilf(err, "error message %s", "formatted") +// a.Nilf(err, "error message %s", "formatted") func (a *Assertions) Nilf(object interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -980,10 +1064,10 @@ func (a *Assertions) NoDirExistsf(path string, msg string, args ...interface{}) // NoError asserts that a function returned no error (i.e. `nil`). // -// actualObj, err := SomeFunction() -// if a.NoError(err) { -// assert.Equal(t, expectedObj, actualObj) -// } +// actualObj, err := SomeFunction() +// if a.NoError(err) { +// assert.Equal(t, expectedObj, actualObj) +// } func (a *Assertions) NoError(err error, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -993,10 +1077,10 @@ func (a *Assertions) NoError(err error, msgAndArgs ...interface{}) { // NoErrorf asserts that a function returned no error (i.e. `nil`). // -// actualObj, err := SomeFunction() -// if a.NoErrorf(err, "error message %s", "formatted") { -// assert.Equal(t, expectedObj, actualObj) -// } +// actualObj, err := SomeFunction() +// if a.NoErrorf(err, "error message %s", "formatted") { +// assert.Equal(t, expectedObj, actualObj) +// } func (a *Assertions) NoErrorf(err error, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1025,9 +1109,9 @@ func (a *Assertions) NoFileExistsf(path string, msg string, args ...interface{}) // NotContains asserts that the specified string, list(array, slice...) or map does NOT contain the // specified substring or element. // -// a.NotContains("Hello World", "Earth") -// a.NotContains(["Hello", "World"], "Earth") -// a.NotContains({"Hello": "World"}, "Earth") +// a.NotContains("Hello World", "Earth") +// a.NotContains(["Hello", "World"], "Earth") +// a.NotContains({"Hello": "World"}, "Earth") func (a *Assertions) NotContains(s interface{}, contains interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1038,9 +1122,9 @@ func (a *Assertions) NotContains(s interface{}, contains interface{}, msgAndArgs // NotContainsf asserts that the specified string, list(array, slice...) or map does NOT contain the // specified substring or element. // -// a.NotContainsf("Hello World", "Earth", "error message %s", "formatted") -// a.NotContainsf(["Hello", "World"], "Earth", "error message %s", "formatted") -// a.NotContainsf({"Hello": "World"}, "Earth", "error message %s", "formatted") +// a.NotContainsf("Hello World", "Earth", "error message %s", "formatted") +// a.NotContainsf(["Hello", "World"], "Earth", "error message %s", "formatted") +// a.NotContainsf({"Hello": "World"}, "Earth", "error message %s", "formatted") func (a *Assertions) NotContainsf(s interface{}, contains interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1051,9 +1135,9 @@ func (a *Assertions) NotContainsf(s interface{}, contains interface{}, msg strin // NotEmpty asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either // a slice or a channel with len == 0. // -// if a.NotEmpty(obj) { -// assert.Equal(t, "two", obj[1]) -// } +// if a.NotEmpty(obj) { +// assert.Equal(t, "two", obj[1]) +// } func (a *Assertions) NotEmpty(object interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1064,9 +1148,9 @@ func (a *Assertions) NotEmpty(object interface{}, msgAndArgs ...interface{}) { // NotEmptyf asserts that the specified object is NOT empty. I.e. not nil, "", false, 0 or either // a slice or a channel with len == 0. // -// if a.NotEmptyf(obj, "error message %s", "formatted") { -// assert.Equal(t, "two", obj[1]) -// } +// if a.NotEmptyf(obj, "error message %s", "formatted") { +// assert.Equal(t, "two", obj[1]) +// } func (a *Assertions) NotEmptyf(object interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1076,7 +1160,7 @@ func (a *Assertions) NotEmptyf(object interface{}, msg string, args ...interface // NotEqual asserts that the specified values are NOT equal. // -// a.NotEqual(obj1, obj2) +// a.NotEqual(obj1, obj2) // // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). @@ -1089,7 +1173,7 @@ func (a *Assertions) NotEqual(expected interface{}, actual interface{}, msgAndAr // NotEqualValues asserts that two objects are not equal even when converted to the same type // -// a.NotEqualValues(obj1, obj2) +// a.NotEqualValues(obj1, obj2) func (a *Assertions) NotEqualValues(expected interface{}, actual interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1099,7 +1183,7 @@ func (a *Assertions) NotEqualValues(expected interface{}, actual interface{}, ms // NotEqualValuesf asserts that two objects are not equal even when converted to the same type // -// a.NotEqualValuesf(obj1, obj2, "error message %s", "formatted") +// a.NotEqualValuesf(obj1, obj2, "error message %s", "formatted") func (a *Assertions) NotEqualValuesf(expected interface{}, actual interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1109,7 +1193,7 @@ func (a *Assertions) NotEqualValuesf(expected interface{}, actual interface{}, m // NotEqualf asserts that the specified values are NOT equal. // -// a.NotEqualf(obj1, obj2, "error message %s", "formatted") +// a.NotEqualf(obj1, obj2, "error message %s", "formatted") // // Pointer variable equality is determined based on the equality of the // referenced values (as opposed to the memory addresses). @@ -1140,7 +1224,7 @@ func (a *Assertions) NotErrorIsf(err error, target error, msg string, args ...in // NotNil asserts that the specified object is not nil. // -// a.NotNil(err) +// a.NotNil(err) func (a *Assertions) NotNil(object interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1150,7 +1234,7 @@ func (a *Assertions) NotNil(object interface{}, msgAndArgs ...interface{}) { // NotNilf asserts that the specified object is not nil. // -// a.NotNilf(err, "error message %s", "formatted") +// a.NotNilf(err, "error message %s", "formatted") func (a *Assertions) NotNilf(object interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1160,7 +1244,7 @@ func (a *Assertions) NotNilf(object interface{}, msg string, args ...interface{} // NotPanics asserts that the code inside the specified PanicTestFunc does NOT panic. // -// a.NotPanics(func(){ RemainCalm() }) +// a.NotPanics(func(){ RemainCalm() }) func (a *Assertions) NotPanics(f assert.PanicTestFunc, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1170,7 +1254,7 @@ func (a *Assertions) NotPanics(f assert.PanicTestFunc, msgAndArgs ...interface{} // NotPanicsf asserts that the code inside the specified PanicTestFunc does NOT panic. // -// a.NotPanicsf(func(){ RemainCalm() }, "error message %s", "formatted") +// a.NotPanicsf(func(){ RemainCalm() }, "error message %s", "formatted") func (a *Assertions) NotPanicsf(f assert.PanicTestFunc, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1180,8 +1264,8 @@ func (a *Assertions) NotPanicsf(f assert.PanicTestFunc, msg string, args ...inte // NotRegexp asserts that a specified regexp does not match a string. // -// a.NotRegexp(regexp.MustCompile("starts"), "it's starting") -// a.NotRegexp("^start", "it's not starting") +// a.NotRegexp(regexp.MustCompile("starts"), "it's starting") +// a.NotRegexp("^start", "it's not starting") func (a *Assertions) NotRegexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1191,8 +1275,8 @@ func (a *Assertions) NotRegexp(rx interface{}, str interface{}, msgAndArgs ...in // NotRegexpf asserts that a specified regexp does not match a string. // -// a.NotRegexpf(regexp.MustCompile("starts"), "it's starting", "error message %s", "formatted") -// a.NotRegexpf("^start", "it's not starting", "error message %s", "formatted") +// a.NotRegexpf(regexp.MustCompile("starts"), "it's starting", "error message %s", "formatted") +// a.NotRegexpf("^start", "it's not starting", "error message %s", "formatted") func (a *Assertions) NotRegexpf(rx interface{}, str interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1202,7 +1286,7 @@ func (a *Assertions) NotRegexpf(rx interface{}, str interface{}, msg string, arg // NotSame asserts that two pointers do not reference the same object. // -// a.NotSame(ptr1, ptr2) +// a.NotSame(ptr1, ptr2) // // Both arguments must be pointer variables. Pointer variable sameness is // determined based on the equality of both type and value. @@ -1215,7 +1299,7 @@ func (a *Assertions) NotSame(expected interface{}, actual interface{}, msgAndArg // NotSamef asserts that two pointers do not reference the same object. // -// a.NotSamef(ptr1, ptr2, "error message %s", "formatted") +// a.NotSamef(ptr1, ptr2, "error message %s", "formatted") // // Both arguments must be pointer variables. Pointer variable sameness is // determined based on the equality of both type and value. @@ -1229,7 +1313,7 @@ func (a *Assertions) NotSamef(expected interface{}, actual interface{}, msg stri // NotSubset asserts that the specified list(array, slice...) contains not all // elements given in the specified subset(array, slice...). // -// a.NotSubset([1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]") +// a.NotSubset([1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]") func (a *Assertions) NotSubset(list interface{}, subset interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1240,7 +1324,7 @@ func (a *Assertions) NotSubset(list interface{}, subset interface{}, msgAndArgs // NotSubsetf asserts that the specified list(array, slice...) contains not all // elements given in the specified subset(array, slice...). // -// a.NotSubsetf([1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]", "error message %s", "formatted") +// a.NotSubsetf([1, 3, 4], [1, 2], "But [1, 3, 4] does not contain [1, 2]", "error message %s", "formatted") func (a *Assertions) NotSubsetf(list interface{}, subset interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1266,7 +1350,7 @@ func (a *Assertions) NotZerof(i interface{}, msg string, args ...interface{}) { // Panics asserts that the code inside the specified PanicTestFunc panics. // -// a.Panics(func(){ GoCrazy() }) +// a.Panics(func(){ GoCrazy() }) func (a *Assertions) Panics(f assert.PanicTestFunc, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1278,7 +1362,7 @@ func (a *Assertions) Panics(f assert.PanicTestFunc, msgAndArgs ...interface{}) { // panics, and that the recovered panic value is an error that satisfies the // EqualError comparison. // -// a.PanicsWithError("crazy error", func(){ GoCrazy() }) +// a.PanicsWithError("crazy error", func(){ GoCrazy() }) func (a *Assertions) PanicsWithError(errString string, f assert.PanicTestFunc, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1290,7 +1374,7 @@ func (a *Assertions) PanicsWithError(errString string, f assert.PanicTestFunc, m // panics, and that the recovered panic value is an error that satisfies the // EqualError comparison. // -// a.PanicsWithErrorf("crazy error", func(){ GoCrazy() }, "error message %s", "formatted") +// a.PanicsWithErrorf("crazy error", func(){ GoCrazy() }, "error message %s", "formatted") func (a *Assertions) PanicsWithErrorf(errString string, f assert.PanicTestFunc, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1301,7 +1385,7 @@ func (a *Assertions) PanicsWithErrorf(errString string, f assert.PanicTestFunc, // PanicsWithValue asserts that the code inside the specified PanicTestFunc panics, and that // the recovered panic value equals the expected panic value. // -// a.PanicsWithValue("crazy error", func(){ GoCrazy() }) +// a.PanicsWithValue("crazy error", func(){ GoCrazy() }) func (a *Assertions) PanicsWithValue(expected interface{}, f assert.PanicTestFunc, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1312,7 +1396,7 @@ func (a *Assertions) PanicsWithValue(expected interface{}, f assert.PanicTestFun // PanicsWithValuef asserts that the code inside the specified PanicTestFunc panics, and that // the recovered panic value equals the expected panic value. // -// a.PanicsWithValuef("crazy error", func(){ GoCrazy() }, "error message %s", "formatted") +// a.PanicsWithValuef("crazy error", func(){ GoCrazy() }, "error message %s", "formatted") func (a *Assertions) PanicsWithValuef(expected interface{}, f assert.PanicTestFunc, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1322,7 +1406,7 @@ func (a *Assertions) PanicsWithValuef(expected interface{}, f assert.PanicTestFu // Panicsf asserts that the code inside the specified PanicTestFunc panics. // -// a.Panicsf(func(){ GoCrazy() }, "error message %s", "formatted") +// a.Panicsf(func(){ GoCrazy() }, "error message %s", "formatted") func (a *Assertions) Panicsf(f assert.PanicTestFunc, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1332,8 +1416,8 @@ func (a *Assertions) Panicsf(f assert.PanicTestFunc, msg string, args ...interfa // Positive asserts that the specified element is positive // -// a.Positive(1) -// a.Positive(1.23) +// a.Positive(1) +// a.Positive(1.23) func (a *Assertions) Positive(e interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1343,8 +1427,8 @@ func (a *Assertions) Positive(e interface{}, msgAndArgs ...interface{}) { // Positivef asserts that the specified element is positive // -// a.Positivef(1, "error message %s", "formatted") -// a.Positivef(1.23, "error message %s", "formatted") +// a.Positivef(1, "error message %s", "formatted") +// a.Positivef(1.23, "error message %s", "formatted") func (a *Assertions) Positivef(e interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1354,8 +1438,8 @@ func (a *Assertions) Positivef(e interface{}, msg string, args ...interface{}) { // Regexp asserts that a specified regexp matches a string. // -// a.Regexp(regexp.MustCompile("start"), "it's starting") -// a.Regexp("start...$", "it's not starting") +// a.Regexp(regexp.MustCompile("start"), "it's starting") +// a.Regexp("start...$", "it's not starting") func (a *Assertions) Regexp(rx interface{}, str interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1365,8 +1449,8 @@ func (a *Assertions) Regexp(rx interface{}, str interface{}, msgAndArgs ...inter // Regexpf asserts that a specified regexp matches a string. // -// a.Regexpf(regexp.MustCompile("start"), "it's starting", "error message %s", "formatted") -// a.Regexpf("start...$", "it's not starting", "error message %s", "formatted") +// a.Regexpf(regexp.MustCompile("start"), "it's starting", "error message %s", "formatted") +// a.Regexpf("start...$", "it's not starting", "error message %s", "formatted") func (a *Assertions) Regexpf(rx interface{}, str interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1376,7 +1460,7 @@ func (a *Assertions) Regexpf(rx interface{}, str interface{}, msg string, args . // Same asserts that two pointers reference the same object. // -// a.Same(ptr1, ptr2) +// a.Same(ptr1, ptr2) // // Both arguments must be pointer variables. Pointer variable sameness is // determined based on the equality of both type and value. @@ -1389,7 +1473,7 @@ func (a *Assertions) Same(expected interface{}, actual interface{}, msgAndArgs . // Samef asserts that two pointers reference the same object. // -// a.Samef(ptr1, ptr2, "error message %s", "formatted") +// a.Samef(ptr1, ptr2, "error message %s", "formatted") // // Both arguments must be pointer variables. Pointer variable sameness is // determined based on the equality of both type and value. @@ -1403,7 +1487,7 @@ func (a *Assertions) Samef(expected interface{}, actual interface{}, msg string, // Subset asserts that the specified list(array, slice...) contains all // elements given in the specified subset(array, slice...). // -// a.Subset([1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]") +// a.Subset([1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]") func (a *Assertions) Subset(list interface{}, subset interface{}, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1414,7 +1498,7 @@ func (a *Assertions) Subset(list interface{}, subset interface{}, msgAndArgs ... // Subsetf asserts that the specified list(array, slice...) contains all // elements given in the specified subset(array, slice...). // -// a.Subsetf([1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]", "error message %s", "formatted") +// a.Subsetf([1, 2, 3], [1, 2], "But [1, 2, 3] does contain [1, 2]", "error message %s", "formatted") func (a *Assertions) Subsetf(list interface{}, subset interface{}, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1424,7 +1508,7 @@ func (a *Assertions) Subsetf(list interface{}, subset interface{}, msg string, a // True asserts that the specified value is true. // -// a.True(myBool) +// a.True(myBool) func (a *Assertions) True(value bool, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1434,7 +1518,7 @@ func (a *Assertions) True(value bool, msgAndArgs ...interface{}) { // Truef asserts that the specified value is true. // -// a.Truef(myBool, "error message %s", "formatted") +// a.Truef(myBool, "error message %s", "formatted") func (a *Assertions) Truef(value bool, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1444,7 +1528,7 @@ func (a *Assertions) Truef(value bool, msg string, args ...interface{}) { // WithinDuration asserts that the two times are within duration delta of each other. // -// a.WithinDuration(time.Now(), time.Now(), 10*time.Second) +// a.WithinDuration(time.Now(), time.Now(), 10*time.Second) func (a *Assertions) WithinDuration(expected time.Time, actual time.Time, delta time.Duration, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1454,7 +1538,7 @@ func (a *Assertions) WithinDuration(expected time.Time, actual time.Time, delta // WithinDurationf asserts that the two times are within duration delta of each other. // -// a.WithinDurationf(time.Now(), time.Now(), 10*time.Second, "error message %s", "formatted") +// a.WithinDurationf(time.Now(), time.Now(), 10*time.Second, "error message %s", "formatted") func (a *Assertions) WithinDurationf(expected time.Time, actual time.Time, delta time.Duration, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1464,7 +1548,7 @@ func (a *Assertions) WithinDurationf(expected time.Time, actual time.Time, delta // WithinRange asserts that a time is within a time range (inclusive). // -// a.WithinRange(time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second)) +// a.WithinRange(time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second)) func (a *Assertions) WithinRange(actual time.Time, start time.Time, end time.Time, msgAndArgs ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() @@ -1474,7 +1558,7 @@ func (a *Assertions) WithinRange(actual time.Time, start time.Time, end time.Tim // WithinRangef asserts that a time is within a time range (inclusive). // -// a.WithinRangef(time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second), "error message %s", "formatted") +// a.WithinRangef(time.Now(), time.Now().Add(-time.Second), time.Now().Add(time.Second), "error message %s", "formatted") func (a *Assertions) WithinRangef(actual time.Time, start time.Time, end time.Time, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper() diff --git a/cluster-autoscaler/vendor/github.com/stretchr/testify/suite/doc.go b/cluster-autoscaler/vendor/github.com/stretchr/testify/suite/doc.go index f91a245d3f8b..8d55a3aa8923 100644 --- a/cluster-autoscaler/vendor/github.com/stretchr/testify/suite/doc.go +++ b/cluster-autoscaler/vendor/github.com/stretchr/testify/suite/doc.go @@ -29,37 +29,38 @@ // Suite object has assertion methods. // // A crude example: -// // Basic imports -// import ( -// "testing" -// "github.com/stretchr/testify/assert" -// "github.com/stretchr/testify/suite" -// ) // -// // Define the suite, and absorb the built-in basic suite -// // functionality from testify - including a T() method which -// // returns the current testing context -// type ExampleTestSuite struct { -// suite.Suite -// VariableThatShouldStartAtFive int -// } +// // Basic imports +// import ( +// "testing" +// "github.com/stretchr/testify/assert" +// "github.com/stretchr/testify/suite" +// ) // -// // Make sure that VariableThatShouldStartAtFive is set to five -// // before each test -// func (suite *ExampleTestSuite) SetupTest() { -// suite.VariableThatShouldStartAtFive = 5 -// } +// // Define the suite, and absorb the built-in basic suite +// // functionality from testify - including a T() method which +// // returns the current testing context +// type ExampleTestSuite struct { +// suite.Suite +// VariableThatShouldStartAtFive int +// } // -// // All methods that begin with "Test" are run as tests within a -// // suite. -// func (suite *ExampleTestSuite) TestExample() { -// assert.Equal(suite.T(), 5, suite.VariableThatShouldStartAtFive) -// suite.Equal(5, suite.VariableThatShouldStartAtFive) -// } +// // Make sure that VariableThatShouldStartAtFive is set to five +// // before each test +// func (suite *ExampleTestSuite) SetupTest() { +// suite.VariableThatShouldStartAtFive = 5 +// } // -// // In order for 'go test' to run this suite, we need to create -// // a normal test function and pass our suite to suite.Run -// func TestExampleTestSuite(t *testing.T) { -// suite.Run(t, new(ExampleTestSuite)) -// } +// // All methods that begin with "Test" are run as tests within a +// // suite. +// func (suite *ExampleTestSuite) TestExample() { +// assert.Equal(suite.T(), 5, suite.VariableThatShouldStartAtFive) +// suite.Equal(5, suite.VariableThatShouldStartAtFive) +// } +// +// // In order for 'go test' to run this suite, we need to create +// // a normal test function and pass our suite to suite.Run +// func TestExampleTestSuite(t *testing.T) { +// suite.Run(t, new(ExampleTestSuite)) +// } package suite diff --git a/cluster-autoscaler/vendor/golang.org/x/crypto/cryptobyte/asn1.go b/cluster-autoscaler/vendor/golang.org/x/crypto/cryptobyte/asn1.go index 3141a7f1b986..6fc2838a3fb8 100644 --- a/cluster-autoscaler/vendor/golang.org/x/crypto/cryptobyte/asn1.go +++ b/cluster-autoscaler/vendor/golang.org/x/crypto/cryptobyte/asn1.go @@ -431,6 +431,14 @@ func (s *String) readBase128Int(out *int) bool { } ret <<= 7 b := s.read(1)[0] + + // ITU-T X.690, section 8.19.2: + // The subidentifier shall be encoded in the fewest possible octets, + // that is, the leading octet of the subidentifier shall not have the value 0x80. + if i == 0 && b == 0x80 { + return false + } + ret |= int(b & 0x7f) if b&0x80 == 0 { *out = ret diff --git a/cluster-autoscaler/vendor/golang.org/x/net/html/doc.go b/cluster-autoscaler/vendor/golang.org/x/net/html/doc.go index 5ff8480cf571..2466ae3d9a5d 100644 --- a/cluster-autoscaler/vendor/golang.org/x/net/html/doc.go +++ b/cluster-autoscaler/vendor/golang.org/x/net/html/doc.go @@ -99,14 +99,20 @@ Care should be taken when parsing and interpreting HTML, whether full documents or fragments, within the framework of the HTML specification, especially with regard to untrusted inputs. -This package provides both a tokenizer and a parser. Only the parser constructs -a DOM according to the HTML specification, resolving malformed and misplaced -tags where appropriate. The tokenizer simply tokenizes the HTML presented to it, -and as such does not resolve issues that may exist in the processed HTML, -producing a literal interpretation of the input. - -If your use case requires semantically well-formed HTML, as defined by the -WHATWG specification, the parser should be used rather than the tokenizer. +This package provides both a tokenizer and a parser, which implement the +tokenization, and tokenization and tree construction stages of the WHATWG HTML +parsing specification respectively. While the tokenizer parses and normalizes +individual HTML tokens, only the parser constructs the DOM tree from the +tokenized HTML, as described in the tree construction stage of the +specification, dynamically modifying or extending the docuemnt's DOM tree. + +If your use case requires semantically well-formed HTML documents, as defined by +the WHATWG specification, the parser should be used rather than the tokenizer. + +In security contexts, if trust decisions are being made using the tokenized or +parsed content, the input must be re-serialized (for instance by using Render or +Token.String) in order for those trust decisions to hold, as the process of +tokenization or parsing may alter the content. */ package html // import "golang.org/x/net/html" diff --git a/cluster-autoscaler/vendor/golang.org/x/net/http2/transport.go b/cluster-autoscaler/vendor/golang.org/x/net/http2/transport.go index f965579f7d51..ac90a2631c9e 100644 --- a/cluster-autoscaler/vendor/golang.org/x/net/http2/transport.go +++ b/cluster-autoscaler/vendor/golang.org/x/net/http2/transport.go @@ -1266,6 +1266,27 @@ func (cc *ClientConn) RoundTrip(req *http.Request) (*http.Response, error) { return res, nil } + cancelRequest := func(cs *clientStream, err error) error { + cs.cc.mu.Lock() + defer cs.cc.mu.Unlock() + cs.abortStreamLocked(err) + if cs.ID != 0 { + // This request may have failed because of a problem with the connection, + // or for some unrelated reason. (For example, the user might have canceled + // the request without waiting for a response.) Mark the connection as + // not reusable, since trying to reuse a dead connection is worse than + // unnecessarily creating a new one. + // + // If cs.ID is 0, then the request was never allocated a stream ID and + // whatever went wrong was unrelated to the connection. We might have + // timed out waiting for a stream slot when StrictMaxConcurrentStreams + // is set, for example, in which case retrying on a different connection + // will not help. + cs.cc.doNotReuse = true + } + return err + } + for { select { case <-cs.respHeaderRecv: @@ -1280,15 +1301,12 @@ func (cc *ClientConn) RoundTrip(req *http.Request) (*http.Response, error) { return handleResponseHeaders() default: waitDone() - return nil, cs.abortErr + return nil, cancelRequest(cs, cs.abortErr) } case <-ctx.Done(): - err := ctx.Err() - cs.abortStream(err) - return nil, err + return nil, cancelRequest(cs, ctx.Err()) case <-cs.reqCancel: - cs.abortStream(errRequestCanceled) - return nil, errRequestCanceled + return nil, cancelRequest(cs, errRequestCanceled) } } } diff --git a/cluster-autoscaler/vendor/golang.org/x/net/internal/socks/socks.go b/cluster-autoscaler/vendor/golang.org/x/net/internal/socks/socks.go index 97db2340ec97..84fcc32b634b 100644 --- a/cluster-autoscaler/vendor/golang.org/x/net/internal/socks/socks.go +++ b/cluster-autoscaler/vendor/golang.org/x/net/internal/socks/socks.go @@ -289,7 +289,7 @@ func (up *UsernamePassword) Authenticate(ctx context.Context, rw io.ReadWriter, case AuthMethodNotRequired: return nil case AuthMethodUsernamePassword: - if len(up.Username) == 0 || len(up.Username) > 255 || len(up.Password) == 0 || len(up.Password) > 255 { + if len(up.Username) == 0 || len(up.Username) > 255 || len(up.Password) > 255 { return errors.New("invalid username/password") } b := []byte{authUsernamePasswordVersion} diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/mkerrors.sh b/cluster-autoscaler/vendor/golang.org/x/sys/unix/mkerrors.sh index 2045d3dadb87..be0423e6856b 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -204,6 +204,7 @@ struct ltchars { #include #include #include +#include #include #include #include @@ -518,7 +519,7 @@ ccflags="$@" $2 ~ /^LOCK_(SH|EX|NB|UN)$/ || $2 ~ /^LO_(KEY|NAME)_SIZE$/ || $2 ~ /^LOOP_(CLR|CTL|GET|SET)_/ || - $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|TCP|MCAST|EVFILT|NOTE|SHUT|PROT|MAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR|LOCAL|TCPOPT)_/ || + $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|TCP|MCAST|EVFILT|NOTE|SHUT|PROT|MAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR|LOCAL|TCPOPT|UDP)_/ || $2 ~ /^NFC_(GENL|PROTO|COMM|RF|SE|DIRECTION|LLCP|SOCKPROTO)_/ || $2 ~ /^NFC_.*_(MAX)?SIZE$/ || $2 ~ /^RAW_PAYLOAD_/ || diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_linux.go b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_linux.go index 398c37e52d6b..de936b677b6a 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_linux.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/unix/zerrors_linux.go @@ -2967,6 +2967,7 @@ const ( SOL_TCP = 0x6 SOL_TIPC = 0x10f SOL_TLS = 0x11a + SOL_UDP = 0x11 SOL_X25 = 0x106 SOL_XDP = 0x11b SOMAXCONN = 0x1000 @@ -3251,6 +3252,19 @@ const ( TRACEFS_MAGIC = 0x74726163 TS_COMM_LEN = 0x20 UDF_SUPER_MAGIC = 0x15013346 + UDP_CORK = 0x1 + UDP_ENCAP = 0x64 + UDP_ENCAP_ESPINUDP = 0x2 + UDP_ENCAP_ESPINUDP_NON_IKE = 0x1 + UDP_ENCAP_GTP0 = 0x4 + UDP_ENCAP_GTP1U = 0x5 + UDP_ENCAP_L2TPINUDP = 0x3 + UDP_GRO = 0x68 + UDP_NO_CHECK6_RX = 0x66 + UDP_NO_CHECK6_TX = 0x65 + UDP_SEGMENT = 0x67 + UDP_V4_FLOW = 0x2 + UDP_V6_FLOW = 0x6 UMOUNT_NOFOLLOW = 0x8 USBDEVICE_SUPER_MAGIC = 0x9fa2 UTIME_NOW = 0x3fffffff diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/windows/env_windows.go b/cluster-autoscaler/vendor/golang.org/x/sys/windows/env_windows.go index 92ac05ff4ea6..b8ad19250689 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/windows/env_windows.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/windows/env_windows.go @@ -37,14 +37,14 @@ func (token Token) Environ(inheritExisting bool) (env []string, err error) { return nil, err } defer DestroyEnvironmentBlock(block) - blockp := uintptr(unsafe.Pointer(block)) + blockp := unsafe.Pointer(block) for { - entry := UTF16PtrToString((*uint16)(unsafe.Pointer(blockp))) + entry := UTF16PtrToString((*uint16)(blockp)) if len(entry) == 0 { break } env = append(env, entry) - blockp += 2 * (uintptr(len(entry)) + 1) + blockp = unsafe.Add(blockp, 2*(len(entry)+1)) } return env, nil } diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/windows/exec_windows.go b/cluster-autoscaler/vendor/golang.org/x/sys/windows/exec_windows.go index 75980fd44ad7..a52e0331d8bc 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/windows/exec_windows.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/windows/exec_windows.go @@ -95,12 +95,17 @@ func ComposeCommandLine(args []string) string { // DecomposeCommandLine breaks apart its argument command line into unescaped parts using CommandLineToArgv, // as gathered from GetCommandLine, QUERY_SERVICE_CONFIG's BinaryPathName argument, or elsewhere that // command lines are passed around. +// DecomposeCommandLine returns error if commandLine contains NUL. func DecomposeCommandLine(commandLine string) ([]string, error) { if len(commandLine) == 0 { return []string{}, nil } + utf16CommandLine, err := UTF16FromString(commandLine) + if err != nil { + return nil, errorspkg.New("string with NUL passed to DecomposeCommandLine") + } var argc int32 - argv, err := CommandLineToArgv(StringToUTF16Ptr(commandLine), &argc) + argv, err := CommandLineToArgv(&utf16CommandLine[0], &argc) if err != nil { return nil, err } diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/windows/service.go b/cluster-autoscaler/vendor/golang.org/x/sys/windows/service.go index f8deca8397ae..c964b6848d4f 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/windows/service.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/windows/service.go @@ -141,6 +141,12 @@ const ( SERVICE_DYNAMIC_INFORMATION_LEVEL_START_REASON = 1 ) +type ENUM_SERVICE_STATUS struct { + ServiceName *uint16 + DisplayName *uint16 + ServiceStatus SERVICE_STATUS +} + type SERVICE_STATUS struct { ServiceType uint32 CurrentState uint32 @@ -245,3 +251,4 @@ type QUERY_SERVICE_LOCK_STATUS struct { //sys UnsubscribeServiceChangeNotifications(subscription uintptr) = sechost.UnsubscribeServiceChangeNotifications? //sys RegisterServiceCtrlHandlerEx(serviceName *uint16, handlerProc uintptr, context uintptr) (handle Handle, err error) = advapi32.RegisterServiceCtrlHandlerExW //sys QueryServiceDynamicInformation(service Handle, infoLevel uint32, dynamicInfo unsafe.Pointer) (err error) = advapi32.QueryServiceDynamicInformation? +//sys EnumDependentServices(service Handle, activityState uint32, services *ENUM_SERVICE_STATUS, buffSize uint32, bytesNeeded *uint32, servicesReturned *uint32) (err error) = advapi32.EnumDependentServicesW diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/windows/svc/service.go b/cluster-autoscaler/vendor/golang.org/x/sys/windows/svc/service.go index 806baa055f6e..2b4a7bc6c251 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/windows/svc/service.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/windows/svc/service.go @@ -68,6 +68,15 @@ const ( AcceptPreShutdown = Accepted(windows.SERVICE_ACCEPT_PRESHUTDOWN) ) +// ActivityStatus allows for services to be selected based on active and inactive categories of service state. +type ActivityStatus uint32 + +const ( + Active = ActivityStatus(windows.SERVICE_ACTIVE) + Inactive = ActivityStatus(windows.SERVICE_INACTIVE) + AnyActivity = ActivityStatus(windows.SERVICE_STATE_ALL) +) + // Status combines State and Accepted commands to fully describe running service. type Status struct { State State diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/windows/types_windows.go b/cluster-autoscaler/vendor/golang.org/x/sys/windows/types_windows.go index 0dbb20841178..88e62a63851b 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/windows/types_windows.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/windows/types_windows.go @@ -2220,15 +2220,19 @@ type JOBOBJECT_BASIC_UI_RESTRICTIONS struct { } const ( - // JobObjectInformationClass + // JobObjectInformationClass for QueryInformationJobObject and SetInformationJobObject JobObjectAssociateCompletionPortInformation = 7 + JobObjectBasicAccountingInformation = 1 + JobObjectBasicAndIoAccountingInformation = 8 JobObjectBasicLimitInformation = 2 + JobObjectBasicProcessIdList = 3 JobObjectBasicUIRestrictions = 4 JobObjectCpuRateControlInformation = 15 JobObjectEndOfJobTimeInformation = 6 JobObjectExtendedLimitInformation = 9 JobObjectGroupInformation = 11 JobObjectGroupInformationEx = 14 + JobObjectLimitViolationInformation = 13 JobObjectLimitViolationInformation2 = 34 JobObjectNetRateControlInformation = 32 JobObjectNotificationLimitInformation = 12 diff --git a/cluster-autoscaler/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/cluster-autoscaler/vendor/golang.org/x/sys/windows/zsyscall_windows.go index 6d2a268534d7..a81ea2c70019 100644 --- a/cluster-autoscaler/vendor/golang.org/x/sys/windows/zsyscall_windows.go +++ b/cluster-autoscaler/vendor/golang.org/x/sys/windows/zsyscall_windows.go @@ -86,6 +86,7 @@ var ( procDeleteService = modadvapi32.NewProc("DeleteService") procDeregisterEventSource = modadvapi32.NewProc("DeregisterEventSource") procDuplicateTokenEx = modadvapi32.NewProc("DuplicateTokenEx") + procEnumDependentServicesW = modadvapi32.NewProc("EnumDependentServicesW") procEnumServicesStatusExW = modadvapi32.NewProc("EnumServicesStatusExW") procEqualSid = modadvapi32.NewProc("EqualSid") procFreeSid = modadvapi32.NewProc("FreeSid") @@ -734,6 +735,14 @@ func DuplicateTokenEx(existingToken Token, desiredAccess uint32, tokenAttributes return } +func EnumDependentServices(service Handle, activityState uint32, services *ENUM_SERVICE_STATUS, buffSize uint32, bytesNeeded *uint32, servicesReturned *uint32) (err error) { + r1, _, e1 := syscall.Syscall6(procEnumDependentServicesW.Addr(), 6, uintptr(service), uintptr(activityState), uintptr(unsafe.Pointer(services)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded)), uintptr(unsafe.Pointer(servicesReturned))) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func EnumServicesStatusEx(mgr Handle, infoLevel uint32, serviceType uint32, serviceState uint32, services *byte, bufSize uint32, bytesNeeded *uint32, servicesReturned *uint32, resumeHandle *uint32, groupName *uint16) (err error) { r1, _, e1 := syscall.Syscall12(procEnumServicesStatusExW.Addr(), 10, uintptr(mgr), uintptr(infoLevel), uintptr(serviceType), uintptr(serviceState), uintptr(unsafe.Pointer(services)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded)), uintptr(unsafe.Pointer(servicesReturned)), uintptr(unsafe.Pointer(resumeHandle)), uintptr(unsafe.Pointer(groupName)), 0, 0) if r1 == 0 { diff --git a/cluster-autoscaler/vendor/modules.txt b/cluster-autoscaler/vendor/modules.txt index 64f5399a8908..cdba53e8f6bd 100644 --- a/cluster-autoscaler/vendor/modules.txt +++ b/cluster-autoscaler/vendor/modules.txt @@ -4,16 +4,15 @@ cloud.google.com/go/compute/internal # cloud.google.com/go/compute/metadata v0.2.3 ## explicit; go 1.19 cloud.google.com/go/compute/metadata -# github.com/Azure/azure-sdk-for-go v67.2.0+incompatible +# github.com/Azure/azure-sdk-for-go v68.0.0+incompatible ## explicit -github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2019-05-01/containerregistry github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-06-01/network -github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network +github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network github.com/Azure/azure-sdk-for-go/services/privatedns/mgmt/2018-09-01/privatedns github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage @@ -24,11 +23,11 @@ github.com/Azure/azure-sdk-for-go/version # github.com/Azure/go-autorest v14.2.0+incompatible ## explicit github.com/Azure/go-autorest -# github.com/Azure/go-autorest/autorest v0.11.28 +# github.com/Azure/go-autorest/autorest v0.11.29 ## explicit; go 1.15 github.com/Azure/go-autorest/autorest github.com/Azure/go-autorest/autorest/azure -# github.com/Azure/go-autorest/autorest/adal v0.9.21 +# github.com/Azure/go-autorest/autorest/adal v0.9.23 ## explicit; go 1.15 github.com/Azure/go-autorest/autorest/adal # github.com/Azure/go-autorest/autorest/azure/auth v0.5.8 @@ -55,8 +54,8 @@ github.com/Azure/go-autorest/logger # github.com/Azure/go-autorest/tracing v0.6.0 ## explicit; go 1.12 github.com/Azure/go-autorest/tracing -# github.com/Azure/skewer v0.0.14 -## explicit; go 1.13 +# github.com/Azure/skewer v0.0.17 +## explicit; go 1.17 github.com/Azure/skewer # github.com/GoogleCloudPlatform/k8s-cloud-provider v1.18.1-0.20220218231025-f11817397a1b ## explicit; go 1.13 @@ -262,7 +261,7 @@ github.com/go-openapi/swag # github.com/godbus/dbus/v5 v5.0.6 ## explicit; go 1.12 github.com/godbus/dbus/v5 -# github.com/gofrs/uuid v4.0.0+incompatible +# github.com/gofrs/uuid v4.2.0+incompatible ## explicit github.com/gofrs/uuid # github.com/gogo/protobuf v1.3.2 @@ -272,7 +271,7 @@ github.com/gogo/protobuf/proto github.com/gogo/protobuf/protoc-gen-gogo/descriptor github.com/gogo/protobuf/sortkeys github.com/gogo/protobuf/types -# github.com/golang-jwt/jwt/v4 v4.4.2 +# github.com/golang-jwt/jwt/v4 v4.5.0 ## explicit; go 1.16 github.com/golang-jwt/jwt/v4 # github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da @@ -569,8 +568,8 @@ github.com/stoewer/go-strcase # github.com/stretchr/objx v0.5.0 ## explicit; go 1.12 github.com/stretchr/objx -# github.com/stretchr/testify v1.8.2 -## explicit; go 1.13 +# github.com/stretchr/testify v1.8.4 +## explicit; go 1.20 github.com/stretchr/testify/assert github.com/stretchr/testify/mock github.com/stretchr/testify/require @@ -735,7 +734,7 @@ go.uber.org/zap/internal/color go.uber.org/zap/internal/exit go.uber.org/zap/zapcore go.uber.org/zap/zapgrpc -# golang.org/x/crypto v0.8.0 +# golang.org/x/crypto v0.9.0 ## explicit; go 1.17 golang.org/x/crypto/cryptobyte golang.org/x/crypto/cryptobyte/asn1 @@ -749,7 +748,7 @@ golang.org/x/crypto/salsa20/salsa ## explicit; go 1.18 golang.org/x/exp/constraints golang.org/x/exp/slices -# golang.org/x/net v0.9.0 +# golang.org/x/net v0.10.0 ## explicit; go 1.17 golang.org/x/net/bpf golang.org/x/net/context @@ -774,10 +773,10 @@ golang.org/x/oauth2/google/internal/externalaccount golang.org/x/oauth2/internal golang.org/x/oauth2/jws golang.org/x/oauth2/jwt -# golang.org/x/sync v0.1.0 +# golang.org/x/sync v0.2.0 ## explicit golang.org/x/sync/singleflight -# golang.org/x/sys v0.7.0 +# golang.org/x/sys v0.8.0 ## explicit; go 1.17 golang.org/x/sys/cpu golang.org/x/sys/internal/unsafeheader @@ -786,7 +785,7 @@ golang.org/x/sys/unix golang.org/x/sys/windows golang.org/x/sys/windows/registry golang.org/x/sys/windows/svc -# golang.org/x/term v0.7.0 +# golang.org/x/term v0.8.0 ## explicit; go 1.17 golang.org/x/term # golang.org/x/text v0.9.0 @@ -2047,8 +2046,8 @@ sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client/metrics sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/common/metrics sigs.k8s.io/apiserver-network-proxy/konnectivity-client/proto/client -# sigs.k8s.io/cloud-provider-azure v1.26.2 -## explicit; go 1.19 +# sigs.k8s.io/cloud-provider-azure v1.27.5 +## explicit; go 1.20 sigs.k8s.io/cloud-provider-azure/pkg/azureclients sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient sigs.k8s.io/cloud-provider-azure/pkg/azureclients/blobclient diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient/azure_armclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient/azure_armclient.go index 835a63b4544e..2d3739f3e5a9 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient/azure_armclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient/azure_armclient.go @@ -75,7 +75,7 @@ func sender() autorest.Sender { Timeout: 30 * time.Second, // the same as default transport KeepAlive: 30 * time.Second, // the same as default transport }).DialContext, - ForceAttemptHTTP2: true, // always attempt HTTP/2 even though custom dialer is provided + ForceAttemptHTTP2: false, // respect custom dialer (default is true) MaxIdleConns: 100, // Zero means no limit, the same as default transport MaxIdleConnsPerHost: 100, // Default is 2, ref:https://cs.opensource.google/go/go/+/go1.18.4:src/net/http/transport.go;l=58 IdleConnTimeout: 90 * time.Second, // the same as default transport @@ -393,6 +393,40 @@ func (c *Client) PutResource(ctx context.Context, resourceID string, parameters return response, nil } +func (c *Client) waitAsync(ctx context.Context, futures map[string]*azure.Future, previousResponses map[string]*PutResourcesResponse) { + wg := sync.WaitGroup{} + var responseLock sync.Mutex + for resourceID, future := range futures { + wg.Add(1) + go func(resourceID string, future *azure.Future) { + defer wg.Done() + response, err := c.WaitForAsyncOperationResult(ctx, future, "armclient.PutResource") + if err != nil { + if response != nil { + klog.V(5).Infof("Received error in WaitForAsyncOperationResult: '%s', response code %d", err.Error(), response.StatusCode) + } else { + klog.V(5).Infof("Received error in WaitForAsyncOperationResult: '%s', no response", err.Error()) + } + + retriableErr := retry.GetError(response, err) + if !retriableErr.Retriable && + strings.Contains(strings.ToUpper(err.Error()), strings.ToUpper("InternalServerError")) { + klog.V(5).Infof("Received InternalServerError in WaitForAsyncOperationResult: '%s', setting error retriable", err.Error()) + retriableErr.Retriable = true + } + + responseLock.Lock() + previousResponses[resourceID] = &PutResourcesResponse{ + Error: retriableErr, + } + responseLock.Unlock() + return + } + }(resourceID, future) + } + wg.Wait() +} + // PutResourcesInBatches is similar with PutResources, but it sends sync request concurrently in batches. func (c *Client) PutResourcesInBatches(ctx context.Context, resources map[string]interface{}, batchSize int) map[string]*PutResourcesResponse { if len(resources) == 0 { @@ -413,27 +447,37 @@ func (c *Client) PutResourcesInBatches(ctx context.Context, resources map[string rateLimiter := make(chan struct{}, batchSize) // Concurrent sync requests in batches. + futures := make(map[string]*azure.Future) responses := make(map[string]*PutResourcesResponse) wg := sync.WaitGroup{} - var responseLock sync.Mutex + var responseLock, futuresLock sync.Mutex for resourceID, parameters := range resources { rateLimiter <- struct{}{} wg.Add(1) go func(resourceID string, parameters interface{}) { defer wg.Done() defer func() { <-rateLimiter }() - resp, rerr := c.PutResource(ctx, resourceID, parameters) - responseLock.Lock() - defer responseLock.Unlock() - responses[resourceID] = &PutResourcesResponse{ - Error: rerr, - Response: resp, + future, rerr := c.PutResourceAsync(ctx, resourceID, parameters) + if rerr != nil { + responseLock.Lock() + responses[resourceID] = &PutResourcesResponse{ + Error: rerr, + } + responseLock.Unlock() + return } + + futuresLock.Lock() + futures[resourceID] = future + futuresLock.Unlock() }(resourceID, parameters) } wg.Wait() close(rateLimiter) + // Concurrent async requests. + c.waitAsync(ctx, futures, responses) + return responses } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient/util.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient/util.go index afefd2cfc729..e9c974de405b 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient/util.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient/util.go @@ -21,7 +21,7 @@ import ( "encoding/json" "fmt" "html" - "io/ioutil" + "io" "net/http" "net/http/httputil" "strings" @@ -114,9 +114,9 @@ func DoHackRegionalRetryForGET(c *Client) autorest.SendDecorator { return response, rerr } - bodyBytes, _ := ioutil.ReadAll(response.Body) + bodyBytes, _ := io.ReadAll(response.Body) defer func() { - response.Body = ioutil.NopCloser(bytes.NewBuffer(bodyBytes)) + response.Body = io.NopCloser(bytes.NewBuffer(bodyBytes)) }() bodyString := string(bodyBytes) @@ -177,9 +177,9 @@ func DoHackRegionalRetryForGET(c *Client) autorest.SendDecorator { } // Do the same check on regional response just like the global one - bodyBytes, _ = ioutil.ReadAll(regionalResponse.Body) + bodyBytes, _ = io.ReadAll(regionalResponse.Body) defer func() { - regionalResponse.Body = ioutil.NopCloser(bytes.NewBuffer(bodyBytes)) + regionalResponse.Body = io.NopCloser(bytes.NewBuffer(bodyBytes)) }() bodyString = string(bodyBytes) trimmed = strings.TrimSpace(bodyString) diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/blobclient/azure_blobclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/blobclient/azure_blobclient.go index 517f8bda7657..d1fb1d08008e 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/blobclient/azure_blobclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/blobclient/azure_blobclient.go @@ -38,9 +38,12 @@ var _ Interface = &Client{} // Client implements the blobclient interface type Client struct { - armClient armclient.Interface - subscriptionID string - cloudName string + blobServicesClient storage.BlobServicesClient + armClient armclient.Interface + subscriptionID string + cloudName string + baseURI string + authorizer autorest.Authorizer // Rate limiting configures. rateLimiterReader flowcontrol.RateLimiter @@ -60,6 +63,9 @@ func New(config *azclients.ClientConfig) *Client { authorizer := config.Authorizer apiVersion := APIVersion + blobServicesClient := storage.NewBlobServicesClientWithBaseURI(baseURI, config.SubscriptionID) + blobServicesClient.Authorizer = authorizer + if strings.EqualFold(config.CloudName, AzureStackCloudName) && !config.DisableAzureStackCloud { apiVersion = AzureStackCloudAPIVersion } @@ -78,12 +84,15 @@ func New(config *azclients.ClientConfig) *Client { } client := &Client{ - armClient: armClient, - rateLimiterReader: rateLimiterReader, - rateLimiterWriter: rateLimiterWriter, - subscriptionID: config.SubscriptionID, - cloudName: config.CloudName, - now: time.Now, + blobServicesClient: blobServicesClient, + armClient: armClient, + rateLimiterReader: rateLimiterReader, + rateLimiterWriter: rateLimiterWriter, + subscriptionID: config.SubscriptionID, + cloudName: config.CloudName, + now: time.Now, + baseURI: baseURI, + authorizer: authorizer, } return client @@ -268,3 +277,21 @@ func (c *Client) getContainer(ctx context.Context, subsID, resourceGroupName, ac container.Response = autorest.Response{Response: response} return container, nil } + +func (c *Client) GetServiceProperties(ctx context.Context, subsID, resourceGroupName, accountName string) (storage.BlobServiceProperties, error) { + blobServicesClient := c.blobServicesClient + if subsID != c.subscriptionID { + blobServicesClient = storage.NewBlobServicesClientWithBaseURI(c.baseURI, c.subscriptionID) + blobServicesClient.Authorizer = c.authorizer + } + return blobServicesClient.GetServiceProperties(ctx, resourceGroupName, accountName) +} + +func (c *Client) SetServiceProperties(ctx context.Context, subsID, resourceGroupName, accountName string, parameters storage.BlobServiceProperties) (storage.BlobServiceProperties, error) { + blobServicesClient := c.blobServicesClient + if subsID != c.subscriptionID { + blobServicesClient = storage.NewBlobServicesClientWithBaseURI(c.baseURI, c.subscriptionID) + blobServicesClient.Authorizer = c.authorizer + } + return blobServicesClient.SetServiceProperties(ctx, resourceGroupName, accountName, parameters) +} diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/blobclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/blobclient/interface.go index b8ac9d8d7f21..3f89e3f1cce3 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/blobclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/blobclient/interface.go @@ -39,4 +39,6 @@ type Interface interface { CreateContainer(ctx context.Context, subsID, resourceGroupName, accountName, containerName string, parameters storage.BlobContainer) *retry.Error DeleteContainer(ctx context.Context, subsID, resourceGroupName, accountName, containerName string) *retry.Error GetContainer(ctx context.Context, subsID, resourceGroupName, accountName, containerName string) (storage.BlobContainer, *retry.Error) + GetServiceProperties(ctx context.Context, subsID, resourceGroupName, accountName string) (storage.BlobServiceProperties, error) + SetServiceProperties(ctx context.Context, subsID, resourceGroupName, accountName string, parameters storage.BlobServiceProperties) (storage.BlobServiceProperties, error) } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/containerserviceclient/azure_containerserviceclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/containerserviceclient/azure_containerserviceclient.go index a61e784de1c4..44f55003e8a6 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/containerserviceclient/azure_containerserviceclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/containerserviceclient/azure_containerserviceclient.go @@ -24,10 +24,10 @@ import ( "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2021-10-01/containerservice" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/to" "k8s.io/client-go/util/flowcontrol" "k8s.io/klog/v2" + "k8s.io/utils/pointer" azclients "sigs.k8s.io/cloud-provider-azure/pkg/azureclients" "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient" @@ -196,7 +196,7 @@ func (c *Client) listManagedCluster(ctx context.Context, resourceGroupName strin result = append(result, page.Values()...) // Abort the loop when there's no nextLink in the response. - if to.String(page.Response().NextLink) == "" { + if pointer.StringDeref(page.Response().NextLink, "") == "" { break } @@ -222,12 +222,12 @@ func (c *Client) listResponder(resp *http.Response) (result containerservice.Man // managedClusterListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (c *Client) managedClusterListResultPreparer(ctx context.Context, mclr containerservice.ManagedClusterListResult) (*http.Request, error) { - if mclr.NextLink == nil || len(to.String(mclr.NextLink)) < 1 { + if mclr.NextLink == nil || len(pointer.StringDeref(mclr.NextLink, "")) < 1 { return nil, nil } decorators := []autorest.PrepareDecorator{ - autorest.WithBaseURL(to.String(mclr.NextLink)), + autorest.WithBaseURL(pointer.StringDeref(mclr.NextLink, "")), } return c.armClient.PrepareGetRequest(ctx, decorators...) } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/deploymentclient/azure_deploymentclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/deploymentclient/azure_deploymentclient.go index e0012660801a..8a15249704f7 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/deploymentclient/azure_deploymentclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/deploymentclient/azure_deploymentclient.go @@ -24,10 +24,10 @@ import ( "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2017-05-10/resources" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/to" "k8s.io/client-go/util/flowcontrol" "k8s.io/klog/v2" + "k8s.io/utils/pointer" azclients "sigs.k8s.io/cloud-provider-azure/pkg/azureclients" "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient" @@ -196,7 +196,7 @@ func (c *Client) listDeployment(ctx context.Context, resourceGroupName string) ( result = append(result, page.Values()...) // Abort the loop when there's no nextLink in the response. - if to.String(page.Response().NextLink) == "" { + if pointer.StringDeref(page.Response().NextLink, "") == "" { break } @@ -222,12 +222,12 @@ func (c *Client) listResponder(resp *http.Response) (result resources.Deployment // deploymentListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (c *Client) deploymentListResultPreparer(ctx context.Context, dplr resources.DeploymentListResult) (*http.Request, error) { - if dplr.NextLink == nil || len(to.String(dplr.NextLink)) < 1 { + if dplr.NextLink == nil || len(pointer.StringDeref(dplr.NextLink, "")) < 1 { return nil, nil } decorators := []autorest.PrepareDecorator{ - autorest.WithBaseURL(to.String(dplr.NextLink)), + autorest.WithBaseURL(pointer.StringDeref(dplr.NextLink, "")), } return c.armClient.PrepareGetRequest(ctx, decorators...) } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/diskclient/azure_diskclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/diskclient/azure_diskclient.go index 4e3053e71468..291fa13b822d 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/diskclient/azure_diskclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/diskclient/azure_diskclient.go @@ -25,10 +25,10 @@ import ( "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/to" "k8s.io/client-go/util/flowcontrol" "k8s.io/klog/v2" + "k8s.io/utils/pointer" azclients "sigs.k8s.io/cloud-provider-azure/pkg/azureclients" "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient" @@ -370,7 +370,7 @@ func (c *Client) ListByResourceGroup(ctx context.Context, subsID, resourceGroupN result = append(result, page.Values()...) // Abort the loop when there's no nextLink in the response. - if to.String(page.Response().NextLink) == "" { + if pointer.StringDeref(page.Response().NextLink, "") == "" { break } @@ -420,13 +420,13 @@ func (c *Client) listResponder(resp *http.Response) (result compute.DiskList, er } func (c *Client) diskListPreparer(ctx context.Context, lr compute.DiskList) (*http.Request, error) { - if lr.NextLink == nil || len(to.String(lr.NextLink)) < 1 { + if lr.NextLink == nil || len(pointer.StringDeref(lr.NextLink, "")) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(lr.NextLink))) + autorest.WithBaseURL(pointer.StringDeref(lr.NextLink, ""))) } // DiskListPage contains a page of Disk values. diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/fileclient/azure_fileclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/fileclient/azure_fileclient.go index 737b03fbac6d..f66f1a40a498 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/fileclient/azure_fileclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/fileclient/azure_fileclient.go @@ -22,9 +22,9 @@ import ( "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/to" "k8s.io/klog/v2" + "k8s.io/utils/pointer" azclients "sigs.k8s.io/cloud-provider-azure/pkg/azureclients" "sigs.k8s.io/cloud-provider-azure/pkg/metrics" @@ -219,7 +219,7 @@ func (c *Client) ListFileShare(ctx context.Context, resourceGroupName, accountNa result = append(result, page.Values()...) // Abort the loop when there's no nextLink in the response. - if to.String(page.Response().NextLink) == "" { + if pointer.StringDeref(page.Response().NextLink, "") == "" { break } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/interfaceclient/azure_interfaceclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/interfaceclient/azure_interfaceclient.go index 11a3b98f2f3a..ec69148dac38 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/interfaceclient/azure_interfaceclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/interfaceclient/azure_interfaceclient.go @@ -23,13 +23,13 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/to" "k8s.io/client-go/util/flowcontrol" "k8s.io/klog/v2" + "k8s.io/utils/pointer" azclients "sigs.k8s.io/cloud-provider-azure/pkg/azureclients" "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient" @@ -261,8 +261,8 @@ func (c *Client) createOrUpdateInterface(ctx context.Context, resourceGroupName networkInterfaceName, ) decorators := []autorest.PrepareDecorator{} - if to.String(parameters.Etag) != "" { - decorators = append(decorators, autorest.WithHeader("If-Match", autorest.String(to.String(parameters.Etag)))) + if pointer.StringDeref(parameters.Etag, "") != "" { + decorators = append(decorators, autorest.WithHeader("If-Match", autorest.String(pointer.StringDeref(parameters.Etag, "")))) } response, rerr := c.armClient.PutResource(ctx, resourceID, parameters, decorators...) diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/interfaceclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/interfaceclient/interface.go index e8e807a406bb..3d9ae10ed1d4 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/interfaceclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/interfaceclient/interface.go @@ -19,14 +19,14 @@ package interfaceclient import ( "context" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) const ( // APIVersion is the API version for network. - APIVersion = "2021-08-01" + APIVersion = "2022-07-01" // AzureStackCloudAPIVersion is the API version for Azure Stack AzureStackCloudAPIVersion = "2018-11-01" diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/interfaceclient/mockinterfaceclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/interfaceclient/mockinterfaceclient/interface.go index 62e7050481de..53ba1bf5e4a0 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/interfaceclient/mockinterfaceclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/interfaceclient/mockinterfaceclient/interface.go @@ -25,7 +25,7 @@ import ( context "context" reflect "reflect" - network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" gomock "github.com/golang/mock/gomock" retry "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/azure_loadbalancerclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/azure_loadbalancerclient.go index 1d5268463f43..f641d2b4421f 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/azure_loadbalancerclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/azure_loadbalancerclient.go @@ -22,13 +22,13 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/to" "k8s.io/client-go/util/flowcontrol" "k8s.io/klog/v2" + "k8s.io/utils/pointer" azclients "sigs.k8s.io/cloud-provider-azure/pkg/azureclients" "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient" @@ -55,6 +55,10 @@ type Client struct { RetryAfterWriter time.Time } +type backendPoolsToBeMigrated struct { + BackendPoolNames []string `json:"pools"` +} + // New creates a new LoadBalancer client with ratelimiting. func New(config *azclients.ClientConfig) *Client { baseURI := config.ResourceManagerEndpoint @@ -203,7 +207,7 @@ func (c *Client) listLB(ctx context.Context, resourceGroupName string) ([]networ result = append(result, page.Values()...) // Abort the loop when there's no nextLink in the response. - if to.String(page.Response().NextLink) == "" { + if pointer.StringDeref(page.Response().NextLink, "") == "" { break } @@ -344,12 +348,12 @@ func (c *Client) listResponder(resp *http.Response) (result network.LoadBalancer // loadBalancerListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (c *Client) loadBalancerListResultPreparer(ctx context.Context, lblr network.LoadBalancerListResult) (*http.Request, error) { - if lblr.NextLink == nil || len(to.String(lblr.NextLink)) < 1 { + if lblr.NextLink == nil || len(pointer.StringDeref(lblr.NextLink, "")) < 1 { return nil, nil } decorators := []autorest.PrepareDecorator{ - autorest.WithBaseURL(to.String(lblr.NextLink)), + autorest.WithBaseURL(pointer.StringDeref(lblr.NextLink, "")), } return c.armClient.PrepareGetRequest(ctx, decorators...) } @@ -421,6 +425,69 @@ func (page LoadBalancerListResultPage) Values() []network.LoadBalancer { return *page.lblr.Value } +// GetLBBackendPool gets a LoadBalancer backend pool. +func (c *Client) GetLBBackendPool(ctx context.Context, resourceGroupName string, loadBalancerName string, backendPoolName string, expand string) (network.BackendAddressPool, *retry.Error) { + mc := metrics.NewMetricContext("load_balancers", "get_backend_pool", resourceGroupName, c.subscriptionID, "") + + // Report errors if the client is rate limited. + if !c.rateLimiterReader.TryAccept() { + mc.RateLimitedCount() + return network.BackendAddressPool{}, retry.GetRateLimitError(false, "LBGet") + } + + // Report errors if the client is throttled. + if c.RetryAfterReader.After(time.Now()) { + mc.ThrottledCount() + rerr := retry.GetThrottlingError("LBBackendPoolGet", "client throttled", c.RetryAfterReader) + return network.BackendAddressPool{}, rerr + } + + result, rerr := c.getLBBackendPool(ctx, resourceGroupName, loadBalancerName, backendPoolName, expand) + mc.Observe(rerr) + if rerr != nil { + if rerr.IsThrottled() { + // Update RetryAfterReader so that no more requests would be sent until RetryAfter expires. + c.RetryAfterReader = rerr.RetryAfter + } + + return result, rerr + } + + return result, nil +} + +// getLBBackendPool gets a LoadBalancer backend pool. +func (c *Client) getLBBackendPool(ctx context.Context, resourceGroupName string, loadBalancerName string, backendPoolName string, expand string) (network.BackendAddressPool, *retry.Error) { + resourceID := armclient.GetChildResourceID( + c.subscriptionID, + resourceGroupName, + lbResourceType, + loadBalancerName, + "backendAddressPools", + backendPoolName, + ) + result := network.BackendAddressPool{} + + response, rerr := c.armClient.GetResourceWithExpandQuery(ctx, resourceID, expand) + defer c.armClient.CloseResponse(ctx, response) + if rerr != nil { + klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "loadbalancer.backendpool.get.request", resourceID, rerr.Error()) + return result, rerr + } + + err := autorest.Respond( + response, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result)) + if err != nil { + klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "loadbalancer.backendpool.get.respond", resourceID, err) + return result, retry.GetError(response, err) + } + + result.Response = autorest.Response{Response: response} + return result, nil +} + // CreateOrUpdateBackendPools creates or updates a LoadBalancer backend pool. func (c *Client) CreateOrUpdateBackendPools(ctx context.Context, resourceGroupName string, loadBalancerName string, backendPoolName string, parameters network.BackendAddressPool, etag string) *retry.Error { mc := metrics.NewMetricContext("load_balancers", "create_or_update_backend_pools", resourceGroupName, c.subscriptionID, "") @@ -470,14 +537,14 @@ func (c *Client) createOrUpdateLBBackendPool(ctx context.Context, resourceGroupN response, rerr := c.armClient.PutResource(ctx, resourceID, parameters, decorators...) defer c.armClient.CloseResponse(ctx, response) if rerr != nil { - klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "loadbalancerbackendpool.put.request", resourceID, rerr.Error()) + klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "loadbalancer.backendpool.put.request", resourceID, rerr.Error()) return rerr } if response != nil && response.StatusCode != http.StatusNoContent { _, rerr = c.createOrUpdateBackendPoolResponder(response) if rerr != nil { - klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "loadbalancerbackendpool.put.respond", resourceID, rerr.Error()) + klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "loadbalancer.backendpool.put.respond", resourceID, rerr.Error()) return rerr } } @@ -537,3 +604,56 @@ func (c *Client) createOrUpdateBackendPoolResponder(resp *http.Response) (*netwo result.Response = autorest.Response{Response: resp} return result, retry.GetError(resp, err) } + +// MigrateToIPBasedBackendPool migrates a NIC-based backend pool to IP-based. +func (c *Client) MigrateToIPBasedBackendPool(ctx context.Context, resourceGroupName string, loadBalancerName string, backendPoolNames []string) *retry.Error { + mc := metrics.NewMetricContext("load_balancers", "migrate_to_ip_based_backend_pool", resourceGroupName, c.subscriptionID, "") + + // Report errors if the client is rate limited. + if !c.rateLimiterWriter.TryAccept() { + mc.RateLimitedCount() + return retry.GetRateLimitError(true, "LBMigrateToIPBasedBackendPool") + } + + // Report errors if the client is throttled. + if c.RetryAfterWriter.After(time.Now()) { + mc.ThrottledCount() + rerr := retry.GetThrottlingError("LBMigrateToIPBasedBackendPool", "client throttled", c.RetryAfterWriter) + return rerr + } + + parameters := backendPoolsToBeMigrated{ + BackendPoolNames: backendPoolNames, + } + rerr := c.migrateToIPBasedBackendPool(ctx, resourceGroupName, loadBalancerName, parameters) + mc.Observe(rerr) + if rerr != nil { + if rerr.IsThrottled() { + // Update RetryAfterReader so that no more requests would be sent until RetryAfter expires. + c.RetryAfterWriter = rerr.RetryAfter + } + + return rerr + } + + return nil +} + +func (c *Client) migrateToIPBasedBackendPool(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters backendPoolsToBeMigrated) *retry.Error { + resourceID := armclient.GetResourceID( + c.subscriptionID, + resourceGroupName, + lbResourceType, + loadBalancerName, + ) + + response, rerr := c.armClient.PostResource(ctx, resourceID, "migrateToIpBased", parameters, map[string]interface{}{}) + defer c.armClient.CloseResponse(ctx, response) + if rerr != nil { + klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "loadbalancerbackendpool.migrate.request", resourceID, rerr.Error()) + return rerr + } + + klog.Infof("Response: %v", response) + return nil +} diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/interface.go index a4da65f92f87..6f0feb22f8cd 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/interface.go @@ -19,14 +19,14 @@ package loadbalancerclient import ( "context" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) const ( // APIVersion is the API version for network. - APIVersion = "2021-08-01" + APIVersion = "2022-07-01" // AzureStackCloudAPIVersion is the API version for Azure Stack AzureStackCloudAPIVersion = "2018-11-01" // AzureStackCloudName is the cloud name of Azure Stack @@ -51,6 +51,12 @@ type Interface interface { // Delete deletes a LoadBalancer by name. Delete(ctx context.Context, resourceGroupName string, loadBalancerName string) *retry.Error + // GetLBBackendPool gets a LoadBalancer backend pool. + GetLBBackendPool(ctx context.Context, resourceGroupName string, loadBalancerName string, backendPoolName string, expand string) (network.BackendAddressPool, *retry.Error) + // DeleteLBBackendPool deletes a LoadBalancer backend pool by name. DeleteLBBackendPool(ctx context.Context, resourceGroupName, loadBalancerName, backendPoolName string) *retry.Error + + // MigrateToIPBasedBackendPool migrates a NIC-based backend pool to IP-based. + MigrateToIPBasedBackendPool(ctx context.Context, resourceGroupName string, loadBalancerName string, backendPoolNames []string) *retry.Error } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/mockloadbalancerclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/mockloadbalancerclient/interface.go index e9d0aaad8dff..c32c8a230a6c 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/mockloadbalancerclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/loadbalancerclient/mockloadbalancerclient/interface.go @@ -25,7 +25,7 @@ import ( context "context" reflect "reflect" - network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" gomock "github.com/golang/mock/gomock" retry "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) @@ -124,6 +124,21 @@ func (mr *MockInterfaceMockRecorder) Get(ctx, resourceGroupName, loadBalancerNam return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockInterface)(nil).Get), ctx, resourceGroupName, loadBalancerName, expand) } +// GetLBBackendPool mocks base method. +func (m *MockInterface) GetLBBackendPool(ctx context.Context, resourceGroupName, loadBalancerName, backendPoolName, expand string) (network.BackendAddressPool, *retry.Error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetLBBackendPool", ctx, resourceGroupName, loadBalancerName, backendPoolName, expand) + ret0, _ := ret[0].(network.BackendAddressPool) + ret1, _ := ret[1].(*retry.Error) + return ret0, ret1 +} + +// GetLBBackendPool indicates an expected call of GetLBBackendPool. +func (mr *MockInterfaceMockRecorder) GetLBBackendPool(ctx, resourceGroupName, loadBalancerName, backendPoolName, expand interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLBBackendPool", reflect.TypeOf((*MockInterface)(nil).GetLBBackendPool), ctx, resourceGroupName, loadBalancerName, backendPoolName, expand) +} + // List mocks base method. func (m *MockInterface) List(ctx context.Context, resourceGroupName string) ([]network.LoadBalancer, *retry.Error) { m.ctrl.T.Helper() @@ -138,3 +153,17 @@ func (mr *MockInterfaceMockRecorder) List(ctx, resourceGroupName interface{}) *g mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockInterface)(nil).List), ctx, resourceGroupName) } + +// MigrateToIPBasedBackendPool mocks base method. +func (m *MockInterface) MigrateToIPBasedBackendPool(ctx context.Context, resourceGroupName, loadBalancerName string, backendPoolNames []string) *retry.Error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MigrateToIPBasedBackendPool", ctx, resourceGroupName, loadBalancerName, backendPoolNames) + ret0, _ := ret[0].(*retry.Error) + return ret0 +} + +// MigrateToIPBasedBackendPool indicates an expected call of MigrateToIPBasedBackendPool. +func (mr *MockInterfaceMockRecorder) MigrateToIPBasedBackendPool(ctx, resourceGroupName, loadBalancerName, backendPoolNames interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MigrateToIPBasedBackendPool", reflect.TypeOf((*MockInterface)(nil).MigrateToIPBasedBackendPool), ctx, resourceGroupName, loadBalancerName, backendPoolNames) +} diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatednszonegroupclient/azure_privatednszonegroupclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatednszonegroupclient/azure_privatednszonegroupclient.go index adaec79d4559..6ca7c1d9131c 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatednszonegroupclient/azure_privatednszonegroupclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatednszonegroupclient/azure_privatednszonegroupclient.go @@ -22,7 +22,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatednszonegroupclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatednszonegroupclient/interface.go index ce07a889b4fd..1bc97630d9d2 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatednszonegroupclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatednszonegroupclient/interface.go @@ -19,14 +19,14 @@ package privatednszonegroupclient import ( "context" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) const ( // APIVersion is the API version. - APIVersion = "2021-08-01" + APIVersion = "2022-07-01" // AzureStackCloudName is the cloud name of Azure Stack AzureStackCloudName = "AZURESTACKCLOUD" ) diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privateendpointclient/azure_privateendpointclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privateendpointclient/azure_privateendpointclient.go index 84240d5022c5..3d8982ad6186 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privateendpointclient/azure_privateendpointclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privateendpointclient/azure_privateendpointclient.go @@ -23,7 +23,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privateendpointclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privateendpointclient/interface.go index 06db14ad328b..17340cdab20d 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privateendpointclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privateendpointclient/interface.go @@ -19,14 +19,14 @@ package privateendpointclient import ( "context" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) const ( // APIVersion is the API version for network. - APIVersion = "2021-08-01" + APIVersion = "2022-07-01" // AzureStackCloudName is the cloud name of Azure Stack AzureStackCloudName = "AZURESTACKCLOUD" ) diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/azure_privatelinkserviceclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/azure_privatelinkserviceclient.go index bede7e41d26d..99b9a2c60161 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/azure_privatelinkserviceclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/azure_privatelinkserviceclient.go @@ -23,13 +23,13 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/to" "k8s.io/client-go/util/flowcontrol" "k8s.io/klog/v2" + "k8s.io/utils/pointer" azclients "sigs.k8s.io/cloud-provider-azure/pkg/azureclients" "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient" @@ -270,7 +270,7 @@ func (c *Client) listPLS(ctx context.Context, resourceGroupName string) ([]netwo result = append(result, page.Values()...) // Abort the loop when there's no nextLink in the response. - if to.String(page.Response().NextLink) == "" { + if pointer.StringDeref(page.Response().NextLink, "") == "" { break } @@ -382,12 +382,12 @@ func (c *Client) listResponder(resp *http.Response) (result network.PrivateLinkS // privateLinkServiceListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (c *Client) privateLinkServiceListResultPreparer(ctx context.Context, plslr network.PrivateLinkServiceListResult) (*http.Request, error) { - if plslr.NextLink == nil || len(to.String(plslr.NextLink)) < 1 { + if plslr.NextLink == nil || len(pointer.StringDeref(plslr.NextLink, "")) < 1 { return nil, nil } decorators := []autorest.PrepareDecorator{ - autorest.WithBaseURL(to.String(plslr.NextLink)), + autorest.WithBaseURL(pointer.StringDeref(plslr.NextLink, "")), } return c.armClient.PrepareGetRequest(ctx, decorators...) } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/interface.go index 6ca0fd56bb5c..d18b182d57b3 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/interface.go @@ -19,14 +19,14 @@ package privatelinkserviceclient import ( "context" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) const ( // APIVersion is the API version for network. - APIVersion = "2021-08-01" + APIVersion = "2022-07-01" // AzureStackCloudAPIVersion is the API version for Azure Stack AzureStackCloudAPIVersion = "2019-03-01" // AzureStackCloudName is the cloud name of Azure Stack diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/mockprivatelinkserviceclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/mockprivatelinkserviceclient/interface.go index eca997adfbc4..4225a88089d5 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/mockprivatelinkserviceclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/privatelinkserviceclient/mockprivatelinkserviceclient/interface.go @@ -25,7 +25,7 @@ import ( context "context" reflect "reflect" - network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" gomock "github.com/golang/mock/gomock" retry "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/publicipclient/azure_publicipclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/publicipclient/azure_publicipclient.go index 3f76b8425e4d..86722c5647d5 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/publicipclient/azure_publicipclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/publicipclient/azure_publicipclient.go @@ -23,13 +23,13 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/to" "k8s.io/client-go/util/flowcontrol" "k8s.io/klog/v2" + "k8s.io/utils/pointer" azclients "sigs.k8s.io/cloud-provider-azure/pkg/azureclients" "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient" @@ -278,7 +278,7 @@ func (c *Client) listPublicIPAddress(ctx context.Context, resourceGroupName stri result = append(result, page.Values()...) // Abort the loop when there's no nextLink in the response. - if to.String(page.Response().NextLink) == "" { + if pointer.StringDeref(page.Response().NextLink, "") == "" { break } @@ -415,12 +415,12 @@ func (c *Client) listResponder(resp *http.Response) (result network.PublicIPAddr // publicIPAddressListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (c *Client) publicIPAddressListResultPreparer(ctx context.Context, lr network.PublicIPAddressListResult) (*http.Request, error) { - if lr.NextLink == nil || len(to.String(lr.NextLink)) < 1 { + if lr.NextLink == nil || len(pointer.StringDeref(lr.NextLink, "")) < 1 { return nil, nil } decorators := []autorest.PrepareDecorator{ - autorest.WithBaseURL(to.String(lr.NextLink)), + autorest.WithBaseURL(pointer.StringDeref(lr.NextLink, "")), } return c.armClient.PrepareGetRequest(ctx, decorators...) } @@ -543,7 +543,7 @@ func (c *Client) listAllPublicIPAddress(ctx context.Context) ([]network.PublicIP result = append(result, page.Values()...) // Abort the loop when there's no nextLink in the response. - if to.String(page.Response().NextLink) == "" { + if pointer.StringDeref(page.Response().NextLink, "") == "" { break } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/publicipclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/publicipclient/interface.go index 670c07a0213b..241216151c9f 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/publicipclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/publicipclient/interface.go @@ -19,14 +19,14 @@ package publicipclient import ( "context" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) const ( // APIVersion is the API version for network. - APIVersion = "2021-08-01" + APIVersion = "2022-07-01" // AzureStackCloudAPIVersion is the API version for Azure Stack AzureStackCloudAPIVersion = "2018-11-01" diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/publicipclient/mockpublicipclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/publicipclient/mockpublicipclient/interface.go index eb22ba64c160..a0ad22b4877c 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/publicipclient/mockpublicipclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/publicipclient/mockpublicipclient/interface.go @@ -25,7 +25,7 @@ import ( context "context" reflect "reflect" - network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" gomock "github.com/golang/mock/gomock" retry "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routeclient/azure_routeclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routeclient/azure_routeclient.go index b071beee0a5c..1e63b53b7d52 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routeclient/azure_routeclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routeclient/azure_routeclient.go @@ -22,7 +22,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routeclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routeclient/interface.go index c552888a54d7..163436ec140f 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routeclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routeclient/interface.go @@ -19,14 +19,14 @@ package routeclient import ( "context" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) const ( // APIVersion is the API version for network. - APIVersion = "2021-08-01" + APIVersion = "2022-07-01" // AzureStackCloudAPIVersion is the API version for Azure Stack AzureStackCloudAPIVersion = "2018-11-01" // AzureStackCloudName is the cloud name of Azure Stack diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routeclient/mockrouteclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routeclient/mockrouteclient/interface.go index 914a43eb8abd..12285f340a4b 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routeclient/mockrouteclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routeclient/mockrouteclient/interface.go @@ -25,7 +25,7 @@ import ( context "context" reflect "reflect" - network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" gomock "github.com/golang/mock/gomock" retry "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routetableclient/azure_routetableclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routetableclient/azure_routetableclient.go index fbfaba6f7b6a..1eea86106d87 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routetableclient/azure_routetableclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routetableclient/azure_routetableclient.go @@ -22,7 +22,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routetableclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routetableclient/interface.go index 1b467558939a..1ef8cfc08a32 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routetableclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routetableclient/interface.go @@ -19,14 +19,14 @@ package routetableclient import ( "context" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) const ( // APIVersion is the API version for network. - APIVersion = "2021-08-01" + APIVersion = "2022-07-01" // AzureStackCloudAPIVersion is the API version for Azure Stack AzureStackCloudAPIVersion = "2018-11-01" // AzureStackCloudName is the cloud name of Azure Stack diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routetableclient/mockroutetableclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routetableclient/mockroutetableclient/interface.go index 2f350b48cd9f..605683bcf199 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routetableclient/mockroutetableclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/routetableclient/mockroutetableclient/interface.go @@ -25,7 +25,7 @@ import ( context "context" reflect "reflect" - network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" gomock "github.com/golang/mock/gomock" retry "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/securitygroupclient/azure_securitygroupclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/securitygroupclient/azure_securitygroupclient.go index dd76e6064f74..d81c3179a7d3 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/securitygroupclient/azure_securitygroupclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/securitygroupclient/azure_securitygroupclient.go @@ -22,13 +22,13 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/to" "k8s.io/client-go/util/flowcontrol" "k8s.io/klog/v2" + "k8s.io/utils/pointer" azclients "sigs.k8s.io/cloud-provider-azure/pkg/azureclients" "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient" @@ -203,7 +203,7 @@ func (c *Client) listSecurityGroup(ctx context.Context, resourceGroupName string result = append(result, page.Values()...) // Abort the loop when there's no nextLink in the response. - if to.String(page.Response().NextLink) == "" { + if pointer.StringDeref(page.Response().NextLink, "") == "" { break } @@ -344,12 +344,12 @@ func (c *Client) listResponder(resp *http.Response) (result network.SecurityGrou // securityGroupListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (c *Client) securityGroupListResultPreparer(ctx context.Context, sglr network.SecurityGroupListResult) (*http.Request, error) { - if sglr.NextLink == nil || len(to.String(sglr.NextLink)) < 1 { + if sglr.NextLink == nil || len(pointer.StringDeref(sglr.NextLink, "")) < 1 { return nil, nil } decorators := []autorest.PrepareDecorator{ - autorest.WithBaseURL(to.String(sglr.NextLink)), + autorest.WithBaseURL(pointer.StringDeref(sglr.NextLink, "")), } return c.armClient.PrepareGetRequest(ctx, decorators...) } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/securitygroupclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/securitygroupclient/interface.go index 807eefd2d240..983834c56401 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/securitygroupclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/securitygroupclient/interface.go @@ -19,14 +19,14 @@ package securitygroupclient import ( "context" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) const ( // APIVersion is the API version for network. - APIVersion = "2021-08-01" + APIVersion = "2022-07-01" // AzureStackCloudAPIVersion is the API version for Azure Stack AzureStackCloudAPIVersion = "2018-11-01" // AzureStackCloudName is the cloud name of Azure Stack diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/securitygroupclient/mocksecuritygroupclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/securitygroupclient/mocksecuritygroupclient/interface.go index 53c5b8e2fc24..dafbfbce4b7f 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/securitygroupclient/mocksecuritygroupclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/securitygroupclient/mocksecuritygroupclient/interface.go @@ -25,7 +25,7 @@ import ( context "context" reflect "reflect" - network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" gomock "github.com/golang/mock/gomock" retry "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/snapshotclient/azure_snapshotclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/snapshotclient/azure_snapshotclient.go index b67d6ca1d725..ddb58f4b498a 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/snapshotclient/azure_snapshotclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/snapshotclient/azure_snapshotclient.go @@ -25,10 +25,10 @@ import ( "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/to" "k8s.io/client-go/util/flowcontrol" "k8s.io/klog/v2" + "k8s.io/utils/pointer" azclients "sigs.k8s.io/cloud-provider-azure/pkg/azureclients" "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient" @@ -329,7 +329,7 @@ func (c *Client) listSnapshotsByResourceGroup(ctx context.Context, subsID, resou result = append(result, page.Values()...) // Abort the loop when there's no nextLink in the response. - if to.String(page.Response().NextLink) == "" { + if pointer.StringDeref(page.Response().NextLink, "") == "" { break } @@ -355,12 +355,12 @@ func (c *Client) listResponder(resp *http.Response) (result compute.SnapshotList // SnapshotListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (c *Client) SnapshotListResultPreparer(ctx context.Context, lr compute.SnapshotList) (*http.Request, error) { - if lr.NextLink == nil || len(to.String(lr.NextLink)) < 1 { + if lr.NextLink == nil || len(pointer.StringDeref(lr.NextLink, "")) < 1 { return nil, nil } decorators := []autorest.PrepareDecorator{ - autorest.WithBaseURL(to.String(lr.NextLink)), + autorest.WithBaseURL(pointer.StringDeref(lr.NextLink, "")), } return c.armClient.PrepareGetRequest(ctx, decorators...) } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/storageaccountclient/azure_storageaccountclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/storageaccountclient/azure_storageaccountclient.go index 35e0bb6d185b..7a41f02decbb 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/storageaccountclient/azure_storageaccountclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/storageaccountclient/azure_storageaccountclient.go @@ -25,10 +25,10 @@ import ( "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/to" "k8s.io/client-go/util/flowcontrol" "k8s.io/klog/v2" + "k8s.io/utils/pointer" azclients "sigs.k8s.io/cloud-provider-azure/pkg/azureclients" "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient" @@ -458,7 +458,7 @@ func (c *Client) ListStorageAccountByResourceGroup(ctx context.Context, subsID, result = append(result, page.Values()...) // Abort the loop when there's no nextLink in the response. - if to.String(page.Response().NextLink) == "" { + if pointer.StringDeref(page.Response().NextLink, "") == "" { break } @@ -484,12 +484,12 @@ func (c *Client) listResponder(resp *http.Response) (result storage.AccountListR // StorageAccountResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (c *Client) StorageAccountResultPreparer(ctx context.Context, lr storage.AccountListResult) (*http.Request, error) { - if lr.NextLink == nil || len(to.String(lr.NextLink)) < 1 { + if lr.NextLink == nil || len(pointer.StringDeref(lr.NextLink, "")) < 1 { return nil, nil } decorators := []autorest.PrepareDecorator{ - autorest.WithBaseURL(to.String(lr.NextLink)), + autorest.WithBaseURL(pointer.StringDeref(lr.NextLink, "")), } return c.armClient.PrepareGetRequest(ctx, decorators...) } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/subnetclient/azure_subnetclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/subnetclient/azure_subnetclient.go index d90f29f17a9b..7ea0c6a2f198 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/subnetclient/azure_subnetclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/subnetclient/azure_subnetclient.go @@ -22,13 +22,13 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/to" "k8s.io/client-go/util/flowcontrol" "k8s.io/klog/v2" + "k8s.io/utils/pointer" azclients "sigs.k8s.io/cloud-provider-azure/pkg/azureclients" "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient" @@ -211,7 +211,7 @@ func (c *Client) listSubnet(ctx context.Context, resourceGroupName string, virtu result = append(result, page.Values()...) // Abort the loop when there's no nextLink in the response. - if to.String(page.Response().NextLink) == "" { + if pointer.StringDeref(page.Response().NextLink, "") == "" { break } @@ -350,12 +350,12 @@ func (c *Client) listResponder(resp *http.Response) (result network.SubnetListRe // subnetListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (c *Client) subnetListResultPreparer(ctx context.Context, lblr network.SubnetListResult) (*http.Request, error) { - if lblr.NextLink == nil || len(to.String(lblr.NextLink)) < 1 { + if lblr.NextLink == nil || len(pointer.StringDeref(lblr.NextLink, "")) < 1 { return nil, nil } decorators := []autorest.PrepareDecorator{ - autorest.WithBaseURL(to.String(lblr.NextLink)), + autorest.WithBaseURL(pointer.StringDeref(lblr.NextLink, "")), } return c.armClient.PrepareGetRequest(ctx, decorators...) } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/subnetclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/subnetclient/interface.go index 21967c0b74ea..fb6cc85656d7 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/subnetclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/subnetclient/interface.go @@ -19,14 +19,14 @@ package subnetclient import ( "context" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) const ( // APIVersion is the API version for network. - APIVersion = "2021-08-01" + APIVersion = "2022-07-01" // AzureStackCloudAPIVersion is the API version for Azure Stack AzureStackCloudAPIVersion = "2018-11-01" // AzureStackCloudName is the cloud name of Azure Stack diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/subnetclient/mocksubnetclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/subnetclient/mocksubnetclient/interface.go index a954980ec7d4..30f162e11593 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/subnetclient/mocksubnetclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/subnetclient/mocksubnetclient/interface.go @@ -25,7 +25,7 @@ import ( context "context" reflect "reflect" - network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" gomock "github.com/golang/mock/gomock" retry "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmasclient/azure_vmasclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmasclient/azure_vmasclient.go index 9e2ab7459143..03f84acdf276 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmasclient/azure_vmasclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmasclient/azure_vmasclient.go @@ -25,10 +25,10 @@ import ( "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/to" "k8s.io/client-go/util/flowcontrol" "k8s.io/klog/v2" + "k8s.io/utils/pointer" azclients "sigs.k8s.io/cloud-provider-azure/pkg/azureclients" "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient" @@ -203,7 +203,7 @@ func (c *Client) listVMAS(ctx context.Context, resourceGroupName string) ([]comp result = append(result, page.Values()...) // Abort the loop when there's no nextLink in the response. - if to.String(page.Response().NextLink) == "" { + if pointer.StringDeref(page.Response().NextLink, "") == "" { break } @@ -229,12 +229,12 @@ func (c *Client) listResponder(resp *http.Response) (result compute.Availability // availabilitySetListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (c *Client) availabilitySetListResultPreparer(ctx context.Context, vmaslr compute.AvailabilitySetListResult) (*http.Request, error) { - if vmaslr.NextLink == nil || len(to.String(vmaslr.NextLink)) < 1 { + if vmaslr.NextLink == nil || len(pointer.StringDeref(vmaslr.NextLink, "")) < 1 { return nil, nil } decorators := []autorest.PrepareDecorator{ - autorest.WithBaseURL(to.String(vmaslr.NextLink)), + autorest.WithBaseURL(pointer.StringDeref(vmaslr.NextLink, "")), } return c.armClient.PrepareGetRequest(ctx, decorators...) } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmclient/azure_vmclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmclient/azure_vmclient.go index c3357964e31d..eef92eed431c 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmclient/azure_vmclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmclient/azure_vmclient.go @@ -25,10 +25,10 @@ import ( "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/to" "k8s.io/client-go/util/flowcontrol" "k8s.io/klog/v2" + "k8s.io/utils/pointer" azclients "sigs.k8s.io/cloud-provider-azure/pkg/azureclients" "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient" @@ -204,7 +204,7 @@ func (c *Client) listVM(ctx context.Context, resourceGroupName string) ([]comput result = append(result, page.Values()...) // Abort the loop when there's no nextLink in the response. - if to.String(page.Response().NextLink) == "" { + if pointer.StringDeref(page.Response().NextLink, "") == "" { break } @@ -310,7 +310,7 @@ func (c *Client) listVmssFlexVMs(ctx context.Context, vmssFlexID string, statusO result = append(result, page.Values()...) // Abort the loop when there's no nextLink in the response. - if to.String(page.Response().NextLink) == "" { + if pointer.StringDeref(page.Response().NextLink, "") == "" { break } @@ -324,34 +324,32 @@ func (c *Client) listVmssFlexVMs(ctx context.Context, vmssFlexID string, statusO } // Update updates a VirtualMachine. -func (c *Client) Update(ctx context.Context, resourceGroupName string, VMName string, parameters compute.VirtualMachineUpdate, source string) *retry.Error { +func (c *Client) Update(ctx context.Context, resourceGroupName string, VMName string, parameters compute.VirtualMachineUpdate, source string) (*compute.VirtualMachine, *retry.Error) { mc := metrics.NewMetricContext("vm", "update", resourceGroupName, c.subscriptionID, source) // Report errors if the client is rate limited. if !c.rateLimiterWriter.TryAccept() { mc.RateLimitedCount() - return retry.GetRateLimitError(true, "VMUpdate") + return nil, retry.GetRateLimitError(true, "VMUpdate") } // Report errors if the client is throttled. if c.RetryAfterWriter.After(time.Now()) { mc.ThrottledCount() rerr := retry.GetThrottlingError("VMUpdate", "client throttled", c.RetryAfterWriter) - return rerr + return nil, rerr } - rerr := c.updateVM(ctx, resourceGroupName, VMName, parameters, source) + result, rerr := c.updateVM(ctx, resourceGroupName, VMName, parameters, source) mc.Observe(rerr) if rerr != nil { if rerr.IsThrottled() { // Update RetryAfterReader so that no more requests would be sent until RetryAfter expires. c.RetryAfterWriter = rerr.RetryAfter } - - return rerr + return result, rerr } - - return nil + return result, rerr } // UpdateAsync updates a VirtualMachine asynchronously @@ -393,7 +391,7 @@ func (c *Client) UpdateAsync(ctx context.Context, resourceGroupName string, VMNa } // WaitForUpdateResult waits for the response of the update request -func (c *Client) WaitForUpdateResult(ctx context.Context, future *azure.Future, resourceGroupName, source string) *retry.Error { +func (c *Client) WaitForUpdateResult(ctx context.Context, future *azure.Future, resourceGroupName, source string) (*compute.VirtualMachine, *retry.Error) { mc := metrics.NewMetricContext("vm", "wait_for_update_result", resourceGroupName, c.subscriptionID, source) response, err := c.armClient.WaitForAsyncOperationResult(ctx, future, "VMWaitForUpdateResult") mc.Observe(retry.NewErrorOrNil(false, err)) @@ -405,13 +403,24 @@ func (c *Client) WaitForUpdateResult(ctx context.Context, future *azure.Future, } else { klog.V(5).Infof("Received error in WaitForAsyncOperationResult: '%s', no response", err.Error()) } - return retry.GetError(response, err) + return nil, retry.GetError(response, err) } - return nil + if response != nil && response.StatusCode != http.StatusNoContent { + result, rerr := c.updateResponder(response) + if rerr != nil { + klog.V(5).Infof("Received error in WaitForAsyncOperationResult updateResponder: '%s'", rerr.Error()) + } + + return result, rerr + } + + result := &compute.VirtualMachine{} + result.Response = autorest.Response{Response: response} + return result, nil } // updateVM updates a VirtualMachine. -func (c *Client) updateVM(ctx context.Context, resourceGroupName string, VMName string, parameters compute.VirtualMachineUpdate, source string) *retry.Error { +func (c *Client) updateVM(ctx context.Context, resourceGroupName string, VMName string, parameters compute.VirtualMachineUpdate, source string) (*compute.VirtualMachine, *retry.Error) { resourceID := armclient.GetResourceID( c.subscriptionID, resourceGroupName, @@ -423,18 +432,20 @@ func (c *Client) updateVM(ctx context.Context, resourceGroupName string, VMName defer c.armClient.CloseResponse(ctx, response) if rerr != nil { klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "vm.put.request", resourceID, rerr.Error()) - return rerr + return nil, rerr } if response != nil && response.StatusCode != http.StatusNoContent { - _, rerr = c.updateResponder(response) + result, rerr := c.updateResponder(response) if rerr != nil { klog.V(5).Infof("Received error in %s: resourceID: %s, error: %s", "vm.put.respond", resourceID, rerr.Error()) - return rerr } + return result, rerr } - return nil + result := &compute.VirtualMachine{} + result.Response = autorest.Response{Response: response} + return result, nil } func (c *Client) updateResponder(resp *http.Response) (*compute.VirtualMachine, *retry.Error) { @@ -463,12 +474,12 @@ func (c *Client) listResponder(resp *http.Response) (result compute.VirtualMachi // vmListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (c *Client) vmListResultPreparer(ctx context.Context, vmlr compute.VirtualMachineListResult) (*http.Request, error) { - if vmlr.NextLink == nil || len(to.String(vmlr.NextLink)) < 1 { + if vmlr.NextLink == nil || len(pointer.StringDeref(vmlr.NextLink, "")) < 1 { return nil, nil } decorators := []autorest.PrepareDecorator{ - autorest.WithBaseURL(to.String(vmlr.NextLink)), + autorest.WithBaseURL(pointer.StringDeref(vmlr.NextLink, "")), } return c.armClient.PrepareGetRequest(ctx, decorators...) } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmclient/interface.go index 5c41811df258..20058fa980b2 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmclient/interface.go @@ -53,13 +53,13 @@ type Interface interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, VMName string, parameters compute.VirtualMachine, source string) *retry.Error // Update updates a VirtualMachine. - Update(ctx context.Context, resourceGroupName string, VMName string, parameters compute.VirtualMachineUpdate, source string) *retry.Error + Update(ctx context.Context, resourceGroupName string, VMName string, parameters compute.VirtualMachineUpdate, source string) (*compute.VirtualMachine, *retry.Error) // UpdateAsync updates a VirtualMachine asynchronously UpdateAsync(ctx context.Context, resourceGroupName string, VMName string, parameters compute.VirtualMachineUpdate, source string) (*azure.Future, *retry.Error) // WaitForUpdateResult waits for the response of the update request - WaitForUpdateResult(ctx context.Context, future *azure.Future, resourceGroupName, source string) *retry.Error + WaitForUpdateResult(ctx context.Context, future *azure.Future, resourceGroupName, source string) (*compute.VirtualMachine, *retry.Error) // Delete deletes a VirtualMachine. Delete(ctx context.Context, resourceGroupName string, VMName string) *retry.Error diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmclient/mockvmclient/interface.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmclient/mockvmclient/interface.go index 4ecd399f50f8..29845eec0745 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmclient/mockvmclient/interface.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmclient/mockvmclient/interface.go @@ -143,11 +143,12 @@ func (mr *MockInterfaceMockRecorder) ListVmssFlexVMsWithoutInstanceView(ctx, vms } // Update mocks base method. -func (m *MockInterface) Update(ctx context.Context, resourceGroupName, VMName string, parameters compute.VirtualMachineUpdate, source string) *retry.Error { +func (m *MockInterface) Update(ctx context.Context, resourceGroupName, VMName string, parameters compute.VirtualMachineUpdate, source string) (*compute.VirtualMachine, *retry.Error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Update", ctx, resourceGroupName, VMName, parameters, source) - ret0, _ := ret[0].(*retry.Error) - return ret0 + ret0, _ := ret[0].(*compute.VirtualMachine) + ret1, _ := ret[1].(*retry.Error) + return ret0, ret1 } // Update indicates an expected call of Update. @@ -172,11 +173,12 @@ func (mr *MockInterfaceMockRecorder) UpdateAsync(ctx, resourceGroupName, VMName, } // WaitForUpdateResult mocks base method. -func (m *MockInterface) WaitForUpdateResult(ctx context.Context, future *azure.Future, resourceGroupName, source string) *retry.Error { +func (m *MockInterface) WaitForUpdateResult(ctx context.Context, future *azure.Future, resourceGroupName, source string) (*compute.VirtualMachine, *retry.Error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "WaitForUpdateResult", ctx, future, resourceGroupName, source) - ret0, _ := ret[0].(*retry.Error) - return ret0 + ret0, _ := ret[0].(*compute.VirtualMachine) + ret1, _ := ret[1].(*retry.Error) + return ret0, ret1 } // WaitForUpdateResult indicates an expected call of WaitForUpdateResult. diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssclient/azure_vmssclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssclient/azure_vmssclient.go index d2c194e4991e..165c0b902eed 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssclient/azure_vmssclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssclient/azure_vmssclient.go @@ -25,10 +25,10 @@ import ( "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/to" "k8s.io/client-go/util/flowcontrol" "k8s.io/klog/v2" + "k8s.io/utils/pointer" azclients "sigs.k8s.io/cloud-provider-azure/pkg/azureclients" "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient" @@ -207,7 +207,7 @@ func (c *Client) listVMSS(ctx context.Context, resourceGroupName string) ([]comp result = append(result, page.Values()...) // Abort the loop when there's no nextLink in the response. - if to.String(page.Response().NextLink) == "" { + if pointer.StringDeref(page.Response().NextLink, "") == "" { break } @@ -366,12 +366,12 @@ func (c *Client) listResponder(resp *http.Response) (result compute.VirtualMachi // virtualMachineScaleSetListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (c *Client) virtualMachineScaleSetListResultPreparer(ctx context.Context, vmsslr compute.VirtualMachineScaleSetListResult) (*http.Request, error) { - if vmsslr.NextLink == nil || len(to.String(vmsslr.NextLink)) < 1 { + if vmsslr.NextLink == nil || len(pointer.StringDeref(vmsslr.NextLink, "")) < 1 { return nil, nil } decorators := []autorest.PrepareDecorator{ - autorest.WithBaseURL(to.String(vmsslr.NextLink)), + autorest.WithBaseURL(pointer.StringDeref(vmsslr.NextLink, "")), } return c.armClient.PrepareGetRequest(ctx, decorators...) } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssvmclient/azure_vmssvmclient.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssvmclient/azure_vmssvmclient.go index 4f44248cedd6..8694022b753e 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssvmclient/azure_vmssvmclient.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmssvmclient/azure_vmssvmclient.go @@ -25,11 +25,11 @@ import ( "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/to" utilerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/client-go/util/flowcontrol" "k8s.io/klog/v2" + "k8s.io/utils/pointer" azclients "sigs.k8s.io/cloud-provider-azure/pkg/azureclients" "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/armclient" @@ -217,7 +217,7 @@ func (c *Client) listVMSSVM(ctx context.Context, resourceGroupName string, virtu result = append(result, page.Values()...) // Abort the loop when there's no nextLink in the response. - if to.String(page.Response().NextLink) == "" { + if pointer.StringDeref(page.Response().NextLink, "") == "" { break } @@ -383,12 +383,12 @@ func (c *Client) listResponder(resp *http.Response) (result compute.VirtualMachi // virtualMachineScaleSetListResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. func (c *Client) virtualMachineScaleSetVMListResultPreparer(ctx context.Context, vmssvmlr compute.VirtualMachineScaleSetVMListResult) (*http.Request, error) { - if vmssvmlr.NextLink == nil || len(to.String(vmssvmlr.NextLink)) < 1 { + if vmssvmlr.NextLink == nil || len(pointer.StringDeref(vmssvmlr.NextLink, "")) < 1 { return nil, nil } decorators := []autorest.PrepareDecorator{ - autorest.WithBaseURL(to.String(vmssvmlr.NextLink)), + autorest.WithBaseURL(pointer.StringDeref(vmssvmlr.NextLink, "")), } return c.armClient.PrepareGetRequest(ctx, decorators...) } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/cache/azure_cache.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/cache/azure_cache.go index d165c1f5f771..3e061ed32d78 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/cache/azure_cache.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/cache/azure_cache.go @@ -189,9 +189,16 @@ func (t *TimedCache) Set(key string, data interface{}) { // Update updates the data cache for the key. func (t *TimedCache) Update(key string, data interface{}) { - _ = t.Store.Update(&AzureCacheEntry{ - Key: key, - Data: data, - CreatedOn: time.Now().UTC(), - }) + if entry, err := t.getInternal(key); err == nil { + entry.Lock.Lock() + defer entry.Lock.Unlock() + entry.Data = data + entry.CreatedOn = time.Now().UTC() + } else { + _ = t.Store.Update(&AzureCacheEntry{ + Key: key, + Data: data, + CreatedOn: time.Now().UTC(), + }) + } } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/consts/consts.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/consts/consts.go index 04838b5d1d3c..1f0b1b40fbf0 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/consts/consts.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/consts/consts.go @@ -201,12 +201,20 @@ var ( false: "service.beta.kubernetes.io/azure-load-balancer-ipv4", true: "service.beta.kubernetes.io/azure-load-balancer-ipv6", } + // ServiceAnnotationPIPName specifies the pip that will be applied to load balancer + ServiceAnnotationPIPNameDualStack = map[bool]string{ + false: "service.beta.kubernetes.io/azure-pip-name", + true: "service.beta.kubernetes.io/azure-pip-name-ipv6", + } + // ServiceAnnotationPIPPrefixID specifies the pip prefix that will be applied to the load balancer. + ServiceAnnotationPIPPrefixIDDualStack = map[bool]string{ + false: "service.beta.kubernetes.io/azure-pip-prefix-id", + true: "service.beta.kubernetes.io/azure-pip-prefix-id-ipv6", + } ) // load balancer const ( - // PreConfiguredBackendPoolLoadBalancerTypesNone means that the load balancers are not pre-configured - PreConfiguredBackendPoolLoadBalancerTypesNone = "" // PreConfiguredBackendPoolLoadBalancerTypesInternal means that the `internal` load balancers are pre-configured PreConfiguredBackendPoolLoadBalancerTypesInternal = "internal" // PreConfiguredBackendPoolLoadBalancerTypesExternal means that the `external` load balancers are pre-configured @@ -260,12 +268,6 @@ const ( // to specify the resource group of load balancer objects that are not in the same resource group as the cluster. ServiceAnnotationLoadBalancerResourceGroup = "service.beta.kubernetes.io/azure-load-balancer-resource-group" - // ServiceAnnotationPIPName specifies the pip that will be applied to load balancer - ServiceAnnotationPIPName = "service.beta.kubernetes.io/azure-pip-name" - - // ServiceAnnotationPIPPrefixID specifies the pip prefix that will be applied to the load balancer. - ServiceAnnotationPIPPrefixID = "service.beta.kubernetes.io/azure-pip-prefix-id" - // ServiceAnnotationIPTagsForPublicIP specifies the iptags used when dynamically creating a public ip ServiceAnnotationIPTagsForPublicIP = "service.beta.kubernetes.io/azure-pip-ip-tags" @@ -352,6 +354,8 @@ const ( FrontendIPConfigNameMaxLength = 80 // LoadBalancerRuleNameMaxLength is the max length of the load balancing rule LoadBalancerRuleNameMaxLength = 80 + // IPFamilySuffixLength is the length of suffix length of IP family ("-IPv4", "-IPv6") + IPFamilySuffixLength = 5 // LoadBalancerBackendPoolConfigurationTypeNodeIPConfiguration is the lb backend pool config type node IP configuration LoadBalancerBackendPoolConfigurationTypeNodeIPConfiguration = "nodeIPConfiguration" @@ -360,9 +364,6 @@ const ( // LoadBalancerBackendPoolConfigurationTypePODIP is the lb backend pool config type pod ip // TODO (nilo19): support pod IP in the future LoadBalancerBackendPoolConfigurationTypePODIP = "podIP" - - // To get pip, we need both resource group name and pip name, key in cache has format: pip_rg:pip_name - PIPCacheKeySeparator = ":" ) // error messages @@ -383,6 +384,8 @@ const ( CannotUpdateVMBeingDeletedMessagePrefix = "'Put on Virtual Machine Scale Set VM Instance' is not allowed on Virtual Machine Scale Set" // CannotUpdateVMBeingDeletedMessageSuffix is the suffix of the error message that the request failed due to delete a VM that is being deleted CannotUpdateVMBeingDeletedMessageSuffix = "since it is marked for deletion" + // OperationPreemptedErrorCode is the error code returned for vm operation preempted errors + OperationPreemptedErrorCode = "OperationPreempted" ) // node ipam controller diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/consts/helpers.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/consts/helpers.go index b800e9c64458..ec42a5bd87fc 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/consts/helpers.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/consts/helpers.go @@ -60,6 +60,16 @@ func IsLBRuleOnK8sServicePortDisabled(annotations map[string]string, port int32) return expectAttributeInSvcAnnotationBeEqualTo(annotations, BuildAnnotationKeyForPort(port, PortAnnotationNoLBRule), TrueAnnotationValue), nil } +// IsPLSProxyProtocolEnabled return true if ServiceAnnotationPLSProxyProtocol is true +func IsPLSProxyProtocolEnabled(annotations map[string]string) bool { + return expectAttributeInSvcAnnotationBeEqualTo(annotations, ServiceAnnotationPLSProxyProtocol, TrueAnnotationValue) +} + +// IsPLSEnabled return true if ServiceAnnotationPLSCreation is true +func IsPLSEnabled(annotations map[string]string) bool { + return expectAttributeInSvcAnnotationBeEqualTo(annotations, ServiceAnnotationPLSCreation, TrueAnnotationValue) +} + // Getint32ValueFromK8sSvcAnnotation get health probe configuration for port func Getint32ValueFromK8sSvcAnnotation(annotations map[string]string, key string, validators ...Int32BusinessValidator) (*int32, error) { val, err := GetAttributeValueInSvcAnnotation(annotations, key) @@ -90,10 +100,10 @@ type Int32BusinessValidator func(*int32) error // getInt32FromAnnotations parse integer value from annotation and return an reference to int32 object func extractInt32FromString(val string, businessValidator ...Int32BusinessValidator) (*int32, error) { val = strings.TrimSpace(val) - errKey := fmt.Errorf("%s value must be a whole number", val) + errKey := fmt.Sprintf("%s value must be a whole number", val) toInt, err := strconv.ParseInt(val, 10, 32) if err != nil { - return nil, fmt.Errorf("error value: %w: %v", err, errKey) + return nil, fmt.Errorf("error value: %w: %s", err, errKey) } parsedInt := int32(toInt) for _, validator := range businessValidator { diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/nodemanager/nodemanager.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/nodemanager/nodemanager.go index 898c3dd7affd..077600e821dc 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/nodemanager/nodemanager.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/nodemanager/nodemanager.go @@ -21,6 +21,7 @@ import ( "encoding/json" "errors" "fmt" + "net" "strings" "time" @@ -62,17 +63,44 @@ type NodeProvider interface { GetPlatformSubFaultDomain() (string, error) } -// labelReconcileInfo lists Node labels to reconcile, and how to reconcile them. +// labelReconcile holds information about a label to reconcile and how to reconcile it. // primaryKey and secondaryKey are keys of labels to reconcile. // - If both keys exist, but their values don't match. Use the value from the // primaryKey as the source of truth to reconcile. // - If ensureSecondaryExists is true, and the secondaryKey does not // exist, secondaryKey will be added with the value of the primaryKey. -var labelReconcileInfo = []struct { +type labelReconcile struct { primaryKey string secondaryKey string ensureSecondaryExists bool -}{} +} + +// betaToplogyLabels lists beta topology labels that are deprecated and will +// be removed in a future release. +// For now we reconcile them optionally onto nodes. +var betaToplogyLabels = []labelReconcile{ + { + // Reconcile the beta and the GA zone label using the GA label as + // the source of truth + primaryKey: v1.LabelZoneFailureDomainStable, + secondaryKey: v1.LabelZoneFailureDomain, + ensureSecondaryExists: true, + }, + { + // Reconcile the beta and the stable region label using the GA label as + // the source of truth + primaryKey: v1.LabelZoneRegionStable, + secondaryKey: v1.LabelZoneRegion, + ensureSecondaryExists: true, + }, + { + // Reconcile the beta and the stable instance-type label using the GA label as + // the source of truth + primaryKey: v1.LabelInstanceTypeStable, + secondaryKey: v1.LabelInstanceType, + ensureSecondaryExists: true, + }, +} // UpdateNodeSpecBackoff is the back configure for node update. var UpdateNodeSpecBackoff = wait.Backoff{ @@ -87,6 +115,11 @@ var updateNetworkConditionBackoff = wait.Backoff{ Jitter: 1.0, } +const ( + v4Suffix = "IPv4" + v6Suffix = "IPv6" +) + // CloudNodeController reconciles node information. type CloudNodeController struct { nodeName string @@ -97,6 +130,10 @@ type CloudNodeController struct { recorder record.EventRecorder nodeStatusUpdateFrequency time.Duration + + labelReconcileInfo []labelReconcile + + enableBetaTopologyLabels bool } // NewCloudNodeController creates a CloudNodeController object @@ -106,7 +143,7 @@ func NewCloudNodeController( kubeClient clientset.Interface, nodeProvider NodeProvider, nodeStatusUpdateFrequency time.Duration, - waitForRoutes bool) *CloudNodeController { + waitForRoutes, enableBetaTopologyLabels bool) *CloudNodeController { eventBroadcaster := record.NewBroadcaster() recorder := eventBroadcaster.NewRecorder(scheme.Scheme, v1.EventSource{Component: "cloud-node-controller"}) @@ -126,6 +163,12 @@ func NewCloudNodeController( nodeProvider: nodeProvider, waitForRoutes: waitForRoutes, nodeStatusUpdateFrequency: nodeStatusUpdateFrequency, + enableBetaTopologyLabels: enableBetaTopologyLabels, + } + + // Only reconcile the beta toplogy labels when the feature flag is enabled. + if cnc.enableBetaTopologyLabels { + cnc.labelReconcileInfo = append(cnc.labelReconcileInfo, betaToplogyLabels...) } // Use shared informer to listen to add/update of nodes. Note that any nodes @@ -184,7 +227,7 @@ func (cnc *CloudNodeController) reconcileNodeLabels(node *v1.Node) error { } labelsToUpdate := map[string]string{} - for _, r := range labelReconcileInfo { + for _, r := range cnc.labelReconcileInfo { primaryValue, primaryExists := node.Labels[r.primaryKey] secondaryValue, secondaryExists := node.Labels[r.secondaryKey] @@ -439,55 +482,54 @@ func (cnc *CloudNodeController) getNodeModifiersFromCloudProvider(ctx context.Co if instanceType, err := cnc.getInstanceTypeByName(ctx, node); err != nil { return nil, err } else if instanceType != "" { - klog.V(2).Infof("Adding node label from cloud provider: %s=%s", v1.LabelInstanceTypeStable, instanceType) - nodeModifiers = append(nodeModifiers, func(n *v1.Node) { - if n.Labels == nil { - n.Labels = map[string]string{} - } - n.Labels[v1.LabelInstanceTypeStable] = instanceType - }) + nodeModifiers = append(nodeModifiers, addCloudNodeLabel(v1.LabelInstanceTypeStable, instanceType)) + if cnc.enableBetaTopologyLabels { + nodeModifiers = append(nodeModifiers, addCloudNodeLabel(v1.LabelInstanceType, instanceType)) + } } + zone, err := cnc.getZoneByName(ctx, node) if err != nil { return nil, fmt.Errorf("failed to get zone from cloud provider: %w", err) } if zone.FailureDomain != "" { - klog.V(2).Infof("Adding node label from cloud provider: %s=%s", v1.LabelZoneFailureDomainStable, zone.FailureDomain) - nodeModifiers = append(nodeModifiers, func(n *v1.Node) { - if n.Labels == nil { - n.Labels = map[string]string{} - } - n.Labels[v1.LabelZoneFailureDomainStable] = zone.FailureDomain - }) + nodeModifiers = append(nodeModifiers, addCloudNodeLabel(v1.LabelZoneFailureDomainStable, zone.FailureDomain)) + if cnc.enableBetaTopologyLabels { + nodeModifiers = append(nodeModifiers, addCloudNodeLabel(v1.LabelZoneFailureDomain, zone.FailureDomain)) + } } if zone.Region != "" { - klog.V(2).Infof("Adding node label from cloud provider: %s=%s", v1.LabelZoneRegionStable, zone.Region) - nodeModifiers = append(nodeModifiers, func(n *v1.Node) { - if n.Labels == nil { - n.Labels = map[string]string{} - } - n.Labels[v1.LabelZoneRegionStable] = zone.Region - }) + nodeModifiers = append(nodeModifiers, addCloudNodeLabel(v1.LabelZoneRegionStable, zone.Region)) + if cnc.enableBetaTopologyLabels { + nodeModifiers = append(nodeModifiers, addCloudNodeLabel(v1.LabelZoneRegion, zone.Region)) + } } + platformSubFaultDomain, err := cnc.getPlatformSubFaultDomain() if err != nil { return nil, fmt.Errorf("failed to get platformSubFaultDomain: %w", err) } if platformSubFaultDomain != "" { - klog.V(2).Infof("Adding node label from cloud provider: %s=%s", consts.LabelPlatformSubFaultDomain, platformSubFaultDomain) - nodeModifiers = append(nodeModifiers, func(n *v1.Node) { - if n.Labels == nil { - n.Labels = map[string]string{} - } - n.Labels[consts.LabelPlatformSubFaultDomain] = platformSubFaultDomain - }) + nodeModifiers = append(nodeModifiers, addCloudNodeLabel(consts.LabelPlatformSubFaultDomain, platformSubFaultDomain)) } return nodeModifiers, nil } +// addCloudNodeLabel creates a nodeModifier that adds a label to a node. +func addCloudNodeLabel(key, value string) func(*v1.Node) { + klog.V(2).Infof("Adding node label from cloud provider: %s=%s", key, value) + return func(node *v1.Node) { + if node.Labels == nil { + node.Labels = map[string]string{} + } + node.Labels[key] = value + } +} + func GetCloudTaint(taints []v1.Taint) *v1.Taint { for _, taint := range taints { + taint := taint if taint.Key == cloudproviderapi.TaintExternalCloudProvider { return &taint } @@ -541,14 +583,24 @@ func nodeAddressesChangeDetected(addressSet1, addressSet2 []v1.NodeAddress) bool if len(addressSet1) != len(addressSet2) { return true } - addressMap1 := map[v1.NodeAddressType]string{} + addressMap1 := map[string]string{} for i := range addressSet1 { - addressMap1[addressSet1[i].Type] = addressSet1[i].Address + suffix := v4Suffix + if net.ParseIP(addressSet1[i].Address).To4() == nil { + suffix = v6Suffix + } + addrType := fmt.Sprintf("%s/%s", addressSet1[i].Type, suffix) + addressMap1[addrType] = addressSet1[i].Address } for _, v := range addressSet2 { - if addressMap1[v.Type] != v.Address { + suffix := v4Suffix + if net.ParseIP(v.Address).To4() == nil { + suffix = v6Suffix + } + addrType := fmt.Sprintf("%s/%s", v.Type, suffix) + if addressMap1[addrType] != v.Address { return true } } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure.go index caacea3ef63f..e470c41a25fa 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure.go @@ -21,7 +21,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "net/http" "os" "strings" @@ -79,11 +78,6 @@ import ( nodemanager "sigs.k8s.io/cloud-provider-azure/pkg/nodemanager" "sigs.k8s.io/cloud-provider-azure/pkg/retry" - // ensure the newly added package from azure-sdk-for-go is in vendor/ - _ "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/containerserviceclient" - // ensure the newly added package from azure-sdk-for-go is in vendor/ - _ "sigs.k8s.io/cloud-provider-azure/pkg/azureclients/deploymentclient" - "sigs.k8s.io/yaml" ) @@ -265,6 +259,12 @@ type Config struct { PutVMSSVMBatchSize int `json:"putVMSSVMBatchSize" yaml:"putVMSSVMBatchSize"` // PrivateLinkServiceResourceGroup determines the specific resource group of the private link services user want to use PrivateLinkServiceResourceGroup string `json:"privateLinkServiceResourceGroup,omitempty" yaml:"privateLinkServiceResourceGroup,omitempty"` + + // EnableMigrateToIPBasedBackendPoolAPI uses the migration API to migrate from NIC-based to IP-based backend pool. + // The migration API can provide a migration from NIC-based to IP-based backend pool without service downtime. + // If the API is not used, the migration will be done by decoupling all nodes on the backend pool and then re-attaching + // node IPs, which will introduce service downtime. The downtime increases with the number of nodes in the backend pool. + EnableMigrateToIPBasedBackendPoolAPI bool `json:"enableMigrateToIPBasedBackendPoolAPI" yaml:"enableMigrateToIPBasedBackendPoolAPI"` } type InitSecretConfig struct { @@ -331,17 +331,17 @@ type Cloud struct { // Lock for access to node caches, includes nodeZones, nodeResourceGroups, and unmanagedNodes. nodeCachesLock sync.RWMutex // nodeNames holds current nodes for tracking added nodes in VM caches. - nodeNames sets.String - // nodeZones is a mapping from Zone to a sets.String of Node's names in the Zone + nodeNames sets.Set[string] + // nodeZones is a mapping from Zone to a sets.Set[string] of Node's names in the Zone // it is updated by the nodeInformer - nodeZones map[string]sets.String + nodeZones map[string]sets.Set[string] // nodeResourceGroups holds nodes external resource groups nodeResourceGroups map[string]string // unmanagedNodes holds a list of nodes not managed by Azure cloud provider. - unmanagedNodes sets.String + unmanagedNodes sets.Set[string] // excludeLoadBalancerNodes holds a list of nodes that should be excluded from LoadBalancer. - excludeLoadBalancerNodes sets.String - nodePrivateIPs map[string]sets.String + excludeLoadBalancerNodes sets.Set[string] + nodePrivateIPs map[string]sets.Set[string] // nodeInformerSynced is for determining if the informer has synced. nodeInformerSynced cache.InformerSynced @@ -363,6 +363,9 @@ type Cloud struct { lbCache *azcache.TimedCache nsgCache *azcache.TimedCache rtCache *azcache.TimedCache + // public ip cache + // key: [resourceGroupName] + // Value: sync.Map of [pipName]*PublicIPAddress pipCache *azcache.TimedCache // use LB frontEndIpConfiguration ID as the key and search for PLS attached to the frontEnd plsCache *azcache.TimedCache @@ -439,13 +442,13 @@ func (az *Cloud) configSecretMetadata(secretName, secretNamespace, cloudConfigKe func NewCloudFromSecret(ctx context.Context, clientBuilder cloudprovider.ControllerClientBuilder, secretName, secretNamespace, cloudConfigKey string) (cloudprovider.Interface, error) { az := &Cloud{ - nodeNames: sets.NewString(), - nodeZones: map[string]sets.String{}, + nodeNames: sets.New[string](), + nodeZones: map[string]sets.Set[string]{}, nodeResourceGroups: map[string]string{}, - unmanagedNodes: sets.NewString(), + unmanagedNodes: sets.New[string](), routeCIDRs: map[string]string{}, - excludeLoadBalancerNodes: sets.NewString(), - nodePrivateIPs: map[string]sets.String{}, + excludeLoadBalancerNodes: sets.New[string](), + nodePrivateIPs: map[string]sets.Set[string]{}, } az.configSecretMetadata(secretName, secretNamespace, cloudConfigKey) @@ -471,13 +474,13 @@ func NewCloudWithoutFeatureGates(ctx context.Context, configReader io.Reader, ca } az := &Cloud{ - nodeNames: sets.NewString(), - nodeZones: map[string]sets.String{}, + nodeNames: sets.New[string](), + nodeZones: map[string]sets.Set[string]{}, nodeResourceGroups: map[string]string{}, - unmanagedNodes: sets.NewString(), + unmanagedNodes: sets.New[string](), routeCIDRs: map[string]string{}, - excludeLoadBalancerNodes: sets.NewString(), - nodePrivateIPs: map[string]sets.String{}, + excludeLoadBalancerNodes: sets.New[string](), + nodePrivateIPs: map[string]sets.Set[string]{}, } err = az.InitializeCloudFromConfig(ctx, config, false, callFromCCM) @@ -524,12 +527,12 @@ func (az *Cloud) InitializeCloudFromConfig(ctx context.Context, config *Config, // The default cloud config type is cloudConfigTypeMerge. config.CloudConfigType = cloudConfigTypeMerge } else { - supportedCloudConfigTypes := sets.NewString( + supportedCloudConfigTypes := sets.New( string(cloudConfigTypeMerge), string(cloudConfigTypeFile), string(cloudConfigTypeSecret)) if !supportedCloudConfigTypes.Has(string(config.CloudConfigType)) { - return fmt.Errorf("cloudConfigType %v is not supported, supported values are %v", config.CloudConfigType, supportedCloudConfigTypes.List()) + return fmt.Errorf("cloudConfigType %v is not supported, supported values are %v", config.CloudConfigType, supportedCloudConfigTypes.UnsortedList()) } } @@ -538,12 +541,12 @@ func (az *Cloud) InitializeCloudFromConfig(ctx context.Context, config *Config, strings.EqualFold(config.LoadBalancerBackendPoolConfigurationType, consts.LoadBalancerBackendPoolConfigurationTypePODIP) { config.LoadBalancerBackendPoolConfigurationType = consts.LoadBalancerBackendPoolConfigurationTypeNodeIPConfiguration } else { - supportedLoadBalancerBackendPoolConfigurationTypes := sets.NewString( + supportedLoadBalancerBackendPoolConfigurationTypes := sets.New( strings.ToLower(consts.LoadBalancerBackendPoolConfigurationTypeNodeIPConfiguration), strings.ToLower(consts.LoadBalancerBackendPoolConfigurationTypeNodeIP), strings.ToLower(consts.LoadBalancerBackendPoolConfigurationTypePODIP)) if !supportedLoadBalancerBackendPoolConfigurationTypes.Has(strings.ToLower(config.LoadBalancerBackendPoolConfigurationType)) { - return fmt.Errorf("loadBalancerBackendPoolConfigurationType %s is not supported, supported values are %v", config.LoadBalancerBackendPoolConfigurationType, supportedLoadBalancerBackendPoolConfigurationTypes.List()) + return fmt.Errorf("loadBalancerBackendPoolConfigurationType %s is not supported, supported values are %v", config.LoadBalancerBackendPoolConfigurationType, supportedLoadBalancerBackendPoolConfigurationTypes.UnsortedList()) } } @@ -709,6 +712,10 @@ func (az *Cloud) initCaches() (err error) { } func (az *Cloud) setLBDefaults(config *Config) error { + if config.LoadBalancerSku == "" { + config.LoadBalancerSku = consts.LoadBalancerSkuStandard + } + if strings.EqualFold(config.LoadBalancerSku, consts.LoadBalancerSkuStandard) { // Do not add master nodes to standard LB by default. if config.ExcludeMasterFromStandardLB == nil { @@ -921,7 +928,7 @@ func ParseConfig(configReader io.Reader) (*Config, error) { return nil, nil } - configContents, err := ioutil.ReadAll(configReader) + configContents, err := io.ReadAll(configReader) if err != nil { return nil, err } @@ -1007,20 +1014,10 @@ func initDiskControllers(az *Cloud) error { klog.V(2).Infof("attach/detach disk operation rate limit QPS: %f, Bucket: %d", qps, bucket) common := &controllerCommon{ - location: az.Location, - storageEndpointSuffix: az.Environment.StorageEndpointSuffix, - resourceGroup: az.ResourceGroup, - subscriptionID: az.SubscriptionID, - cloud: az, - lockMap: newLockMap(), - diskOpRateLimiter: flowcontrol.NewTokenBucketRateLimiter(qps, bucket), - } - - if az.HasExtendedLocation() { - common.extendedLocation = &ExtendedLocation{ - Name: az.ExtendedLocationName, - Type: az.ExtendedLocationType, - } + cloud: az, + lockMap: newLockMap(), + diskOpRateLimiter: flowcontrol.NewTokenBucketRateLimiter(qps, bucket), + AttachDetachInitialDelayInMs: defaultAttachDetachInitialDelayInMs, } az.ManagedDiskController = &ManagedDiskController{common: common} @@ -1125,7 +1122,7 @@ func (az *Cloud) updateNodeCaches(prevNode, newNode *v1.Node) { newZone, ok := newNode.ObjectMeta.Labels[consts.LabelFailureDomainBetaZone] if ok && az.isAvailabilityZone(newZone) { if az.nodeZones[newZone] == nil { - az.nodeZones[newZone] = sets.NewString() + az.nodeZones[newZone] = sets.New[string]() } az.nodeZones[newZone].Insert(newNode.ObjectMeta.Name) } @@ -1170,7 +1167,7 @@ func (az *Cloud) updateNodeCaches(prevNode, newNode *v1.Node) { // Add to nodePrivateIPs cache for _, address := range getNodePrivateIPAddresses(newNode) { if az.nodePrivateIPs[newNode.Name] == nil { - az.nodePrivateIPs[newNode.Name] = sets.NewString() + az.nodePrivateIPs[newNode.Name] = sets.New[string]() } klog.V(4).Infof("adding IP address %s of the node %s", address, newNode.Name) @@ -1180,7 +1177,7 @@ func (az *Cloud) updateNodeCaches(prevNode, newNode *v1.Node) { } // GetActiveZones returns all the zones in which k8s nodes are currently running. -func (az *Cloud) GetActiveZones() (sets.String, error) { +func (az *Cloud) GetActiveZones() (sets.Set[string], error) { if az.nodeInformerSynced == nil { return nil, fmt.Errorf("azure cloud provider doesn't have informers set") } @@ -1191,7 +1188,7 @@ func (az *Cloud) GetActiveZones() (sets.String, error) { return nil, fmt.Errorf("node informer is not synced when trying to GetActiveZones") } - zones := sets.NewString() + zones := sets.New[string]() for zone, nodes := range az.nodeZones { if len(nodes) > 0 { zones.Insert(zone) @@ -1228,7 +1225,7 @@ func (az *Cloud) GetNodeResourceGroup(nodeName string) (string, error) { } // GetNodeNames returns a set of all node names in the k8s cluster. -func (az *Cloud) GetNodeNames() (sets.String, error) { +func (az *Cloud) GetNodeNames() (sets.Set[string], error) { // Kubelet won't set az.nodeInformerSynced, return nil. if az.nodeInformerSynced == nil { return nil, nil @@ -1240,14 +1237,14 @@ func (az *Cloud) GetNodeNames() (sets.String, error) { return nil, fmt.Errorf("node informer is not synced when trying to GetNodeNames") } - return sets.NewString(az.nodeNames.List()...), nil + return sets.New(az.nodeNames.UnsortedList()...), nil } // GetResourceGroups returns a set of resource groups that all nodes are running on. -func (az *Cloud) GetResourceGroups() (sets.String, error) { +func (az *Cloud) GetResourceGroups() (sets.Set[string], error) { // Kubelet won't set az.nodeInformerSynced, always return configured resourceGroup. if az.nodeInformerSynced == nil { - return sets.NewString(az.ResourceGroup), nil + return sets.New(az.ResourceGroup), nil } az.nodeCachesLock.RLock() @@ -1256,7 +1253,7 @@ func (az *Cloud) GetResourceGroups() (sets.String, error) { return nil, fmt.Errorf("node informer is not synced when trying to GetResourceGroups") } - resourceGroups := sets.NewString(az.ResourceGroup) + resourceGroups := sets.New(az.ResourceGroup) for _, rg := range az.nodeResourceGroups { resourceGroups.Insert(rg) } @@ -1265,7 +1262,7 @@ func (az *Cloud) GetResourceGroups() (sets.String, error) { } // GetUnmanagedNodes returns a list of nodes not managed by Azure cloud provider (e.g. on-prem nodes). -func (az *Cloud) GetUnmanagedNodes() (sets.String, error) { +func (az *Cloud) GetUnmanagedNodes() (sets.Set[string], error) { // Kubelet won't set az.nodeInformerSynced, always return nil. if az.nodeInformerSynced == nil { return nil, nil @@ -1277,7 +1274,7 @@ func (az *Cloud) GetUnmanagedNodes() (sets.String, error) { return nil, fmt.Errorf("node informer is not synced when trying to GetUnmanagedNodes") } - return sets.NewString(az.unmanagedNodes.List()...), nil + return sets.New(az.unmanagedNodes.UnsortedList()...), nil } // ShouldNodeExcludedFromLoadBalancer returns true if node is unmanaged, in external resource group or labeled with "node.kubernetes.io/exclude-from-external-load-balancers". diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_backoff.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_backoff.go index fadf4353dc8f..68b2b58cb423 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_backoff.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_backoff.go @@ -17,16 +17,17 @@ limitations under the License. package provider import ( + "context" "encoding/json" "errors" "fmt" "net/http" "regexp" "strings" + "time" "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" - "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" @@ -35,6 +36,7 @@ import ( "k8s.io/apimachinery/pkg/util/wait" cloudprovider "k8s.io/cloud-provider" "k8s.io/klog/v2" + "k8s.io/utils/pointer" azcache "sigs.k8s.io/cloud-provider-azure/pkg/cache" "sigs.k8s.io/cloud-provider-azure/pkg/consts" @@ -152,7 +154,7 @@ func (az *Cloud) CreateOrUpdateSecurityGroup(sg network.SecurityGroup) error { ctx, cancel := getContextWithCancel() defer cancel() - rerr := az.SecurityGroupsClient.CreateOrUpdate(ctx, az.SecurityGroupResourceGroup, *sg.Name, sg, to.String(sg.Etag)) + rerr := az.SecurityGroupsClient.CreateOrUpdate(ctx, az.SecurityGroupResourceGroup, *sg.Name, sg, pointer.StringDeref(sg.Etag, "")) klog.V(10).Infof("SecurityGroupsClient.CreateOrUpdate(%s): end", *sg.Name) if rerr == nil { // Invalidate the cache right after updating @@ -161,7 +163,7 @@ func (az *Cloud) CreateOrUpdateSecurityGroup(sg network.SecurityGroup) error { } nsgJSON, _ := json.Marshal(sg) - klog.Warningf("CreateOrUpdateSecurityGroup(%s) failed: %v, NSG request: %s", to.String(sg.Name), rerr.Error(), string(nsgJSON)) + klog.Warningf("CreateOrUpdateSecurityGroup(%s) failed: %v, NSG request: %s", pointer.StringDeref(sg.Name, ""), rerr.Error(), string(nsgJSON)) // Invalidate the cache because ETAG precondition mismatch. if rerr.HTTPStatusCode == http.StatusPreconditionFailed { @@ -213,7 +215,7 @@ func (az *Cloud) CreateOrUpdateLB(service *v1.Service, lb network.LoadBalancer) lb = cleanupSubnetInFrontendIPConfigurations(&lb) rgName := az.getLoadBalancerResourceGroup() - rerr := az.LoadBalancerClient.CreateOrUpdate(ctx, rgName, to.String(lb.Name), lb, to.String(lb.Etag)) + rerr := az.LoadBalancerClient.CreateOrUpdate(ctx, rgName, pointer.StringDeref(lb.Name, ""), lb, pointer.StringDeref(lb.Etag, "")) klog.V(10).Infof("LoadBalancerClient.CreateOrUpdate(%s): end", *lb.Name) if rerr == nil { // Invalidate the cache right after updating @@ -222,18 +224,18 @@ func (az *Cloud) CreateOrUpdateLB(service *v1.Service, lb network.LoadBalancer) } lbJSON, _ := json.Marshal(lb) - klog.Warningf("LoadBalancerClient.CreateOrUpdate(%s) failed: %v, LoadBalancer request: %s", to.String(lb.Name), rerr.Error(), string(lbJSON)) + klog.Warningf("LoadBalancerClient.CreateOrUpdate(%s) failed: %v, LoadBalancer request: %s", pointer.StringDeref(lb.Name, ""), rerr.Error(), string(lbJSON)) // Invalidate the cache because ETAG precondition mismatch. if rerr.HTTPStatusCode == http.StatusPreconditionFailed { - klog.V(3).Infof("LoadBalancer cache for %s is cleanup because of http.StatusPreconditionFailed", to.String(lb.Name)) + klog.V(3).Infof("LoadBalancer cache for %s is cleanup because of http.StatusPreconditionFailed", pointer.StringDeref(lb.Name, "")) _ = az.lbCache.Delete(*lb.Name) } retryErrorMessage := rerr.Error().Error() // Invalidate the cache because another new operation has canceled the current request. if strings.Contains(strings.ToLower(retryErrorMessage), consts.OperationCanceledErrorMessage) { - klog.V(3).Infof("LoadBalancer cache for %s is cleanup because CreateOrUpdate is canceled by another operation", to.String(lb.Name)) + klog.V(3).Infof("LoadBalancer cache for %s is cleanup because CreateOrUpdate is canceled by another operation", pointer.StringDeref(lb.Name, "")) _ = az.lbCache.Delete(*lb.Name) } @@ -245,7 +247,7 @@ func (az *Cloud) CreateOrUpdateLB(service *v1.Service, lb network.LoadBalancer) return rerr.Error() } pipRG, pipName := matches[1], matches[2] - klog.V(3).Infof("The public IP %s referenced by load balancer %s is not in Succeeded provisioning state, will try to update it", pipName, to.String(lb.Name)) + klog.V(3).Infof("The public IP %s referenced by load balancer %s is not in Succeeded provisioning state, will try to update it", pipName, pointer.StringDeref(lb.Name, "")) pip, _, err := az.getPublicIPAddress(pipRG, pipName, azcache.CacheReadTypeDefault) if err != nil { klog.Errorf("Failed to get the public IP %s in resource group %s: %v", pipName, pipRG, err) @@ -269,8 +271,8 @@ func (az *Cloud) CreateOrUpdateLBBackendPool(lbName string, backendPool network. ctx, cancel := getContextWithCancel() defer cancel() - klog.V(4).Infof("CreateOrUpdateLBBackendPool: updating backend pool %s in LB %s", to.String(backendPool.Name), lbName) - rerr := az.LoadBalancerClient.CreateOrUpdateBackendPools(ctx, az.getLoadBalancerResourceGroup(), lbName, to.String(backendPool.Name), backendPool, to.String(backendPool.Etag)) + klog.V(4).Infof("CreateOrUpdateLBBackendPool: updating backend pool %s in LB %s", pointer.StringDeref(backendPool.Name, ""), lbName) + rerr := az.LoadBalancerClient.CreateOrUpdateBackendPools(ctx, az.getLoadBalancerResourceGroup(), lbName, pointer.StringDeref(backendPool.Name, ""), backendPool, pointer.StringDeref(backendPool.Etag, "")) if rerr == nil { // Invalidate the cache right after updating _ = az.lbCache.Delete(lbName) @@ -346,7 +348,7 @@ func (az *Cloud) ListManagedLBs(service *v1.Service, nodes []*v1.Node, clusterNa return nil, fmt.Errorf("ListManagedLBs: failed to get agent pool vmSet names: %w", err) } - agentPoolVMSetNamesSet := sets.NewString() + agentPoolVMSetNamesSet := sets.New[string]() if agentPoolVMSetNames != nil && len(*agentPoolVMSetNames) > 0 { for _, vmSetName := range *agentPoolVMSetNames { klog.V(6).Infof("ListManagedLBs: found agent pool vmSet name %s", vmSetName) @@ -355,11 +357,11 @@ func (az *Cloud) ListManagedLBs(service *v1.Service, nodes []*v1.Node, clusterNa } for _, lb := range allLBs { - vmSetNameFromLBName := az.mapLoadBalancerNameToVMSet(to.String(lb.Name), clusterName) - if strings.EqualFold(strings.TrimSuffix(to.String(lb.Name), consts.InternalLoadBalancerNameSuffix), clusterName) || + vmSetNameFromLBName := az.mapLoadBalancerNameToVMSet(pointer.StringDeref(lb.Name, ""), clusterName) + if strings.EqualFold(strings.TrimSuffix(pointer.StringDeref(lb.Name, ""), consts.InternalLoadBalancerNameSuffix), clusterName) || agentPoolVMSetNamesSet.Has(strings.ToLower(vmSetNameFromLBName)) { agentPoolLBs = append(agentPoolLBs, lb) - klog.V(4).Infof("ListManagedLBs: found agent pool LB %s", to.String(lb.Name)) + klog.V(4).Infof("ListManagedLBs: found agent pool LB %s", pointer.StringDeref(lb.Name, "")) } } @@ -385,53 +387,34 @@ func (az *Cloud) ListLB(service *v1.Service) ([]network.LoadBalancer, error) { return allLBs, nil } -// ListPIP list the PIP resources in the given resource group -func (az *Cloud) ListPIP(service *v1.Service, pipResourceGroup string) ([]network.PublicIPAddress, error) { - ctx, cancel := getContextWithCancel() - defer cancel() - - allPIPs, rerr := az.PublicIPAddressesClient.List(ctx, pipResourceGroup) - if rerr != nil { - if rerr.IsNotFound() { - return nil, nil - } - az.Event(service, v1.EventTypeWarning, "ListPublicIPs", rerr.Error().Error()) - klog.Errorf("PublicIPAddressesClient.List(%v) failure with err=%v", pipResourceGroup, rerr) - return nil, rerr.Error() - } - - klog.V(2).Infof("PublicIPAddressesClient.List(%v) success", pipResourceGroup) - return allPIPs, nil -} - // CreateOrUpdatePIP invokes az.PublicIPAddressesClient.CreateOrUpdate with exponential backoff retry func (az *Cloud) CreateOrUpdatePIP(service *v1.Service, pipResourceGroup string, pip network.PublicIPAddress) error { ctx, cancel := getContextWithCancel() defer cancel() - rerr := az.PublicIPAddressesClient.CreateOrUpdate(ctx, pipResourceGroup, to.String(pip.Name), pip) - klog.V(10).Infof("PublicIPAddressesClient.CreateOrUpdate(%s, %s): end", pipResourceGroup, to.String(pip.Name)) + rerr := az.PublicIPAddressesClient.CreateOrUpdate(ctx, pipResourceGroup, pointer.StringDeref(pip.Name, ""), pip) + klog.V(10).Infof("PublicIPAddressesClient.CreateOrUpdate(%s, %s): end", pipResourceGroup, pointer.StringDeref(pip.Name, "")) if rerr == nil { // Invalidate the cache right after updating - _ = az.pipCache.Delete(az.getPIPCacheKey(pipResourceGroup, to.String(pip.Name))) + _ = az.pipCache.Delete(pipResourceGroup) return nil } pipJSON, _ := json.Marshal(pip) - klog.Warningf("PublicIPAddressesClient.CreateOrUpdate(%s, %s) failed: %s, PublicIP request: %s", pipResourceGroup, to.String(pip.Name), rerr.Error().Error(), string(pipJSON)) + klog.Warningf("PublicIPAddressesClient.CreateOrUpdate(%s, %s) failed: %s, PublicIP request: %s", pipResourceGroup, pointer.StringDeref(pip.Name, ""), rerr.Error().Error(), string(pipJSON)) az.Event(service, v1.EventTypeWarning, "CreateOrUpdatePublicIPAddress", rerr.Error().Error()) // Invalidate the cache because ETAG precondition mismatch. if rerr.HTTPStatusCode == http.StatusPreconditionFailed { - klog.V(3).Infof("PublicIP cache for (%s, %s) is cleanup because of http.StatusPreconditionFailed", pipResourceGroup, to.String(pip.Name)) - _ = az.pipCache.Delete(az.getPIPCacheKey(pipResourceGroup, to.String(pip.Name))) + klog.V(3).Infof("PublicIP cache for (%s, %s) is cleanup because of http.StatusPreconditionFailed", pipResourceGroup, pointer.StringDeref(pip.Name, "")) + _ = az.pipCache.Delete(pipResourceGroup) } retryErrorMessage := rerr.Error().Error() // Invalidate the cache because another new operation has canceled the current request. if strings.Contains(strings.ToLower(retryErrorMessage), consts.OperationCanceledErrorMessage) { - klog.V(3).Infof("PublicIP cache for (%s, %s) is cleanup because CreateOrUpdate is canceled by another operation", pipResourceGroup, to.String(pip.Name)) - _ = az.pipCache.Delete(az.getPIPCacheKey(pipResourceGroup, to.String(pip.Name))) + klog.V(3).Infof("PublicIP cache for (%s, %s) is cleanup because CreateOrUpdate is canceled by another operation", pipResourceGroup, pointer.StringDeref(pip.Name, "")) + _ = az.pipCache.Delete(pipResourceGroup) } return rerr.Error() @@ -471,7 +454,7 @@ func (az *Cloud) DeletePublicIP(service *v1.Service, pipResourceGroup string, pi } // Invalidate the cache right after deleting - _ = az.pipCache.Delete(az.getPIPCacheKey(pipResourceGroup, pipName)) + _ = az.pipCache.Delete(pipResourceGroup) return nil } @@ -498,7 +481,7 @@ func (az *Cloud) CreateOrUpdateRouteTable(routeTable network.RouteTable) error { ctx, cancel := getContextWithCancel() defer cancel() - rerr := az.RouteTablesClient.CreateOrUpdate(ctx, az.RouteTableResourceGroup, az.RouteTableName, routeTable, to.String(routeTable.Etag)) + rerr := az.RouteTablesClient.CreateOrUpdate(ctx, az.RouteTableResourceGroup, az.RouteTableName, routeTable, pointer.StringDeref(routeTable.Etag, "")) if rerr == nil { // Invalidate the cache right after updating _ = az.rtCache.Delete(*routeTable.Name) @@ -506,7 +489,7 @@ func (az *Cloud) CreateOrUpdateRouteTable(routeTable network.RouteTable) error { } rtJSON, _ := json.Marshal(routeTable) - klog.Warningf("RouteTablesClient.CreateOrUpdate(%s) failed: %v, RouteTable request: %s", to.String(routeTable.Name), rerr.Error(), string(rtJSON)) + klog.Warningf("RouteTablesClient.CreateOrUpdate(%s) failed: %v, RouteTable request: %s", pointer.StringDeref(routeTable.Name, ""), rerr.Error(), string(rtJSON)) // Invalidate the cache because etag mismatch. if rerr.HTTPStatusCode == http.StatusPreconditionFailed { @@ -527,7 +510,7 @@ func (az *Cloud) CreateOrUpdateRoute(route network.Route) error { ctx, cancel := getContextWithCancel() defer cancel() - rerr := az.RoutesClient.CreateOrUpdate(ctx, az.RouteTableResourceGroup, az.RouteTableName, *route.Name, route, to.String(route.Etag)) + rerr := az.RoutesClient.CreateOrUpdate(ctx, az.RouteTableResourceGroup, az.RouteTableName, *route.Name, route, pointer.StringDeref(route.Etag, "")) klog.V(10).Infof("RoutesClient.CreateOrUpdate(%s): end", *route.Name) if rerr == nil { _ = az.rtCache.Delete(az.RouteTableName) @@ -593,27 +576,27 @@ func (az *Cloud) CreateOrUpdatePLS(service *v1.Service, pls network.PrivateLinkS ctx, cancel := getContextWithCancel() defer cancel() - rerr := az.PrivateLinkServiceClient.CreateOrUpdate(ctx, az.PrivateLinkServiceResourceGroup, to.String(pls.Name), pls, to.String(pls.Etag)) + rerr := az.PrivateLinkServiceClient.CreateOrUpdate(ctx, az.PrivateLinkServiceResourceGroup, pointer.StringDeref(pls.Name, ""), pls, pointer.StringDeref(pls.Etag, "")) if rerr == nil { // Invalidate the cache right after updating - _ = az.plsCache.Delete(to.String((*pls.LoadBalancerFrontendIPConfigurations)[0].ID)) + _ = az.plsCache.Delete(pointer.StringDeref((*pls.LoadBalancerFrontendIPConfigurations)[0].ID, "")) return nil } rtJSON, _ := json.Marshal(pls) - klog.Warningf("PrivateLinkServiceClient.CreateOrUpdate(%s) failed: %v, PrivateLinkService request: %s", to.String(pls.Name), rerr.Error(), string(rtJSON)) + klog.Warningf("PrivateLinkServiceClient.CreateOrUpdate(%s) failed: %v, PrivateLinkService request: %s", pointer.StringDeref(pls.Name, ""), rerr.Error(), string(rtJSON)) // Invalidate the cache because etag mismatch. if rerr.HTTPStatusCode == http.StatusPreconditionFailed { - klog.V(3).Infof("Private link service cache for %s is cleanup because of http.StatusPreconditionFailed", to.String(pls.Name)) - _ = az.plsCache.Delete(to.String((*pls.LoadBalancerFrontendIPConfigurations)[0].ID)) + klog.V(3).Infof("Private link service cache for %s is cleanup because of http.StatusPreconditionFailed", pointer.StringDeref(pls.Name, "")) + _ = az.plsCache.Delete(pointer.StringDeref((*pls.LoadBalancerFrontendIPConfigurations)[0].ID, "")) } // Invalidate the cache because another new operation has canceled the current request. if strings.Contains(strings.ToLower(rerr.Error().Error()), consts.OperationCanceledErrorMessage) { - klog.V(3).Infof("Private link service for %s is cleanup because CreateOrUpdatePrivateLinkService is canceled by another operation", to.String(pls.Name)) - _ = az.plsCache.Delete(to.String((*pls.LoadBalancerFrontendIPConfigurations)[0].ID)) + klog.V(3).Infof("Private link service for %s is cleanup because CreateOrUpdatePrivateLinkService is canceled by another operation", pointer.StringDeref(pls.Name, "")) + _ = az.plsCache.Delete(pointer.StringDeref((*pls.LoadBalancerFrontendIPConfigurations)[0].ID, "")) } - klog.Errorf("PrivateLinkServiceClient.CreateOrUpdate(%s) failed: %v", to.String(pls.Name), rerr.Error()) + klog.Errorf("PrivateLinkServiceClient.CreateOrUpdate(%s) failed: %v", pointer.StringDeref(pls.Name, ""), rerr.Error()) return rerr.Error() } @@ -671,3 +654,54 @@ func (az *Cloud) CreateOrUpdateSubnet(service *v1.Service, subnet network.Subnet return nil } + +// MigrateToIPBasedBackendPoolAndWaitForCompletion use the migration API to migrate from +// NIC-based to IP-based LB backend pools. It also makes sure the number of IP addresses +// in the backend pools is expected. +func (az *Cloud) MigrateToIPBasedBackendPoolAndWaitForCompletion( + lbName string, backendPoolNames []string, nicsCountMap map[string]int, +) error { + if rerr := az.LoadBalancerClient.MigrateToIPBasedBackendPool(context.Background(), az.ResourceGroup, lbName, backendPoolNames); rerr != nil { + backendPoolNamesStr := strings.Join(backendPoolNames, ",") + klog.Errorf("MigrateToIPBasedBackendPoolAndWaitForCompletion: Failed to migrate to IP based backend pool for lb %s, backend pool %s: %s", lbName, backendPoolNamesStr, rerr.Error().Error()) + return rerr.Error() + } + + succeeded := make(map[string]bool) + for bpName := range nicsCountMap { + succeeded[bpName] = false + } + + err := wait.PollImmediate(5*time.Second, 10*time.Minute, func() (done bool, err error) { + for bpName, nicsCount := range nicsCountMap { + if succeeded[bpName] { + continue + } + + bp, rerr := az.LoadBalancerClient.GetLBBackendPool(context.Background(), az.ResourceGroup, lbName, bpName, "") + if rerr != nil { + klog.Errorf("MigrateToIPBasedBackendPoolAndWaitForCompletion: Failed to get backend pool %s for lb %s: %s", bpName, lbName, rerr.Error().Error()) + return false, rerr.Error() + } + + if countIPsOnBackendPool(bp) != nicsCount { + klog.V(4).Infof("MigrateToIPBasedBackendPoolAndWaitForCompletion: Expected IPs %s, current IPs %d, will retry in 5s", nicsCount, countIPsOnBackendPool(bp)) + return false, nil + } + succeeded[bpName] = true + } + return true, nil + }) + + if err != nil { + if errors.Is(err, wait.ErrWaitTimeout) { + klog.Warningf("MigrateToIPBasedBackendPoolAndWaitForCompletion: Timeout waiting for migration to IP based backend pool for lb %s, backend pool %s", lbName, strings.Join(backendPoolNames, ",")) + return nil + } + + klog.Errorf("MigrateToIPBasedBackendPoolAndWaitForCompletion: Failed to wait for migration to IP based backend pool for lb %s, backend pool %s: %s", lbName, strings.Join(backendPoolNames, ","), err.Error()) + return err + } + + return nil +} diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_common.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_common.go index 883e30e0c423..3d9cb400757b 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_common.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_common.go @@ -28,6 +28,7 @@ import ( "time" "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" + "github.com/Azure/go-autorest/autorest/azure" "k8s.io/apimachinery/pkg/types" kwait "k8s.io/apimachinery/pkg/util/wait" @@ -35,9 +36,11 @@ import ( cloudprovider "k8s.io/cloud-provider" volerr "k8s.io/cloud-provider/volume/errors" "k8s.io/klog/v2" + "k8s.io/utils/pointer" azcache "sigs.k8s.io/cloud-provider-azure/pkg/cache" "sigs.k8s.io/cloud-provider-azure/pkg/consts" + "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) const ( @@ -54,6 +57,13 @@ const ( attachDiskMapKeySuffix = "attachdiskmap" detachDiskMapKeySuffix = "detachdiskmap" + updateVMRetryDuration = time.Duration(1) * time.Second + updateVMRetryFactor = 3.0 + updateVMRetrySteps = 5 + + // default initial delay in milliseconds for batch disk attach/detach + defaultAttachDetachInitialDelayInMs = 1000 + // WriteAcceleratorEnabled support for Azure Write Accelerator on Azure Disks // https://docs.microsoft.com/azure/virtual-machines/windows/how-to-enable-write-accelerator WriteAcceleratorEnabled = "writeacceleratorenabled" @@ -72,26 +82,34 @@ var defaultBackOff = kwait.Backoff{ Jitter: 0.0, } +var updateVMBackoff = kwait.Backoff{ + Duration: updateVMRetryDuration, + Factor: updateVMRetryFactor, + Steps: updateVMRetrySteps, +} + var ( managedDiskPathRE = regexp.MustCompile(`.*/subscriptions/(?:.*)/resourceGroups/(?:.*)/providers/Microsoft.Compute/disks/(.+)`) diskSnapshotPathRE = regexp.MustCompile(`.*/subscriptions/(?:.*)/resourceGroups/(?:.*)/providers/Microsoft.Compute/snapshots/(.+)`) + errorCodeRE = regexp.MustCompile(`Code="(.*?)".*`) ) type controllerCommon struct { - subscriptionID string - location string - extendedLocation *ExtendedLocation - storageEndpointSuffix string - resourceGroup string - diskStateMap sync.Map // - lockMap *lockMap - cloud *Cloud + diskStateMap sync.Map // + lockMap *lockMap + cloud *Cloud // disk queue that is waiting for attach or detach on specific node // > attachDiskMap sync.Map detachDiskMap sync.Map // attach/detach disk rate limiter diskOpRateLimiter flowcontrol.RateLimiter + // DisableUpdateCache whether disable update cache in disk attach/detach + DisableUpdateCache bool + // DisableDiskLunCheck whether disable disk lun check after disk attach/detach + DisableDiskLunCheck bool + // AttachDetachInitialDelayInMs determines initial delay in milliseconds for batch disk attach/detach + AttachDetachInitialDelayInMs int } // AttachDiskOptions attach disk options @@ -220,7 +238,8 @@ func (c *controllerCommon) AttachDisk(ctx context.Context, async bool, diskName, } node := strings.ToLower(string(nodeName)) diskuri := strings.ToLower(diskURI) - if err := c.insertAttachDiskRequest(diskuri, node, &options); err != nil { + requestNum, err := c.insertAttachDiskRequest(diskuri, node, &options) + if err != nil { return -1, err } @@ -232,6 +251,11 @@ func (c *controllerCommon) AttachDisk(ctx context.Context, async bool, diskName, } }() + if c.AttachDetachInitialDelayInMs > 0 && requestNum == 1 { + klog.V(2).Infof("wait %dms for more requests on node %s, current disk attach: %s", c.AttachDetachInitialDelayInMs, node, diskURI) + time.Sleep(time.Duration(c.AttachDetachInitialDelayInMs) * time.Millisecond) + } + diskMap, err := c.cleanAttachDiskRequests(node) if err != nil { return -1, err @@ -242,8 +266,16 @@ func (c *controllerCommon) AttachDisk(ctx context.Context, async bool, diskName, return -1, err } - klog.V(2).Infof("Trying to attach volume %s lun %d to node %s, diskMap: %s", diskURI, lun, nodeName, diskMap) + klog.V(2).Infof("Trying to attach volume %s lun %d to node %s, diskMap len:%d, %s", diskURI, lun, nodeName, len(diskMap), diskMap) if len(diskMap) == 0 { + if !c.DisableDiskLunCheck { + // always check disk lun after disk attach complete + diskLun, vmState, errGetLun := c.GetDiskLun(diskName, diskURI, nodeName) + if errGetLun != nil { + return -1, fmt.Errorf("disk(%s) could not be found on node(%s), vmState: %s, error: %w", diskURI, nodeName, pointer.StringDeref(vmState, ""), errGetLun) + } + lun = diskLun + } return lun, nil } @@ -253,10 +285,20 @@ func (c *controllerCommon) AttachDisk(ctx context.Context, async bool, diskName, } c.diskStateMap.Store(disk, "attaching") defer c.diskStateMap.Delete(disk) - future, err := vmset.AttachDisk(ctx, nodeName, diskMap) + + defer func() { + // invalidate the cache if there is error in disk attach + if err != nil { + _ = vmset.DeleteCacheForNode(string(nodeName)) + } + }() + + var future *azure.Future + future, err = vmset.AttachDisk(ctx, nodeName, diskMap) if err != nil { return -1, err } + // err will be handled by waitForUpdateResult below if async && c.diskOpRateLimiter.TryAccept() { // unlock and wait for attach disk complete @@ -267,10 +309,51 @@ func (c *controllerCommon) AttachDisk(ctx context.Context, async bool, diskName, klog.Warningf("azureDisk - switch to batch operation due to rate limited, QPS: %f", c.diskOpRateLimiter.QPS()) } } - return lun, vmset.WaitForUpdateResult(ctx, future, nodeName, "attach_disk") + + if err = c.waitForUpdateResult(ctx, vmset, nodeName, future, err); err != nil { + return -1, err + } + + if !c.DisableDiskLunCheck { + // always check disk lun after disk attach complete + diskLun, vmState, errGetLun := c.GetDiskLun(diskName, diskURI, nodeName) + if errGetLun != nil { + return -1, fmt.Errorf("disk(%s) could not be found on node(%s), vmState: %s, error: %w", diskURI, nodeName, pointer.StringDeref(vmState, ""), errGetLun) + } + lun = diskLun + } + return lun, nil +} + +// waitForUpdateResult handles asynchronous VM update operations and retries with backoff if OperationPreempted error is observed +func (c *controllerCommon) waitForUpdateResult(ctx context.Context, vmset VMSet, nodeName types.NodeName, future *azure.Future, updateErr error) (err error) { + err = updateErr + if err == nil { + err = vmset.WaitForUpdateResult(ctx, future, nodeName, "attach_disk") + } + + if vmUpdateRequired(future, err) { + if derr := kwait.ExponentialBackoffWithContext(ctx, updateVMBackoff, func(ctx context.Context) (bool, error) { + klog.Errorf("Retry VM Update on node (%s) due to error (%v)", nodeName, err) + future, err = vmset.UpdateVMAsync(ctx, nodeName) + if err == nil { + err = vmset.WaitForUpdateResult(ctx, future, nodeName, "attach_disk") + } + return !vmUpdateRequired(future, err), nil + }); derr != nil { + err = derr + return + } + } + + if err != nil && configAccepted(future) { + err = retry.NewPartialUpdateError(err.Error()) + } + return } -func (c *controllerCommon) insertAttachDiskRequest(diskURI, nodeName string, options *AttachDiskOptions) error { +// insertAttachDiskRequest return (attachDiskRequestQueueLength, error) +func (c *controllerCommon) insertAttachDiskRequest(diskURI, nodeName string, options *AttachDiskOptions) (int, error) { var diskMap map[string]*AttachDiskOptions attachDiskMapKey := nodeName + attachDiskMapKeySuffix c.lockMap.LockEntry(attachDiskMapKey) @@ -278,7 +361,7 @@ func (c *controllerCommon) insertAttachDiskRequest(diskURI, nodeName string, opt v, ok := c.attachDiskMap.Load(nodeName) if ok { if diskMap, ok = v.(map[string]*AttachDiskOptions); !ok { - return fmt.Errorf("convert attachDiskMap failure on node(%s)", nodeName) + return -1, fmt.Errorf("convert attachDiskMap failure on node(%s)", nodeName) } } else { diskMap = make(map[string]*AttachDiskOptions) @@ -291,7 +374,7 @@ func (c *controllerCommon) insertAttachDiskRequest(diskURI, nodeName string, opt } else { diskMap[diskURI] = options } - return nil + return len(diskMap), nil } // clean up attach disk requests @@ -333,18 +416,24 @@ func (c *controllerCommon) DetachDisk(ctx context.Context, diskName, diskURI str node := strings.ToLower(string(nodeName)) disk := strings.ToLower(diskURI) - if err := c.insertDetachDiskRequest(diskName, disk, node); err != nil { + requestNum, err := c.insertDetachDiskRequest(diskName, disk, node) + if err != nil { return err } c.lockMap.LockEntry(node) defer c.lockMap.UnlockEntry(node) + + if c.AttachDetachInitialDelayInMs > 0 && requestNum == 1 { + klog.V(2).Infof("wait %dms for more requests on node %s, current disk detach: %s", c.AttachDetachInitialDelayInMs, node, diskURI) + time.Sleep(time.Duration(c.AttachDetachInitialDelayInMs) * time.Millisecond) + } diskMap, err := c.cleanDetachDiskRequests(node) if err != nil { return err } - klog.V(2).Infof("Trying to detach volume %s from node %s, diskMap: %s", diskURI, nodeName, diskMap) + klog.V(2).Infof("Trying to detach volume %s from node %s, diskMap len:%d, %s", diskURI, nodeName, len(diskMap), diskMap) if len(diskMap) > 0 { c.diskStateMap.Store(disk, "detaching") defer c.diskStateMap.Delete(disk) @@ -356,11 +445,6 @@ func (c *controllerCommon) DetachDisk(ctx context.Context, diskName, diskURI str return nil } } - } else { - lun, _, errGetLun := c.GetDiskLun(diskName, diskURI, nodeName) - if errGetLun == nil || !strings.Contains(errGetLun.Error(), consts.CannotFindDiskLUN) { - return fmt.Errorf("disk(%s) is still attached to node(%s) on lun(%d), error: %w", diskURI, nodeName, lun, errGetLun) - } } if err != nil { @@ -368,6 +452,14 @@ func (c *controllerCommon) DetachDisk(ctx context.Context, diskName, diskURI str return err } + if !c.DisableDiskLunCheck { + // always check disk lun after disk detach complete + lun, vmState, errGetLun := c.GetDiskLun(diskName, diskURI, nodeName) + if errGetLun == nil || !strings.Contains(errGetLun.Error(), consts.CannotFindDiskLUN) { + return fmt.Errorf("disk(%s) is still attached to node(%s) on lun(%d), vmState: %s, error: %w", diskURI, nodeName, lun, pointer.StringDeref(vmState, ""), errGetLun) + } + } + klog.V(2).Infof("azureDisk - detach disk(%s, %s) succeeded", diskName, diskURI) return nil } @@ -381,10 +473,17 @@ func (c *controllerCommon) UpdateVM(ctx context.Context, nodeName types.NodeName node := strings.ToLower(string(nodeName)) c.lockMap.LockEntry(node) defer c.lockMap.UnlockEntry(node) + + defer func() { + _ = vmset.DeleteCacheForNode(string(nodeName)) + }() + + klog.V(2).Infof("azureDisk - update: vm(%s)", nodeName) return vmset.UpdateVM(ctx, nodeName) } -func (c *controllerCommon) insertDetachDiskRequest(diskName, diskURI, nodeName string) error { +// insertDetachDiskRequest return (detachDiskRequestQueueLength, error) +func (c *controllerCommon) insertDetachDiskRequest(diskName, diskURI, nodeName string) (int, error) { var diskMap map[string]string detachDiskMapKey := nodeName + detachDiskMapKeySuffix c.lockMap.LockEntry(detachDiskMapKey) @@ -392,7 +491,7 @@ func (c *controllerCommon) insertDetachDiskRequest(diskName, diskURI, nodeName s v, ok := c.detachDiskMap.Load(nodeName) if ok { if diskMap, ok = v.(map[string]string); !ok { - return fmt.Errorf("convert detachDiskMap failure on node(%s)", nodeName) + return -1, fmt.Errorf("convert detachDiskMap failure on node(%s)", nodeName) } } else { diskMap = make(map[string]string) @@ -405,7 +504,7 @@ func (c *controllerCommon) insertDetachDiskRequest(diskName, diskURI, nodeName s } else { diskMap[diskURI] = diskName } - return nil + return len(diskMap), nil } // clean up detach disk requests @@ -620,6 +719,11 @@ func (c *controllerCommon) checkDiskExists(ctx context.Context, diskURI string) return true, nil } +func vmUpdateRequired(future *azure.Future, err error) bool { + errCode := getAzureErrorCode(err) + return configAccepted(future) && errCode == consts.OperationPreemptedErrorCode +} + func getValidCreationData(subscriptionID, resourceGroup, sourceResourceID, sourceType string) (compute.CreationData, error) { if sourceResourceID == "" { return compute.CreationData{ @@ -663,3 +767,21 @@ func isInstanceNotFoundError(err error) bool { } return strings.Contains(errMsg, errStatusCode400) && strings.Contains(errMsg, errInvalidParameter) && strings.Contains(errMsg, errTargetInstanceIds) } + +// getAzureErrorCode uses regex to parse out the error code encapsulated in the error string. +func getAzureErrorCode(err error) string { + if err == nil { + return "" + } + matches := errorCodeRE.FindStringSubmatch(err.Error()) + if matches == nil { + return "" + } + return matches[1] +} + +// configAccepted returns true if storage profile change had been committed (i.e. HTTP status code == 2xx) and returns false otherwise. +func configAccepted(future *azure.Future) bool { + // if status code indicates success, the storage profile change was committed + return future != nil && future.Response() != nil && future.Response().StatusCode/100 == 2 +} diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_standard.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_standard.go index 16ae72ec9840..6d760f562897 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_standard.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_standard.go @@ -24,13 +24,14 @@ import ( "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/to" "k8s.io/apimachinery/pkg/types" "k8s.io/klog/v2" + "k8s.io/utils/pointer" azcache "sigs.k8s.io/cloud-provider-azure/pkg/cache" "sigs.k8s.io/cloud-provider-azure/pkg/consts" + "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) // AttachDisk attaches a disk to vm @@ -88,7 +89,7 @@ func (as *availabilitySet) AttachDisk(ctx context.Context, nodeName types.NodeNa Caching: opt.cachingMode, CreateOption: "attach", ManagedDisk: managedDisk, - WriteAcceleratorEnabled: to.BoolPtr(opt.writeAcceleratorEnabled), + WriteAcceleratorEnabled: pointer.Bool(opt.writeAcceleratorEnabled), }) } @@ -100,10 +101,6 @@ func (as *availabilitySet) AttachDisk(ctx context.Context, nodeName types.NodeNa }, } klog.V(2).Infof("azureDisk - update(%s): vm(%s) - attach disk list(%s)", nodeResourceGroup, vmName, diskMap) - // Invalidate the cache right after updating - defer func() { - _ = as.DeleteCacheForNode(vmName) - }() future, rerr := as.VirtualMachinesClient.UpdateAsync(ctx, nodeResourceGroup, vmName, newVM, "attach_disk") if rerr != nil { @@ -124,8 +121,13 @@ func (as *availabilitySet) AttachDisk(ctx context.Context, nodeName types.NodeNa } func (as *availabilitySet) DeleteCacheForNode(nodeName string) error { - _ = as.cloud.vmCache.Delete(nodeName) - return nil + err := as.cloud.vmCache.Delete(nodeName) + if err == nil { + klog.V(2).Infof("DeleteCacheForNode(%s) successfully", nodeName) + } else { + klog.Errorf("DeleteCacheForNode(%s) failed with %v", nodeName, err) + } + return err } // WaitForUpdateResult waits for the response of the update request @@ -136,9 +138,17 @@ func (as *availabilitySet) WaitForUpdateResult(ctx context.Context, future *azur return err } - if rerr := as.VirtualMachinesClient.WaitForUpdateResult(ctx, future, nodeResourceGroup, source); rerr != nil { + result, rerr := as.VirtualMachinesClient.WaitForUpdateResult(ctx, future, nodeResourceGroup, source) + if rerr != nil { return rerr.Error() } + + // clean node cache first and then update cache + _ = as.DeleteCacheForNode(vmName) + if result != nil && result.VirtualMachineProperties != nil { + // if we have an updated result, we update the vmss vm cache + as.updateCache(vmName, result) + } return nil } @@ -168,7 +178,7 @@ func (as *availabilitySet) DetachDisk(ctx context.Context, nodeName types.NodeNa (disk.ManagedDisk != nil && diskURI != "" && strings.EqualFold(*disk.ManagedDisk.ID, diskURI)) { // found the disk klog.V(2).Infof("azureDisk - detach disk: name %s uri %s", diskName, diskURI) - disks[i].ToBeDetached = to.BoolPtr(true) + disks[i].ToBeDetached = pointer.Bool(true) bFoundDisk = true } } @@ -176,13 +186,13 @@ func (as *availabilitySet) DetachDisk(ctx context.Context, nodeName types.NodeNa if !bFoundDisk { // only log here, next action is to update VM status with original meta data - klog.Errorf("detach azure disk on node(%s): disk list(%s) not found", nodeName, diskMap) + klog.Warningf("detach azure disk on node(%s): disk list(%s) not found", nodeName, diskMap) } else { if strings.EqualFold(as.cloud.Environment.Name, consts.AzureStackCloudName) && !as.Config.DisableAzureStackCloud { // Azure stack does not support ToBeDetached flag, use original way to detach disk newDisks := []compute.DataDisk{} for _, disk := range disks { - if !to.Bool(disk.ToBeDetached) { + if !pointer.BoolDeref(disk.ToBeDetached, false) { newDisks = append(newDisks, disk) } } @@ -198,19 +208,28 @@ func (as *availabilitySet) DetachDisk(ctx context.Context, nodeName types.NodeNa }, } klog.V(2).Infof("azureDisk - update(%s): vm(%s) - detach disk list(%s)", nodeResourceGroup, vmName, nodeName, diskMap) - // Invalidate the cache right after updating + + var result *compute.VirtualMachine + var rerr *retry.Error defer func() { + // invalidate the cache right after updating _ = as.DeleteCacheForNode(vmName) + + // update the cache with the updated result only if its not nil + // and contains the VirtualMachineProperties + if rerr == nil && result != nil && result.VirtualMachineProperties != nil { + as.updateCache(vmName, result) + } }() - rerr := as.VirtualMachinesClient.Update(ctx, nodeResourceGroup, vmName, newVM, "detach_disk") + result, rerr = as.VirtualMachinesClient.Update(ctx, nodeResourceGroup, vmName, newVM, "detach_disk") if rerr != nil { klog.Errorf("azureDisk - detach disk list(%s) on rg(%s) vm(%s) failed, err: %v", diskMap, nodeResourceGroup, vmName, rerr) if rerr.HTTPStatusCode == http.StatusNotFound { klog.Errorf("azureDisk - begin to filterNonExistingDisks(%v) on rg(%s) vm(%s)", diskMap, nodeResourceGroup, vmName) disks := as.filterNonExistingDisks(ctx, *vm.StorageProfile.DataDisks) newVM.VirtualMachineProperties.StorageProfile.DataDisks = &disks - rerr = as.VirtualMachinesClient.Update(ctx, nodeResourceGroup, vmName, newVM, "detach_disk") + result, rerr = as.VirtualMachinesClient.Update(ctx, nodeResourceGroup, vmName, newVM, "detach_disk") } } @@ -223,23 +242,34 @@ func (as *availabilitySet) DetachDisk(ctx context.Context, nodeName types.NodeNa // UpdateVM updates a vm func (as *availabilitySet) UpdateVM(ctx context.Context, nodeName types.NodeName) error { + future, err := as.UpdateVMAsync(ctx, nodeName) + if err != nil { + return err + } + return as.WaitForUpdateResult(ctx, future, nodeName, "update_vm") +} + +// UpdateVMAsync updates a vm asynchronously +func (as *availabilitySet) UpdateVMAsync(ctx context.Context, nodeName types.NodeName) (*azure.Future, error) { vmName := mapNodeNameToVMName(nodeName) nodeResourceGroup, err := as.GetNodeResourceGroup(vmName) if err != nil { - return err + return nil, err } - klog.V(2).Infof("azureDisk - update(%s): vm(%s)", nodeResourceGroup, vmName) - // Invalidate the cache right after updating - defer func() { - _ = as.DeleteCacheForNode(vmName) - }() - rerr := as.VirtualMachinesClient.Update(ctx, nodeResourceGroup, vmName, compute.VirtualMachineUpdate{}, "update_vm") - klog.V(2).Infof("azureDisk - update(%s): vm(%s) - returned with %v", nodeResourceGroup, vmName, rerr) + future, rerr := as.VirtualMachinesClient.UpdateAsync(ctx, nodeResourceGroup, vmName, compute.VirtualMachineUpdate{}, "update_vm") if rerr != nil { - return rerr.Error() + return future, rerr.Error() } - return nil + return future, nil +} + +func (as *availabilitySet) updateCache(nodeName string, vm *compute.VirtualMachine) { + if as.common.DisableUpdateCache { + return + } + as.cloud.vmCache.Update(nodeName, vm) + klog.V(2).Infof("updateCache(%s) successfully", nodeName) } // GetDataDisks gets a list of data disks attached to the node. diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_vmss.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_vmss.go index 922bae588425..7240784ca6c0 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_vmss.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_vmss.go @@ -24,10 +24,10 @@ import ( "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/to" "k8s.io/apimachinery/pkg/types" "k8s.io/klog/v2" + "k8s.io/utils/pointer" azcache "sigs.k8s.io/cloud-provider-azure/pkg/cache" "sigs.k8s.io/cloud-provider-azure/pkg/consts" @@ -95,7 +95,7 @@ func (ss *ScaleSet) AttachDisk(ctx context.Context, nodeName types.NodeName, dis Caching: opt.cachingMode, CreateOption: "attach", ManagedDisk: managedDisk, - WriteAcceleratorEnabled: to.BoolPtr(opt.writeAcceleratorEnabled), + WriteAcceleratorEnabled: pointer.Bool(opt.writeAcceleratorEnabled), }) } @@ -107,11 +107,6 @@ func (ss *ScaleSet) AttachDisk(ctx context.Context, nodeName types.NodeName, dis }, } - // Invalidate the cache right after updating - defer func() { - _ = ss.DeleteCacheForNode(vmName) - }() - klog.V(2).Infof("azureDisk - update(%s): vm(%s) - attach disk list(%s)", nodeResourceGroup, nodeName, diskMap) future, rerr := ss.VirtualMachineScaleSetVMsClient.UpdateAsync(ctx, nodeResourceGroup, vm.VMSSName, vm.InstanceID, newVM, "attach_disk") if rerr != nil { @@ -139,23 +134,30 @@ func (ss *ScaleSet) WaitForUpdateResult(ctx context.Context, future *azure.Futur return err } - var result *compute.VirtualMachineScaleSetVM - var rerr *retry.Error - defer func() { - if rerr == nil && result != nil && result.VirtualMachineScaleSetVMProperties != nil { - // If we have an updated result, we update the vmss vm cache - vm, err := ss.getVmssVM(vmName, azcache.CacheReadTypeDefault) - if err != nil { - return - } - _ = ss.updateCache(vmName, nodeResourceGroup, vm.VMSSName, vm.InstanceID, result) - } - }() - - result, rerr = ss.VirtualMachineScaleSetVMsClient.WaitForUpdateResult(ctx, future, nodeResourceGroup, source) + result, rerr := ss.VirtualMachineScaleSetVMsClient.WaitForUpdateResult(ctx, future, nodeResourceGroup, source) if rerr != nil { return rerr.Error() } + + var vmssName, instanceID string + if result != nil && result.VirtualMachineScaleSetVMProperties != nil { + // get vmssName, instanceID from cache first + vm, err := ss.getVmssVM(vmName, azcache.CacheReadTypeDefault) + if err == nil && vm != nil { + vmssName = vm.VMSSName + instanceID = vm.InstanceID + } else { + klog.Errorf("getVmssVM failed with error(%v) or nil pointer", err) + } + } + + // clean node cache first and then update cache + _ = ss.DeleteCacheForNode(vmName) + if vmssName != "" && instanceID != "" { + if err := ss.updateCache(vmName, nodeResourceGroup, vmssName, instanceID, result); err != nil { + klog.Errorf("updateCache(%s, %s, %s, %s) failed with error: %v", vmName, nodeResourceGroup, vmssName, instanceID, err) + } + } return nil } @@ -189,7 +191,7 @@ func (ss *ScaleSet) DetachDisk(ctx context.Context, nodeName types.NodeName, dis (disk.ManagedDisk != nil && diskURI != "" && strings.EqualFold(*disk.ManagedDisk.ID, diskURI)) { // found the disk klog.V(2).Infof("azureDisk - detach disk: name %s uri %s", diskName, diskURI) - disks[i].ToBeDetached = to.BoolPtr(true) + disks[i].ToBeDetached = pointer.Bool(true) bFoundDisk = true } } @@ -197,13 +199,13 @@ func (ss *ScaleSet) DetachDisk(ctx context.Context, nodeName types.NodeName, dis if !bFoundDisk { // only log here, next action is to update VM status with original meta data - klog.Errorf("detach azure disk on node(%s): disk list(%s) not found", nodeName, diskMap) + klog.Warningf("detach azure disk on node(%s): disk list(%s) not found", nodeName, diskMap) } else { if strings.EqualFold(ss.cloud.Environment.Name, consts.AzureStackCloudName) && !ss.Config.DisableAzureStackCloud { // Azure stack does not support ToBeDetached flag, use original way to detach disk var newDisks []compute.DataDisk for _, disk := range disks { - if !to.Bool(disk.ToBeDetached) { + if !pointer.BoolDeref(disk.ToBeDetached, false) { newDisks = append(newDisks, disk) } } @@ -219,30 +221,23 @@ func (ss *ScaleSet) DetachDisk(ctx context.Context, nodeName types.NodeName, dis }, } - var updateResult *compute.VirtualMachineScaleSetVM + var result *compute.VirtualMachineScaleSetVM var rerr *retry.Error defer func() { - // If there is an error with Update operation, - // invalidate the cache - if rerr != nil { - _ = ss.DeleteCacheForNode(vmName) - return - } + _ = ss.DeleteCacheForNode(vmName) // Update the cache with the updated result only if its not nil // and contains the VirtualMachineScaleSetVMProperties - if updateResult != nil && updateResult.VirtualMachineScaleSetVMProperties != nil { - if err := ss.updateCache(vmName, nodeResourceGroup, vm.VMSSName, vm.InstanceID, updateResult); err != nil { - klog.Errorf("updateCache(%s, %s, %s) failed with error: %v", vmName, nodeResourceGroup, vm.VMSSName, vm.InstanceID, err) - // if err faced during updating cache, invalidate the cache - _ = ss.DeleteCacheForNode(vmName) + if rerr == nil && result != nil && result.VirtualMachineScaleSetVMProperties != nil { + if err := ss.updateCache(vmName, nodeResourceGroup, vm.VMSSName, vm.InstanceID, result); err != nil { + klog.Errorf("updateCache(%s, %s, %s, %s) failed with error: %v", vmName, nodeResourceGroup, vm.VMSSName, vm.InstanceID, err) } } }() klog.V(2).Infof("azureDisk - update(%s): vm(%s) - detach disk list(%s)", nodeResourceGroup, nodeName, diskMap) - updateResult, rerr = ss.VirtualMachineScaleSetVMsClient.Update(ctx, nodeResourceGroup, vm.VMSSName, vm.InstanceID, newVM, + result, rerr = ss.VirtualMachineScaleSetVMsClient.Update(ctx, nodeResourceGroup, vm.VMSSName, vm.InstanceID, newVM, "detach_disk") if rerr != nil { klog.Errorf("azureDisk - detach disk list(%s) on rg(%s) vm(%s) failed, err: %v", diskMap, nodeResourceGroup, nodeName, rerr) @@ -250,7 +245,7 @@ func (ss *ScaleSet) DetachDisk(ctx context.Context, nodeName types.NodeName, dis klog.Errorf("azureDisk - begin to filterNonExistingDisks(%v) on rg(%s) vm(%s)", diskMap, nodeResourceGroup, nodeName) disks := ss.filterNonExistingDisks(ctx, *newVM.VirtualMachineScaleSetVMProperties.StorageProfile.DataDisks) newVM.VirtualMachineScaleSetVMProperties.StorageProfile.DataDisks = &disks - updateResult, rerr = ss.VirtualMachineScaleSetVMsClient.Update(ctx, nodeResourceGroup, vm.VMSSName, vm.InstanceID, newVM, "detach_disk") + result, rerr = ss.VirtualMachineScaleSetVMsClient.Update(ctx, nodeResourceGroup, vm.VMSSName, vm.InstanceID, newVM, "detach_disk") } } @@ -263,47 +258,31 @@ func (ss *ScaleSet) DetachDisk(ctx context.Context, nodeName types.NodeName, dis // UpdateVM updates a vm func (ss *ScaleSet) UpdateVM(ctx context.Context, nodeName types.NodeName) error { + future, err := ss.UpdateVMAsync(ctx, nodeName) + if err != nil { + return err + } + return ss.WaitForUpdateResult(ctx, future, nodeName, "update_vm") +} + +// UpdateVMAsync updates a vm asynchronously +func (ss *ScaleSet) UpdateVMAsync(ctx context.Context, nodeName types.NodeName) (*azure.Future, error) { vmName := mapNodeNameToVMName(nodeName) vm, err := ss.getVmssVM(vmName, azcache.CacheReadTypeDefault) if err != nil { - return err + return nil, err } nodeResourceGroup, err := ss.GetNodeResourceGroup(vmName) if err != nil { - return err + return nil, err } - var updateResult *compute.VirtualMachineScaleSetVM - var rerr *retry.Error - - defer func() { - // If there is an error with Update operation, - // invalidate the cache - if rerr != nil { - _ = ss.DeleteCacheForNode(vmName) - return - } - - // Update the cache with the updated result only if its not nil - // and contains the VirtualMachineScaleSetVMProperties - if updateResult != nil && updateResult.VirtualMachineScaleSetVMProperties != nil { - if err := ss.updateCache(vmName, nodeResourceGroup, vm.VMSSName, vm.InstanceID, updateResult); err != nil { - klog.Errorf("updateCache(%s, %s, %s) failed with error: %v", vmName, nodeResourceGroup, vm.VMSSName, vm.InstanceID, err) - // if err faced during updating cache, invalidate the cache - _ = ss.DeleteCacheForNode(vmName) - } - } - }() - - klog.V(2).Infof("azureDisk - update(%s): vm(%s)", nodeResourceGroup, nodeName) - updateResult, rerr = ss.VirtualMachineScaleSetVMsClient.Update(ctx, nodeResourceGroup, vm.VMSSName, vm.InstanceID, compute.VirtualMachineScaleSetVM{}, "update_vmss_instance") - - klog.V(2).Infof("azureDisk - update(%s): vm(%s) - returned with %v", nodeResourceGroup, nodeName, rerr) + future, rerr := ss.VirtualMachineScaleSetVMsClient.UpdateAsync(ctx, nodeResourceGroup, vm.VMSSName, vm.InstanceID, compute.VirtualMachineScaleSetVM{}, "update_vmss_instance") if rerr != nil { - return rerr.Error() + return future, rerr.Error() } - return nil + return future, nil } // GetDataDisks gets a list of data disks attached to the node. diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_vmssflex.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_vmssflex.go index e8cab8553230..d3dd62592533 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_vmssflex.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_controller_vmssflex.go @@ -21,15 +21,17 @@ import ( "fmt" "net/http" "strings" + "sync" "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/to" "k8s.io/apimachinery/pkg/types" "k8s.io/klog/v2" + "k8s.io/utils/pointer" azcache "sigs.k8s.io/cloud-provider-azure/pkg/cache" "sigs.k8s.io/cloud-provider-azure/pkg/consts" + "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) // AttachDisk attaches a disk to vm @@ -87,7 +89,7 @@ func (fs *FlexScaleSet) AttachDisk(ctx context.Context, nodeName types.NodeName, Caching: opt.cachingMode, CreateOption: "attach", ManagedDisk: managedDisk, - WriteAcceleratorEnabled: to.BoolPtr(opt.writeAcceleratorEnabled), + WriteAcceleratorEnabled: pointer.Bool(opt.writeAcceleratorEnabled), }) } @@ -99,10 +101,6 @@ func (fs *FlexScaleSet) AttachDisk(ctx context.Context, nodeName types.NodeName, }, } - defer func() { - _ = fs.DeleteCacheForNode(vmName) - }() - klog.V(2).Infof("azureDisk - update(%s): vm(%s) - attach disk list(%s)", nodeResourceGroup, vmName, diskMap) future, rerr := fs.VirtualMachinesClient.UpdateAsync(ctx, nodeResourceGroup, *vm.Name, newVM, "attach_disk") @@ -149,7 +147,7 @@ func (fs *FlexScaleSet) DetachDisk(ctx context.Context, nodeName types.NodeName, (disk.ManagedDisk != nil && diskURI != "" && strings.EqualFold(*disk.ManagedDisk.ID, diskURI)) { // found the disk klog.V(2).Infof("azureDisk - detach disk: name %s uri %s", diskName, diskURI) - disks[i].ToBeDetached = to.BoolPtr(true) + disks[i].ToBeDetached = pointer.Bool(true) bFoundDisk = true } } @@ -157,13 +155,13 @@ func (fs *FlexScaleSet) DetachDisk(ctx context.Context, nodeName types.NodeName, if !bFoundDisk { // only log here, next action is to update VM status with original meta data - klog.Errorf("detach azure disk on node(%s): disk list(%s) not found", nodeName, diskMap) + klog.Warningf("detach azure disk on node(%s): disk list(%s) not found", nodeName, diskMap) } else { if strings.EqualFold(fs.cloud.Environment.Name, consts.AzureStackCloudName) && !fs.Config.DisableAzureStackCloud { // Azure stack does not support ToBeDetached flag, use original way to detach disk newDisks := []compute.DataDisk{} for _, disk := range disks { - if !to.Bool(disk.ToBeDetached) { + if !pointer.BoolDeref(disk.ToBeDetached, false) { newDisks = append(newDisks, disk) } } @@ -179,20 +177,30 @@ func (fs *FlexScaleSet) DetachDisk(ctx context.Context, nodeName types.NodeName, }, } + var result *compute.VirtualMachine + var rerr *retry.Error defer func() { _ = fs.DeleteCacheForNode(vmName) + + // update the cache with the updated result only if its not nil + // and contains the VirtualMachineProperties + if rerr == nil && result != nil && result.VirtualMachineProperties != nil { + if err := fs.updateCache(vmName, result); err != nil { + klog.Errorf("updateCache(%s) failed with error: %v", vmName, err) + } + } }() klog.V(2).Infof("azureDisk - update(%s): vm(%s) - detach disk list(%s)", nodeResourceGroup, vmName, nodeName, diskMap) - rerr := fs.VirtualMachinesClient.Update(ctx, nodeResourceGroup, *vm.Name, newVM, "detach_disk") + result, rerr = fs.VirtualMachinesClient.Update(ctx, nodeResourceGroup, *vm.Name, newVM, "detach_disk") if rerr != nil { klog.Errorf("azureDisk - detach disk list(%s) on rg(%s) vm(%s) failed, err: %v", diskMap, nodeResourceGroup, vmName, rerr) if rerr.HTTPStatusCode == http.StatusNotFound { klog.Errorf("azureDisk - begin to filterNonExistingDisks(%v) on rg(%s) vm(%s)", diskMap, nodeResourceGroup, vmName) disks := fs.filterNonExistingDisks(ctx, *vm.StorageProfile.DataDisks) newVM.VirtualMachineProperties.StorageProfile.DataDisks = &disks - rerr = fs.VirtualMachinesClient.Update(ctx, nodeResourceGroup, *vm.Name, newVM, "detach_disk") + result, rerr = fs.VirtualMachinesClient.Update(ctx, nodeResourceGroup, *vm.Name, newVM, "detach_disk") } } @@ -210,37 +218,85 @@ func (fs *FlexScaleSet) WaitForUpdateResult(ctx context.Context, future *azure.F if err != nil { return err } - if rerr := fs.VirtualMachinesClient.WaitForUpdateResult(ctx, future, nodeResourceGroup, source); rerr != nil { + result, rerr := fs.VirtualMachinesClient.WaitForUpdateResult(ctx, future, nodeResourceGroup, source) + if rerr != nil { return rerr.Error() } + + // clean node cache first and then update cache + _ = fs.DeleteCacheForNode(vmName) + if result != nil && result.VirtualMachineProperties != nil { + if err := fs.updateCache(vmName, result); err != nil { + klog.Errorf("updateCache(%s) failed with error: %v", vmName, err) + } + } return nil } // UpdateVM updates a vm func (fs *FlexScaleSet) UpdateVM(ctx context.Context, nodeName types.NodeName) error { + future, err := fs.UpdateVMAsync(ctx, nodeName) + if err != nil { + return err + } + return fs.WaitForUpdateResult(ctx, future, nodeName, "update_vm") +} + +// UpdateVMAsync updates a vm asynchronously +func (fs *FlexScaleSet) UpdateVMAsync(ctx context.Context, nodeName types.NodeName) (*azure.Future, error) { vmName := mapNodeNameToVMName(nodeName) vm, err := fs.getVmssFlexVM(vmName, azcache.CacheReadTypeDefault) if err != nil { // if host doesn't exist, no need to update - klog.Warningf("azureDisk - cannot find node %s, skip updating vm)", nodeName) - return nil + klog.Warningf("azureDisk - cannot find node %s, skip updating vm", nodeName) + return nil, nil } nodeResourceGroup, err := fs.GetNodeResourceGroup(vmName) if err != nil { - return err + return nil, err } - defer func() { - _ = fs.DeleteCacheForNode(vmName) - }() + future, rerr := fs.VirtualMachinesClient.UpdateAsync(ctx, nodeResourceGroup, *vm.Name, compute.VirtualMachineUpdate{}, "update_vm") + if rerr != nil { + return future, rerr.Error() + } + return future, nil +} - klog.V(2).Infof("azureDisk - update(%s): vm(%s)", nodeResourceGroup, vmName) +func (fs *FlexScaleSet) updateCache(nodeName string, vm *compute.VirtualMachine) error { + if fs.common.DisableUpdateCache { + return nil + } + if vm == nil { + return fmt.Errorf("vm is nil") + } + if vm.Name == nil { + return fmt.Errorf("vm.Name is nil") + } + if vm.VirtualMachineProperties == nil { + return fmt.Errorf("vm.VirtualMachineProperties is nil") + } + if vm.OsProfile == nil || vm.OsProfile.ComputerName == nil { + return fmt.Errorf("vm.OsProfile.ComputerName is nil") + } - rerr := fs.VirtualMachinesClient.Update(ctx, nodeResourceGroup, *vm.Name, compute.VirtualMachineUpdate{}, "update_vm") - klog.V(2).Infof("azureDisk - update(%s): vm(%s) - returned with %v", nodeResourceGroup, vmName, rerr) - if rerr != nil { - return rerr.Error() + vmssFlexID, err := fs.getNodeVmssFlexID(nodeName) + if err != nil { + return err } + + fs.lockMap.LockEntry(vmssFlexID) + defer fs.lockMap.UnlockEntry(vmssFlexID) + cached, err := fs.vmssFlexVMCache.Get(vmssFlexID, azcache.CacheReadTypeDefault) + if err != nil { + return err + } + vmMap := cached.(*sync.Map) + vmMap.Store(nodeName, vm) + + fs.vmssFlexVMNameToVmssID.Store(strings.ToLower(*vm.OsProfile.ComputerName), vmssFlexID) + fs.vmssFlexVMNameToNodeName.Store(*vm.Name, strings.ToLower(*vm.OsProfile.ComputerName)) + klog.V(2).Infof("updateCache(%s) for vmssFlexID(%s) successfully", nodeName, vmssFlexID) return nil } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_fakes.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_fakes.go index 8c849dd162fc..d136ca905319 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_fakes.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_fakes.go @@ -96,12 +96,12 @@ func GetTestCloud(ctrl *gomock.Controller) (az *Cloud) { VMType: consts.VMTypeStandard, LoadBalancerBackendPoolConfigurationType: consts.LoadBalancerBackendPoolConfigurationTypeNodeIPConfiguration, }, - nodeZones: map[string]sets.String{}, + nodeZones: map[string]sets.Set[string]{}, nodeInformerSynced: func() bool { return true }, nodeResourceGroups: map[string]string{}, - unmanagedNodes: sets.NewString(), - excludeLoadBalancerNodes: sets.NewString(), - nodePrivateIPs: map[string]sets.String{}, + unmanagedNodes: sets.New[string](), + excludeLoadBalancerNodes: sets.New[string](), + nodePrivateIPs: map[string]sets.Set[string]{}, routeCIDRs: map[string]string{}, eventRecorder: &record.FakeRecorder{}, } @@ -139,9 +139,5 @@ func GetTestCloudWithExtendedLocation(ctrl *gomock.Controller) (az *Cloud) { az = GetTestCloud(ctrl) az.Config.ExtendedLocationName = "microsoftlosangeles1" az.Config.ExtendedLocationType = "EdgeZone" - az.controllerCommon.extendedLocation = &ExtendedLocation{ - Name: az.Config.ExtendedLocationName, - Type: az.Config.ExtendedLocationType, - } return az } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_instance_metadata.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_instance_metadata.go index b403ff6d2208..38505d943ffb 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_instance_metadata.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_instance_metadata.go @@ -19,8 +19,9 @@ package provider import ( "encoding/json" "fmt" - "io/ioutil" + "io" "net/http" + "strings" "k8s.io/klog/v2" @@ -119,6 +120,33 @@ func NewInstanceMetadataService(imdsServer string) (*InstanceMetadataService, er return ims, nil } +// fillNetInterfacePublicIPs finds PIPs from imds load balancer and fills them into net interface config. +func fillNetInterfacePublicIPs(publicIPs []PublicIPMetadata, netInterface *NetworkInterface) { + // IPv6 IPs from imds load balancer are wrapped by brackets while those from imds are not. + trimIP := func(ip string) string { + return strings.Trim(strings.Trim(ip, "["), "]") + } + + if len(netInterface.IPV4.IPAddress) > 0 && len(netInterface.IPV4.IPAddress[0].PrivateIP) > 0 { + for _, pip := range publicIPs { + if pip.PrivateIPAddress == netInterface.IPV4.IPAddress[0].PrivateIP { + netInterface.IPV4.IPAddress[0].PublicIP = pip.FrontendIPAddress + break + } + } + } + if len(netInterface.IPV6.IPAddress) > 0 && len(netInterface.IPV6.IPAddress[0].PrivateIP) > 0 { + for _, pip := range publicIPs { + privateIP := trimIP(pip.PrivateIPAddress) + frontendIP := trimIP(pip.FrontendIPAddress) + if privateIP == netInterface.IPV6.IPAddress[0].PrivateIP { + netInterface.IPV6.IPAddress[0].PublicIP = frontendIP + break + } + } + } +} + func (ims *InstanceMetadataService) getMetadata(key string) (interface{}, error) { instanceMetadata, err := ims.getInstanceMetadata(key) if err != nil { @@ -142,22 +170,7 @@ func (ims *InstanceMetadataService) getMetadata(key string) (interface{}, error) } publicIPs := loadBalancerMetadata.LoadBalancer.PublicIPAddresses - if len(netInterface.IPV4.IPAddress) > 0 && len(netInterface.IPV4.IPAddress[0].PrivateIP) > 0 { - for _, pip := range publicIPs { - if pip.PrivateIPAddress == netInterface.IPV4.IPAddress[0].PrivateIP { - netInterface.IPV4.IPAddress[0].PublicIP = pip.FrontendIPAddress - break - } - } - } - if len(netInterface.IPV6.IPAddress) > 0 && len(netInterface.IPV6.IPAddress[0].PrivateIP) > 0 { - for _, pip := range publicIPs { - if pip.PrivateIPAddress == netInterface.IPV6.IPAddress[0].PrivateIP { - netInterface.IPV6.IPAddress[0].PublicIP = pip.FrontendIPAddress - break - } - } - } + fillNetInterfacePublicIPs(publicIPs, &netInterface) } return instanceMetadata, nil @@ -187,7 +200,7 @@ func (ims *InstanceMetadataService) getInstanceMetadata(key string) (*InstanceMe return nil, fmt.Errorf("failure of getting instance metadata with response %q", resp.Status) } - data, err := ioutil.ReadAll(resp.Body) + data, err := io.ReadAll(resp.Body) if err != nil { return nil, err } @@ -225,7 +238,7 @@ func (ims *InstanceMetadataService) getLoadBalancerMetadata() (*LoadBalancerMeta return nil, fmt.Errorf("failure of getting loadbalancer metadata with response %q", resp.Status) } - data, err := ioutil.ReadAll(resp.Body) + data, err := io.ReadAll(resp.Body) if err != nil { return nil, err } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_loadbalancer.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_loadbalancer.go index 05d62796bf6f..6fc94411e894 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_loadbalancer.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_loadbalancer.go @@ -22,15 +22,13 @@ import ( "errors" "fmt" "math" - "net" "net/netip" "reflect" "sort" "strconv" "strings" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" - "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" v1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -40,6 +38,7 @@ import ( servicehelpers "k8s.io/cloud-provider/service/helpers" "k8s.io/klog/v2" utilnet "k8s.io/utils/net" + "k8s.io/utils/pointer" "k8s.io/utils/strings/slices" azcache "sigs.k8s.io/cloud-provider-azure/pkg/cache" @@ -48,74 +47,54 @@ import ( "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) -// getServiceLoadBalancerIP retrieves LB IP from IPv4 annotation, then IPv6 annotation, then service.Spec.LoadBalancerIP. -// TODO: Dual-stack support is not implemented. -func getServiceLoadBalancerIP(service *v1.Service) string { - if service == nil { - return "" - } - - if ip, ok := service.Annotations[consts.ServiceAnnotationLoadBalancerIPDualStack[false]]; ok && ip != "" { - return ip - } - if ip, ok := service.Annotations[consts.ServiceAnnotationLoadBalancerIPDualStack[true]]; ok && ip != "" { - return ip +// Since public IP is not a part of the load balancer on Azure, +// there is a chance that we could orphan public IP resources while we delete the load balancer (kubernetes/kubernetes#80571). +// We need to make sure the existence of the load balancer depends on the load balancer resource and public IP resource on Azure. +func (az *Cloud) existsPip(clusterName string, service *v1.Service) bool { + v4Enabled, v6Enabled := getIPFamiliesEnabled(service) + existsPipSingleStack := func(isIPv6 bool) bool { + pipName, _, err := az.determinePublicIPName(clusterName, service, isIPv6) + if err != nil { + return false + } + pipResourceGroup := az.getPublicIPAddressResourceGroup(service) + _, existingPip, err := az.getPublicIPAddress(pipResourceGroup, pipName, azcache.CacheReadTypeDefault) + if err != nil { + return false + } + return existingPip } - // Retrieve LB IP from service.Spec.LoadBalancerIP (will be deprecated) - return service.Spec.LoadBalancerIP -} - -// setServiceLoadBalancerIP sets LB IP to a Service -func setServiceLoadBalancerIP(service *v1.Service, ip string) { - if service.Annotations == nil { - service.Annotations = map[string]string{} + if v4Enabled && !existsPipSingleStack(false) { + return false } - if net.ParseIP(ip).To4() != nil { - service.Annotations[consts.ServiceAnnotationLoadBalancerIPDualStack[false]] = ip - return + if v6Enabled && !existsPipSingleStack(true) { + return false } - service.Annotations[consts.ServiceAnnotationLoadBalancerIPDualStack[true]] = ip + return true } // GetLoadBalancer returns whether the specified load balancer and its components exist, and // if so, what its status is. func (az *Cloud) GetLoadBalancer(ctx context.Context, clusterName string, service *v1.Service) (status *v1.LoadBalancerStatus, exists bool, err error) { - // Since public IP is not a part of the load balancer on Azure, - // there is a chance that we could orphan public IP resources while we delete the load balancer (kubernetes/kubernetes#80571). - // We need to make sure the existence of the load balancer depends on the load balancer resource and public IP resource on Azure. - existsPip := func() bool { - var pips []network.PublicIPAddress - pipName, _, err := az.determinePublicIPName(clusterName, service, &pips) - if err != nil { - return false - } - pipResourceGroup := az.getPublicIPAddressResourceGroup(service) - _, existsPip, err := az.getPublicIPAddress(pipResourceGroup, pipName, azcache.CacheReadTypeDefault) - if err != nil { - return false - } - return existsPip - }() - existingLBs, err := az.ListLB(service) if err != nil { - return nil, existsPip, err + return nil, az.existsPip(clusterName, service), err } _, status, existsLb, err := az.getServiceLoadBalancer(service, clusterName, nil, false, existingLBs) if err != nil || existsLb { - return status, existsLb || existsPip, err + return status, existsLb || az.existsPip(clusterName, service), err } flippedService := flipServiceInternalAnnotation(service) _, status, existsLb, err = az.getServiceLoadBalancer(flippedService, clusterName, nil, false, existingLBs) if err != nil || existsLb { - return status, existsLb || existsPip, err + return status, existsLb || az.existsPip(clusterName, service), err } // Return exists = false only if the load balancer and the public IP are not found on Azure - if !existsLb && !existsPip { + if !existsLb && !az.existsPip(clusterName, service) { serviceName := getServiceName(service) klog.V(5).Infof("getloadbalancer (cluster:%s) (service:%s) - doesn't exist", clusterName, serviceName) return nil, false, nil @@ -141,8 +120,10 @@ func (az *Cloud) reconcileService(ctx context.Context, clusterName string, servi return nil, err } - var pips []network.PublicIPAddress - lbStatus, fipConfig, err := az.getServiceLoadBalancerStatus(service, lb, &pips) + resourceBaseName := az.GetLoadBalancerName(context.TODO(), "", service) + klog.V(2).Infof("reconcileService: Start reconciling Service %q with its resource basename %q", serviceName, resourceBaseName) + + lbStatus, fipConfig, err := az.getServiceLoadBalancerStatus(service, lb) if err != nil { klog.Errorf("getServiceLoadBalancerStatus(%s) failed: %v", serviceName, err) if !errors.Is(err, ErrorNotVmssInstance) { @@ -168,7 +149,7 @@ func (az *Cloud) reconcileService(ctx context.Context, clusterName string, servi } } - updateService := updateServiceLoadBalancerIP(service, to.String(serviceIP)) + updateService := updateServiceLoadBalancerIP(service, pointer.StringDeref(serviceIP, "")) flippedService := flipServiceInternalAnnotation(updateService) if _, err := az.reconcileLoadBalancer(clusterName, flippedService, nil, false /* wantLb */); err != nil { klog.Errorf("reconcileLoadBalancer(%s) failed: %#v", serviceName, err) @@ -177,7 +158,7 @@ func (az *Cloud) reconcileService(ctx context.Context, clusterName string, servi // lb is not reused here because the ETAG may be changed in above operations, hence reconcilePublicIP() would get lb again from cache. klog.V(2).Infof("reconcileService: reconciling pip") - if _, err := az.reconcilePublicIP(clusterName, updateService, to.String(lb.Name), true /* wantLb */); err != nil { + if _, err := az.reconcilePublicIPs(clusterName, updateService, pointer.StringDeref(lb.Name, ""), true /* wantLb */); err != nil { klog.Errorf("reconcilePublicIP(%s) failed: %#v", serviceName, err) return nil, err } @@ -318,7 +299,7 @@ func (az *Cloud) EnsureLoadBalancerDeleted(ctx context.Context, clusterName stri return err } - _, err = az.reconcilePublicIP(clusterName, service, "", false /* wantLb */) + _, err = az.reconcilePublicIPs(clusterName, service, "", false /* wantLb */) if err != nil { return err } @@ -394,7 +375,7 @@ func (az *Cloud) removeFrontendIPConfigurationFromLoadBalancer(lb *network.LoadB } fipConfigs := *lb.FrontendIPConfigurations for i, fipConfig := range fipConfigs { - if strings.EqualFold(to.String(fipConfig.Name), to.String(fip.Name)) { + if strings.EqualFold(pointer.StringDeref(fipConfig.Name, ""), pointer.StringDeref(fip.Name, "")) { fipConfigs = append(fipConfigs[:i], fipConfigs[i+1:]...) break } @@ -405,7 +386,7 @@ func (az *Cloud) removeFrontendIPConfigurationFromLoadBalancer(lb *network.LoadB if lb.LoadBalancingRules != nil { lbRules := *lb.LoadBalancingRules for i := len(lbRules) - 1; i >= 0; i-- { - if strings.Contains(to.String(lbRules[i].Name), to.String(fip.Name)) { + if strings.Contains(pointer.StringDeref(lbRules[i].Name, ""), pointer.StringDeref(fip.Name, "")) { lbRules = append(lbRules[:i], lbRules[i+1:]...) } } @@ -414,7 +395,7 @@ func (az *Cloud) removeFrontendIPConfigurationFromLoadBalancer(lb *network.LoadB if lb.Probes != nil { lbProbes := *lb.Probes for i := len(lbProbes) - 1; i >= 0; i-- { - if strings.Contains(to.String(lbProbes[i].Name), to.String(fip.Name)) { + if strings.Contains(pointer.StringDeref(lbProbes[i].Name, ""), pointer.StringDeref(fip.Name, "")) { lbProbes = append(lbProbes[:i], lbProbes[i+1:]...) } } @@ -424,48 +405,49 @@ func (az *Cloud) removeFrontendIPConfigurationFromLoadBalancer(lb *network.LoadB // clean up any private link service associated with the frontEndIPConfig err := az.reconcilePrivateLinkService(clusterName, service, fip, false /* wantPLS */) if err != nil { - klog.Errorf("removeFrontendIPConfigurationFromLoadBalancer(%s, %s, %s, %s): failed to clean up PLS: %v", to.String(lb.Name), to.String(fip.Name), clusterName, service.Name, err) + klog.Errorf("removeFrontendIPConfigurationFromLoadBalancer(%s, %s, %s, %s): failed to clean up PLS: %v", pointer.StringDeref(lb.Name, ""), pointer.StringDeref(fip.Name, ""), clusterName, service.Name, err) return err } if len(fipConfigs) == 0 { - klog.V(2).Infof("removeFrontendIPConfigurationFromLoadBalancer(%s, %s, %s, %s): deleting load balancer because there is no remaining frontend IP configurations", to.String(lb.Name), to.String(fip.Name), clusterName, service.Name) + klog.V(2).Infof("removeFrontendIPConfigurationFromLoadBalancer(%s, %s, %s, %s): deleting load balancer because there is no remaining frontend IP configurations", pointer.StringDeref(lb.Name, ""), pointer.StringDeref(fip.Name, ""), clusterName, service.Name) err := az.cleanOrphanedLoadBalancer(lb, existingLBs, service, clusterName) if err != nil { - klog.Errorf("removeFrontendIPConfigurationFromLoadBalancer(%s, %s, %s, %s): failed to cleanupOrphanedLoadBalancer: %v", to.String(lb.Name), to.String(fip.Name), clusterName, service.Name, err) + klog.Errorf("removeFrontendIPConfigurationFromLoadBalancer(%s, %s, %s, %s): failed to cleanupOrphanedLoadBalancer: %v", pointer.StringDeref(lb.Name, ""), pointer.StringDeref(fip.Name, ""), clusterName, service.Name, err) return err } } else { - klog.V(2).Infof("removeFrontendIPConfigurationFromLoadBalancer(%s, %s, %s, %s): updating the load balancer", to.String(lb.Name), to.String(fip.Name), clusterName, service.Name) + klog.V(2).Infof("removeFrontendIPConfigurationFromLoadBalancer(%s, %s, %s, %s): updating the load balancer", pointer.StringDeref(lb.Name, ""), pointer.StringDeref(fip.Name, ""), clusterName, service.Name) err := az.CreateOrUpdateLB(service, *lb) if err != nil { - klog.Errorf("removeFrontendIPConfigurationFromLoadBalancer(%s, %s, %s, %s): failed to CreateOrUpdateLB: %v", to.String(lb.Name), to.String(fip.Name), clusterName, service.Name, err) + klog.Errorf("removeFrontendIPConfigurationFromLoadBalancer(%s, %s, %s, %s): failed to CreateOrUpdateLB: %v", pointer.StringDeref(lb.Name, ""), pointer.StringDeref(fip.Name, ""), clusterName, service.Name, err) return err } - _ = az.lbCache.Delete(to.String(lb.Name)) + _ = az.lbCache.Delete(pointer.StringDeref(lb.Name, "")) } return nil } func (az *Cloud) cleanOrphanedLoadBalancer(lb *network.LoadBalancer, existingLBs []network.LoadBalancer, service *v1.Service, clusterName string) error { - lbName := to.String(lb.Name) + lbName := pointer.StringDeref(lb.Name, "") serviceName := getServiceName(service) isBackendPoolPreConfigured := az.isBackendPoolPreConfigured(service) lbResourceGroup := az.getLoadBalancerResourceGroup() - lbBackendPoolName := getBackendPoolName(clusterName, service) + isIPv6 := utilnet.IsIPv6String(service.Spec.ClusterIP) + lbBackendPoolName := getBackendPoolName(clusterName, isIPv6) lbBackendPoolID := az.getBackendPoolID(lbName, lbResourceGroup, lbBackendPoolName) if isBackendPoolPreConfigured { klog.V(2).Infof("cleanOrphanedLoadBalancer(%s, %s, %s): ignore cleanup of dirty lb because the lb is pre-configured", lbName, serviceName, clusterName) } else { foundLB := false for _, existingLB := range existingLBs { - if strings.EqualFold(to.String(lb.Name), to.String(existingLB.Name)) { + if strings.EqualFold(pointer.StringDeref(lb.Name, ""), pointer.StringDeref(existingLB.Name, "")) { foundLB = true break } } if !foundLB { - klog.V(2).Infof("cleanOrphanedLoadBalancer: the LB %s doesn't exist, will not delete it", to.String(lb.Name)) + klog.V(2).Infof("cleanOrphanedLoadBalancer: the LB %s doesn't exist, will not delete it", pointer.StringDeref(lb.Name, "")) return nil } @@ -505,7 +487,7 @@ func (az *Cloud) cleanOrphanedLoadBalancer(lb *network.LoadBalancer, existingLBs } vmssNamesMap := map[string]bool{vmssName: true} - err := az.VMSet.EnsureBackendPoolDeletedFromVMSets(vmssNamesMap, lbBackendPoolID) + err := az.VMSet.EnsureBackendPoolDeletedFromVMSets(vmssNamesMap, []string{lbBackendPoolID}) if err != nil { klog.Errorf("cleanOrphanedLoadBalancer(%s, %s, %s): failed to EnsureBackendPoolDeletedFromVMSets: %v", lbName, serviceName, clusterName, err) return err @@ -524,18 +506,19 @@ func (az *Cloud) cleanOrphanedLoadBalancer(lb *network.LoadBalancer, existingLBs // safeDeleteLoadBalancer deletes the load balancer after decoupling it from the vmSet func (az *Cloud) safeDeleteLoadBalancer(lb network.LoadBalancer, clusterName, vmSetName string, service *v1.Service) *retry.Error { - lbBackendPoolID := az.getBackendPoolID(to.String(lb.Name), az.getLoadBalancerResourceGroup(), getBackendPoolName(clusterName, service)) - _, err := az.VMSet.EnsureBackendPoolDeleted(service, lbBackendPoolID, vmSetName, lb.BackendAddressPools, true) + isIPv6 := utilnet.IsIPv6String(service.Spec.ClusterIP) + lbBackendPoolID := az.getBackendPoolID(pointer.StringDeref(lb.Name, ""), az.getLoadBalancerResourceGroup(), getBackendPoolName(clusterName, isIPv6)) + _, err := az.VMSet.EnsureBackendPoolDeleted(service, []string{lbBackendPoolID}, vmSetName, lb.BackendAddressPools, true) if err != nil { return retry.NewError(false, fmt.Errorf("safeDeleteLoadBalancer: failed to EnsureBackendPoolDeleted: %w", err)) } - klog.V(2).Infof("safeDeleteLoadBalancer: deleting LB %s", to.String(lb.Name)) - rerr := az.DeleteLB(service, to.String(lb.Name)) + klog.V(2).Infof("safeDeleteLoadBalancer: deleting LB %s", pointer.StringDeref(lb.Name, "")) + rerr := az.DeleteLB(service, pointer.StringDeref(lb.Name, "")) if rerr != nil { return rerr } - _ = az.lbCache.Delete(to.String(lb.Name)) + _ = az.lbCache.Delete(pointer.StringDeref(lb.Name, "")) return nil } @@ -580,21 +563,21 @@ func (az *Cloud) reconcileSharedLoadBalancer(service *v1.Service, clusterName st return existingLBs, nil } - lbNamesToBeDeleted := sets.NewString() + lbNamesToBeDeleted := sets.New[string]() // delete unwanted LBs for _, lb := range existingLBs { - klog.V(4).Infof("reconcileSharedLoadBalancer: checking LB %s", to.String(lb.Name)) + klog.V(4).Infof("reconcileSharedLoadBalancer: checking LB %s", pointer.StringDeref(lb.Name, "")) // skip the internal or external primary load balancer - lbNamePrefix := strings.TrimSuffix(to.String(lb.Name), consts.InternalLoadBalancerNameSuffix) + lbNamePrefix := strings.TrimSuffix(pointer.StringDeref(lb.Name, ""), consts.InternalLoadBalancerNameSuffix) if strings.EqualFold(lbNamePrefix, clusterName) { continue } // skip if the multiple slbs mode is enabled and // the vmSet is supposed to have dedicated SLBs - vmSetName := strings.ToLower(az.mapLoadBalancerNameToVMSet(to.String(lb.Name), clusterName)) + vmSetName := strings.ToLower(az.mapLoadBalancerNameToVMSet(pointer.StringDeref(lb.Name, ""), clusterName)) if az.EnableMultipleStandardLoadBalancers && !az.getVMSetNamesSharingPrimarySLB().Has(vmSetName) { - klog.V(4).Infof("reconcileSharedLoadBalancer: skip deleting the LB %s because the vmSet %s needs a dedicated SLB", to.String(lb.Name), vmSetName) + klog.V(4).Infof("reconcileSharedLoadBalancer: skip deleting the LB %s because the vmSet %s needs a dedicated SLB", pointer.StringDeref(lb.Name, ""), vmSetName) continue } @@ -602,7 +585,7 @@ func (az *Cloud) reconcileSharedLoadBalancer(service *v1.Service, clusterName st // If the VMSet name is in az.NodePoolsWithoutDedicatedSLB, we should // decouple the VMSet from the lb and delete the lb. Then adding the VMSet // to the backend pool of the primary slb. - klog.V(2).Infof("reconcileSharedLoadBalancer: deleting LB %s because the corresponding vmSet is supposed to be in the primary SLB", to.String(lb.Name)) + klog.V(2).Infof("reconcileSharedLoadBalancer: deleting LB %s because the corresponding vmSet is supposed to be in the primary SLB", pointer.StringDeref(lb.Name, "")) rerr := az.safeDeleteLoadBalancer(lb, clusterName, vmSetName, service) if rerr != nil { return nil, rerr.Error() @@ -610,12 +593,12 @@ func (az *Cloud) reconcileSharedLoadBalancer(service *v1.Service, clusterName st // remove the deleted lb from the list and construct a new primary // lb, so that getServiceLoadBalancer doesn't have to call list api again - lbNamesToBeDeleted.Insert(strings.ToLower(to.String(lb.Name))) + lbNamesToBeDeleted.Insert(strings.ToLower(pointer.StringDeref(lb.Name, ""))) } for i := len(existingLBs) - 1; i >= 0; i-- { lb := existingLBs[i] - if !lbNamesToBeDeleted.Has(strings.ToLower(to.String(lb.Name))) { + if !lbNamesToBeDeleted.Has(strings.ToLower(pointer.StringDeref(lb.Name, ""))) { continue } // remove the deleted LB from the list @@ -645,13 +628,10 @@ func (az *Cloud) getServiceLoadBalancer(service *v1.Service, clusterName string, } } - // reuse pip list to reduce api call - var pips []network.PublicIPAddress - // check if the service already has a load balancer for i := range existingLBs { existingLB := existingLBs[i] - existingLBNamePrefix := strings.TrimSuffix(to.String(existingLB.Name), consts.InternalLoadBalancerNameSuffix) + existingLBNamePrefix := strings.TrimSuffix(pointer.StringDeref(existingLB.Name, ""), consts.InternalLoadBalancerNameSuffix) // for the primary standard load balancer (internal or external), when enabled multiple slbs if strings.EqualFold(existingLBNamePrefix, clusterName) && useMultipleSLBs { @@ -684,7 +664,7 @@ func (az *Cloud) getServiceLoadBalancer(service *v1.Service, clusterName string, continue } var fipConfig *network.FrontendIPConfiguration - status, fipConfig, err = az.getServiceLoadBalancerStatus(service, &existingLB, &pips) + status, fipConfig, err = az.getServiceLoadBalancerStatus(service, &existingLB) if err != nil { return nil, nil, false, err } @@ -696,7 +676,7 @@ func (az *Cloud) getServiceLoadBalancer(service *v1.Service, clusterName string, // select another load balancer instead of returning // the current one if the change is needed - if wantLb && az.shouldChangeLoadBalancer(service, to.String(existingLB.Name), clusterName) { + if wantLb && az.shouldChangeLoadBalancer(service, pointer.StringDeref(existingLB.Name, ""), clusterName) { if err := az.removeFrontendIPConfigurationFromLoadBalancer(&existingLB, existingLBs, fipConfig, clusterName, service); err != nil { klog.Errorf("getServiceLoadBalancer(%s, %s, %v): failed to remove frontend IP configuration from load balancer: %v", service.Name, clusterName, wantLb, err) return nil, nil, false, err @@ -818,8 +798,7 @@ func (az *Cloud) selectLoadBalancer(clusterName string, service *v1.Service, exi return selectedLB, existsLb, nil } -// pips: a non-nil pointer to a slice of existing PIPs, if the slice being pointed to is nil, listPIP would be called when needed and the slice would be filled -func (az *Cloud) getServiceLoadBalancerStatus(service *v1.Service, lb *network.LoadBalancer, pips *[]network.PublicIPAddress) (status *v1.LoadBalancerStatus, fipConfig *network.FrontendIPConfiguration, err error) { +func (az *Cloud) getServiceLoadBalancerStatus(service *v1.Service, lb *network.LoadBalancer) (status *v1.LoadBalancerStatus, fipConfig *network.FrontendIPConfiguration, err error) { if lb == nil { klog.V(10).Info("getServiceLoadBalancerStatus: lb is nil") return nil, nil, nil @@ -831,12 +810,13 @@ func (az *Cloud) getServiceLoadBalancerStatus(service *v1.Service, lb *network.L isInternal := requiresInternalLoadBalancer(service) serviceName := getServiceName(service) for _, ipConfiguration := range *lb.FrontendIPConfigurations { - owns, isPrimaryService, err := az.serviceOwnsFrontendIP(ipConfiguration, service, pips) + ipConfiguration := ipConfiguration + owns, isPrimaryService, err := az.serviceOwnsFrontendIP(ipConfiguration, service) if err != nil { - return nil, nil, fmt.Errorf("get(%s): lb(%s) - failed to filter frontend IP configs with error: %w", serviceName, to.String(lb.Name), err) + return nil, nil, fmt.Errorf("get(%s): lb(%s) - failed to filter frontend IP configs with error: %w", serviceName, pointer.StringDeref(lb.Name, ""), err) } if owns { - klog.V(2).Infof("get(%s): lb(%s) - found frontend IP config, primary service: %v", serviceName, to.String(lb.Name), isPrimaryService) + klog.V(2).Infof("get(%s): lb(%s) - found frontend IP config, primary service: %v", serviceName, pointer.StringDeref(lb.Name, ""), isPrimaryService) var lbIP *string if isInternal { @@ -862,10 +842,10 @@ func (az *Cloud) getServiceLoadBalancerStatus(service *v1.Service, lb *network.L } } - klog.V(2).Infof("getServiceLoadBalancerStatus gets ingress IP %q from frontendIPConfiguration %q for service %q", to.String(lbIP), to.String(ipConfiguration.Name), serviceName) + klog.V(2).Infof("getServiceLoadBalancerStatus gets ingress IP %q from frontendIPConfiguration %q for service %q", pointer.StringDeref(lbIP, ""), pointer.StringDeref(ipConfiguration.Name, ""), serviceName) // set additional public IPs to LoadBalancerStatus, so that kube-proxy would create their iptables rules. - lbIngress := []v1.LoadBalancerIngress{{IP: to.String(lbIP)}} + lbIngress := []v1.LoadBalancerIngress{{IP: pointer.StringDeref(lbIP, "")}} additionalIPs, err := getServiceAdditionalPublicIPs(service) if err != nil { return &v1.LoadBalancerStatus{Ingress: lbIngress}, &ipConfiguration, err @@ -885,27 +865,29 @@ func (az *Cloud) getServiceLoadBalancerStatus(service *v1.Service, lb *network.L return nil, nil, nil } -// pips: a non-nil pointer to a slice of existing PIPs, if the slice being pointed to is nil, listPIP would be called when needed and the slice would be filled -func (az *Cloud) determinePublicIPName(clusterName string, service *v1.Service, pips *[]network.PublicIPAddress) (string, bool, error) { - if name, found := service.Annotations[consts.ServiceAnnotationPIPName]; found && name != "" { +func (az *Cloud) determinePublicIPName(clusterName string, service *v1.Service, isIPv6 bool) (string, bool, error) { + if name := getServicePIPName(service, isIPv6); name != "" { return name, true, nil } - if ipPrefix, ok := service.Annotations[consts.ServiceAnnotationPIPPrefixID]; ok && ipPrefix != "" { - return az.getPublicIPName(clusterName, service), false, nil - } pipResourceGroup := az.getPublicIPAddressResourceGroup(service) - loadBalancerIP := getServiceLoadBalancerIP(service) + if id := getServicePIPPrefixID(service, isIPv6); id != "" { + pipName, err := az.getPublicIPName(clusterName, service, isIPv6) + return pipName, false, err + } + + loadBalancerIP := getServiceLoadBalancerIP(service, isIPv6) // Assume that the service without loadBalancerIP set is a primary service. // If a secondary service doesn't set the loadBalancerIP, it is not allowed to share the IP. if len(loadBalancerIP) == 0 { - return az.getPublicIPName(clusterName, service), false, nil + pipName, err := az.getPublicIPName(clusterName, service, isIPv6) + return pipName, false, err } // For the services with loadBalancerIP set, an existing public IP is required, primary // or secondary, or a public IP not found error would be reported. - pip, err := az.findMatchedPIPByLoadBalancerIP(service, loadBalancerIP, pipResourceGroup, pips) + pip, err := az.findMatchedPIPByLoadBalancerIP(service, loadBalancerIP, pipResourceGroup) if err != nil { return "", false, err } @@ -917,26 +899,37 @@ func (az *Cloud) determinePublicIPName(clusterName string, service *v1.Service, return "", false, fmt.Errorf("user supplied IP Address %s was not found in resource group %s", loadBalancerIP, pipResourceGroup) } -// pips: a non-nil pointer to a slice of existing PIPs, if the slice being pointed to is nil, listPIP would be called when needed and the slice would be filled -func (az *Cloud) findMatchedPIPByLoadBalancerIP(service *v1.Service, loadBalancerIP, pipResourceGroup string, pips *[]network.PublicIPAddress) (*network.PublicIPAddress, error) { - if pips == nil { - // this should not happen - return nil, fmt.Errorf("findMatchedPIPByLoadBalancerIP: nil pip list passed") - } else if *pips == nil { - pipList, err := az.ListPIP(service, pipResourceGroup) +func (az *Cloud) findMatchedPIPByLoadBalancerIP(service *v1.Service, loadBalancerIP, pipResourceGroup string) (*network.PublicIPAddress, error) { + pips, err := az.listPIP(pipResourceGroup, azcache.CacheReadTypeDefault) + if err != nil { + return nil, fmt.Errorf("findMatchedPIPByLoadBalancerIP: failed to listPIP: %w", err) + } + + pip, err := getExpectedPIPFromListByIPAddress(pips, loadBalancerIP) + if err != nil { + pips, err = az.listPIP(pipResourceGroup, azcache.CacheReadTypeForceRefresh) if err != nil { - return nil, err + return nil, fmt.Errorf("findMatchedPIPByLoadBalancerIP: failed to listPIP force refresh: %w", err) + } + + pip, err = getExpectedPIPFromListByIPAddress(pips, loadBalancerIP) + if err != nil { + return nil, fmt.Errorf("findMatchedPIPByLoadBalancerIP: cannot find public IP with IP address %s in resource group %s", loadBalancerIP, pipResourceGroup) } - *pips = pipList } - for _, pip := range *pips { + + return pip, nil +} + +func getExpectedPIPFromListByIPAddress(pips []network.PublicIPAddress, ip string) (*network.PublicIPAddress, error) { + for _, pip := range pips { if pip.PublicIPAddressPropertiesFormat.IPAddress != nil && - *pip.PublicIPAddressPropertiesFormat.IPAddress == loadBalancerIP { + *pip.PublicIPAddressPropertiesFormat.IPAddress == ip { return &pip, nil } } - return nil, fmt.Errorf("findMatchedPIPByLoadBalancerIP: cannot find public IP with IP address %s in resource group %s", loadBalancerIP, pipResourceGroup) + return nil, fmt.Errorf("getExpectedPIPFromListByIPAddress: cannot find public IP with IP address %s", ip) } func flipServiceInternalAnnotation(service *v1.Service) *v1.Service { @@ -963,7 +956,8 @@ func updateServiceLoadBalancerIP(service *v1.Service, serviceIP string) *v1.Serv } func (az *Cloud) findServiceIPAddress(ctx context.Context, clusterName string, service *v1.Service) (string, error) { - lbIP := getServiceLoadBalancerIP(service) + isIPv6 := utilnet.IsIPv6String(service.Spec.ClusterIP) + lbIP := getServiceLoadBalancerIP(service, isIPv6) if len(lbIP) > 0 { return lbIP, nil } @@ -988,19 +982,22 @@ func (az *Cloud) findServiceIPAddress(ctx context.Context, clusterName string, s return lbStatus.Ingress[0].IP, nil } -func (az *Cloud) ensurePublicIPExists(service *v1.Service, pipName string, domainNameLabel, clusterName string, shouldPIPExisted, foundDNSLabelAnnotation bool) (*network.PublicIPAddress, error) { +func (az *Cloud) ensurePublicIPExists(service *v1.Service, pipName string, domainNameLabel, clusterName string, shouldPIPExisted, foundDNSLabelAnnotation, isIPv6 bool) (*network.PublicIPAddress, error) { pipResourceGroup := az.getPublicIPAddressResourceGroup(service) pip, existsPip, err := az.getPublicIPAddress(pipResourceGroup, pipName, azcache.CacheReadTypeDefault) if err != nil { return nil, err } - serviceName := getServiceName(service) + ipVersion := network.IPv4 + if isIPv6 { + ipVersion = network.IPv6 + } - var changed bool + var changed, owns, isUserAssignedPIP bool if existsPip { // ensure that the service tag is good for managed pips - owns, isUserAssignedPIP := serviceOwnsPublicIP(service, &pip, clusterName) + owns, isUserAssignedPIP = serviceOwnsPublicIP(service, &pip, clusterName) if owns && !isUserAssignedPIP { changed, err = bindServicesToPIP(&pip, []string{serviceName}, false) if err != nil { @@ -1038,10 +1035,11 @@ func (az *Cloud) ensurePublicIPExists(service *v1.Service, pipName string, domai } } - klog.V(2).Infof("ensurePublicIPExists for service(%s): pip(%s) - updating", serviceName, to.String(pip.Name)) + klog.V(2).Infof("ensurePublicIPExists for service(%s): pip(%s) - updating", serviceName, pointer.StringDeref(pip.Name, "")) if pip.PublicIPAddressPropertiesFormat == nil { pip.PublicIPAddressPropertiesFormat = &network.PublicIPAddressPropertiesFormat{ - PublicIPAllocationMethod: network.IPAllocationMethodStatic, + PublicIPAllocationMethod: network.Static, + PublicIPAddressVersion: ipVersion, } changed = true } @@ -1052,8 +1050,8 @@ func (az *Cloud) ensurePublicIPExists(service *v1.Service, pipName string, domai changed = true - pip.Name = to.StringPtr(pipName) - pip.Location = to.StringPtr(az.Location) + pip.Name = pointer.String(pipName) + pip.Location = pointer.String(az.Location) if az.HasExtendedLocation() { klog.V(2).Infof("Using extended location with name %s, and type %s for PIP", az.ExtendedLocationName, az.ExtendedLocationType) pip.ExtendedLocation = &network.ExtendedLocation{ @@ -1062,11 +1060,12 @@ func (az *Cloud) ensurePublicIPExists(service *v1.Service, pipName string, domai } } pip.PublicIPAddressPropertiesFormat = &network.PublicIPAddressPropertiesFormat{ - PublicIPAllocationMethod: network.IPAllocationMethodStatic, + PublicIPAllocationMethod: network.Static, + PublicIPAddressVersion: ipVersion, IPTags: getServiceIPTagRequestForPublicIP(service).IPTags, } pip.Tags = map[string]*string{ - consts.ServiceTagKey: to.StringPtr(""), + consts.ServiceTagKey: pointer.String(""), consts.ClusterNameKey: &clusterName, } if _, err = bindServicesToPIP(&pip, []string{serviceName}, false); err != nil { @@ -1077,14 +1076,15 @@ func (az *Cloud) ensurePublicIPExists(service *v1.Service, pipName string, domai pip.Sku = &network.PublicIPAddressSku{ Name: network.PublicIPAddressSkuNameStandard, } - if pipPrefixName, ok := service.Annotations[consts.ServiceAnnotationPIPPrefixID]; ok && pipPrefixName != "" { - pip.PublicIPPrefix = &network.SubResource{ID: to.StringPtr(pipPrefixName)} + + if id := getServicePIPPrefixID(service, isIPv6); id != "" { + pip.PublicIPPrefix = &network.SubResource{ID: pointer.String(id)} } // skip adding zone info since edge zones doesn't support multiple availability zones. if !az.HasExtendedLocation() { // only add zone information for the new standard pips - zones, err := az.getRegionZonesBackoff(to.String(pip.Location)) + zones, err := az.getRegionZonesBackoff(pointer.StringDeref(pip.Location, "")) if err != nil { return nil, err } @@ -1095,12 +1095,12 @@ func (az *Cloud) ensurePublicIPExists(service *v1.Service, pipName string, domai } klog.V(2).Infof("ensurePublicIPExists for service(%s): pip(%s) - creating", serviceName, *pip.Name) } - if az.ensurePIPTagged(service, &pip) { + if !isUserAssignedPIP && az.ensurePIPTagged(service, &pip) { changed = true } if foundDNSLabelAnnotation { - updatedDNSSettings, err := reconcileDNSSettings(&pip, domainNameLabel, serviceName, pipName) + updatedDNSSettings, err := reconcileDNSSettings(&pip, domainNameLabel, serviceName, pipName, isUserAssignedPIP) if err != nil { return nil, fmt.Errorf("ensurePublicIPExists for service(%s): failed to reconcileDNSSettings: %w", serviceName, err) } @@ -1112,7 +1112,7 @@ func (az *Cloud) ensurePublicIPExists(service *v1.Service, pipName string, domai // use the same family as the clusterIP as we support IPv6 single stack as well // as dual-stack clusters - updatedIPSettings := az.reconcileIPSettings(&pip, service) + updatedIPSettings := az.reconcileIPSettings(&pip, service, isIPv6) if updatedIPSettings { changed = true } @@ -1137,32 +1137,31 @@ func (az *Cloud) ensurePublicIPExists(service *v1.Service, pipName string, domai return &pip, nil } -func (az *Cloud) reconcileIPSettings(pip *network.PublicIPAddress, service *v1.Service) bool { +func (az *Cloud) reconcileIPSettings(pip *network.PublicIPAddress, service *v1.Service, isIPv6 bool) bool { var changed bool serviceName := getServiceName(service) - ipv6 := utilnet.IsIPv6String(service.Spec.ClusterIP) - if ipv6 { - if !strings.EqualFold(string(pip.PublicIPAddressVersion), string(network.IPVersionIPv6)) { - pip.PublicIPAddressVersion = network.IPVersionIPv6 - klog.V(2).Infof("service(%s): pip(%s) - creating as ipv6 for clusterIP:%v", serviceName, *pip.Name, service.Spec.ClusterIP) + if isIPv6 { + if !strings.EqualFold(string(pip.PublicIPAddressVersion), string(network.IPv6)) { + pip.PublicIPAddressVersion = network.IPv6 + klog.V(2).Infof("service(%s): pip(%s) - should be created as IPv6", serviceName, *pip.Name) changed = true } if az.useStandardLoadBalancer() { // standard sku must have static allocation method for ipv6 - if !strings.EqualFold(string(pip.PublicIPAddressPropertiesFormat.PublicIPAllocationMethod), string(network.IPAllocationMethodStatic)) { - pip.PublicIPAddressPropertiesFormat.PublicIPAllocationMethod = network.IPAllocationMethodStatic + if !strings.EqualFold(string(pip.PublicIPAddressPropertiesFormat.PublicIPAllocationMethod), string(network.Static)) { + pip.PublicIPAddressPropertiesFormat.PublicIPAllocationMethod = network.Static changed = true } - } else if !strings.EqualFold(string(pip.PublicIPAddressPropertiesFormat.PublicIPAllocationMethod), string(network.IPAllocationMethodDynamic)) { - pip.PublicIPAddressPropertiesFormat.PublicIPAllocationMethod = network.IPAllocationMethodDynamic + } else if !strings.EqualFold(string(pip.PublicIPAddressPropertiesFormat.PublicIPAllocationMethod), string(network.Dynamic)) { + pip.PublicIPAddressPropertiesFormat.PublicIPAllocationMethod = network.Dynamic changed = true } } else { - if !strings.EqualFold(string(pip.PublicIPAddressVersion), string(network.IPVersionIPv4)) { - pip.PublicIPAddressVersion = network.IPVersionIPv4 - klog.V(2).Infof("service(%s): pip(%s) - creating as ipv4 for clusterIP:%v", serviceName, *pip.Name, service.Spec.ClusterIP) + if !strings.EqualFold(string(pip.PublicIPAddressVersion), string(network.IPv4)) { + pip.PublicIPAddressVersion = network.IPv4 + klog.V(2).Infof("service(%s): pip(%s) - should be created as IPv4", serviceName, *pip.Name) changed = true } } @@ -1170,7 +1169,11 @@ func (az *Cloud) reconcileIPSettings(pip *network.PublicIPAddress, service *v1.S return changed } -func reconcileDNSSettings(pip *network.PublicIPAddress, domainNameLabel, serviceName, pipName string) (bool, error) { +func reconcileDNSSettings( + pip *network.PublicIPAddress, + domainNameLabel, serviceName, pipName string, + isUserAssignedPIP bool, +) (bool, error) { var changed bool if existingServiceName := getServiceFromPIPDNSTags(pip.Tags); existingServiceName != "" && !strings.EqualFold(existingServiceName, serviceName) { @@ -1192,15 +1195,17 @@ func reconcileDNSSettings(pip *network.PublicIPAddress, domainNameLabel, service changed = true } else { existingDNSLabel := pip.PublicIPAddressPropertiesFormat.DNSSettings.DomainNameLabel - if !strings.EqualFold(to.String(existingDNSLabel), domainNameLabel) { + if !strings.EqualFold(pointer.StringDeref(existingDNSLabel, ""), domainNameLabel) { pip.PublicIPAddressPropertiesFormat.DNSSettings.DomainNameLabel = &domainNameLabel changed = true } } if svc := getServiceFromPIPDNSTags(pip.Tags); svc == "" || !strings.EqualFold(svc, serviceName) { - pip.Tags[consts.ServiceUsingDNSKey] = &serviceName - changed = true + if !isUserAssignedPIP { + pip.Tags[consts.ServiceUsingDNSKey] = &serviceName + changed = true + } } } @@ -1299,8 +1304,8 @@ func sortIPTags(ipTags *[]network.IPTag) { if ipTags != nil { sort.Slice(*ipTags, func(i, j int) bool { ipTag := *ipTags - return to.String(ipTag[i].IPTagType) < to.String(ipTag[j].IPTagType) || - to.String(ipTag[i].Tag) < to.String(ipTag[j].Tag) + return pointer.StringDeref(ipTag[i].IPTagType, "") < pointer.StringDeref(ipTag[j].IPTagType, "") || + pointer.StringDeref(ipTag[i].Tag, "") < pointer.StringDeref(ipTag[j].Tag, "") }) } } @@ -1332,8 +1337,8 @@ func convertIPTagMapToSlice(ipTagMap map[string]string) *[]network.IPTag { outputTags := []network.IPTag{} for k, v := range ipTagMap { ipTag := network.IPTag{ - IPTagType: to.StringPtr(k), - Tag: to.StringPtr(v), + IPTagType: pointer.String(k), + Tag: pointer.String(v), } outputTags = append(outputTags, ipTag) } @@ -1345,22 +1350,22 @@ func getDomainNameLabel(pip *network.PublicIPAddress) string { if pip == nil || pip.PublicIPAddressPropertiesFormat == nil || pip.PublicIPAddressPropertiesFormat.DNSSettings == nil { return "" } - return to.String(pip.PublicIPAddressPropertiesFormat.DNSSettings.DomainNameLabel) + return pointer.StringDeref(pip.PublicIPAddressPropertiesFormat.DNSSettings.DomainNameLabel, "") } -// pips: a non-nil pointer to a slice of existing PIPs, if the slice being pointed to is nil, listPIP would be called when needed and the slice would be filled -func (az *Cloud) isFrontendIPChanged(clusterName string, config network.FrontendIPConfiguration, service *v1.Service, lbFrontendIPConfigName string, pips *[]network.PublicIPAddress) (bool, error) { - isServiceOwnsFrontendIP, isPrimaryService, err := az.serviceOwnsFrontendIP(config, service, pips) +func (az *Cloud) isFrontendIPChanged(clusterName string, config network.FrontendIPConfiguration, service *v1.Service, lbFrontendIPConfigName string) (bool, error) { + isServiceOwnsFrontendIP, isPrimaryService, err := az.serviceOwnsFrontendIP(config, service) if err != nil { return false, err } - if isServiceOwnsFrontendIP && isPrimaryService && !strings.EqualFold(to.String(config.Name), lbFrontendIPConfigName) { + if isServiceOwnsFrontendIP && isPrimaryService && !strings.EqualFold(pointer.StringDeref(config.Name, ""), lbFrontendIPConfigName) { return true, nil } - if !strings.EqualFold(to.String(config.Name), lbFrontendIPConfigName) { + if !strings.EqualFold(pointer.StringDeref(config.Name, ""), lbFrontendIPConfigName) { return false, nil } - loadBalancerIP := getServiceLoadBalancerIP(service) + isIPv6 := utilnet.IsIPv6String(service.Spec.ClusterIP) + loadBalancerIP := getServiceLoadBalancerIP(service, isIPv6) isInternal := requiresInternalLoadBalancer(service) if isInternal { // Judge subnet @@ -1373,13 +1378,13 @@ func (az *Cloud) isFrontendIPChanged(clusterName string, config network.Frontend if !existsSubnet { return false, fmt.Errorf("failed to get subnet") } - if config.Subnet != nil && !strings.EqualFold(to.String(config.Subnet.ID), to.String(subnet.ID)) { + if config.Subnet != nil && !strings.EqualFold(pointer.StringDeref(config.Subnet.ID, ""), pointer.StringDeref(subnet.ID, "")) { return true, nil } } - return loadBalancerIP != "" && !strings.EqualFold(loadBalancerIP, to.String(config.PrivateIPAddress)), nil + return loadBalancerIP != "" && !strings.EqualFold(loadBalancerIP, pointer.StringDeref(config.PrivateIPAddress, "")), nil } - pipName, _, err := az.determinePublicIPName(clusterName, service, pips) + pipName, _, err := az.determinePublicIPName(clusterName, service, isIPv6) if err != nil { return false, err } @@ -1391,7 +1396,7 @@ func (az *Cloud) isFrontendIPChanged(clusterName string, config network.Frontend if !existsPip { return true, nil } - return config.PublicIPAddress != nil && !strings.EqualFold(to.String(pip.ID), to.String(config.PublicIPAddress.ID)), nil + return config.PublicIPAddress != nil && !strings.EqualFold(pointer.StringDeref(pip.ID, ""), pointer.StringDeref(config.PublicIPAddress.ID, "")), nil } // isFrontendIPConfigUnsafeToDelete checks if a frontend IP config is safe to be deleted. @@ -1508,10 +1513,10 @@ func findMatchedOutboundRuleFIPConfig(fipConfigID *string, outboundRuleFIPConfig func (az *Cloud) findFrontendIPConfigOfService( fipConfigs *[]network.FrontendIPConfiguration, service *v1.Service, - pips *[]network.PublicIPAddress, ) (*network.FrontendIPConfiguration, error) { for _, config := range *fipConfigs { - owns, _, err := az.serviceOwnsFrontendIP(config, service, pips) + config := config + owns, _, err := az.serviceOwnsFrontendIP(config, service) if err != nil { return nil, err } @@ -1546,7 +1551,8 @@ func (az *Cloud) reconcileLoadBalancer(clusterName string, service *v1.Service, lbName := *lb.Name lbResourceGroup := az.getLoadBalancerResourceGroup() - lbBackendPoolID := az.getBackendPoolID(lbName, az.getLoadBalancerResourceGroup(), getBackendPoolName(clusterName, service)) + isIPv6 := utilnet.IsIPv6String(service.Spec.ClusterIP) + lbBackendPoolID := az.getBackendPoolID(lbName, az.getLoadBalancerResourceGroup(), getBackendPoolName(clusterName, isIPv6)) klog.V(2).Infof("reconcileLoadBalancer for service(%s): lb(%s/%s) wantLb(%t) resolved load balancer name", serviceName, lbResourceGroup, lbName, wantLb) defaultLBFrontendIPConfigName := az.getDefaultFrontendIPConfigName(service) defaultLBFrontendIPConfigID := az.getFrontendIPConfigID(lbName, lbResourceGroup, defaultLBFrontendIPConfigName) @@ -1554,7 +1560,7 @@ func (az *Cloud) reconcileLoadBalancer(clusterName string, service *v1.Service, // reconcile the load balancer's backend pool configuration. if wantLb { - preConfig, changed, err := az.LoadBalancerBackendPool.ReconcileBackendPools(clusterName, service, lb) + preConfig, changed, shouldRefreshLB, err := az.LoadBalancerBackendPool.ReconcileBackendPools(clusterName, service, lb) if err != nil { return lb, err } @@ -1562,6 +1568,16 @@ func (az *Cloud) reconcileLoadBalancer(clusterName string, service *v1.Service, dirtyLb = true } isBackendPoolPreConfigured = preConfig + + // If the LB is changed, refresh it to avoid etag mismatch error + // later when create or update the LB. + if shouldRefreshLB { + klog.V(4).Infof("reconcileLoadBalancer for service(%s): refreshing load balancer %s", serviceName, lbName) + lb, _, err = az.getAzureLoadBalancer(lbName, azcache.CacheReadTypeForceRefresh) + if err != nil { + return lb, fmt.Errorf("reconcileLoadBalancer for service (%s): failed to get load balancer %s: %w", serviceName, lbName, err) + } + } } // reconcile the load balancer's frontend IP configurations. @@ -1623,7 +1639,7 @@ func (az *Cloud) reconcileLoadBalancer(clusterName string, service *v1.Service, "reconcileLoadBalancer for service(%s): lb(%s) - failed to clean up PrivateLinkService for frontEnd(%s): %v", serviceName, lbName, - to.String(fipConfigToDel.Name), + pointer.StringDeref(fipConfigToDel.Name, ""), err, ) } @@ -1668,7 +1684,8 @@ func (az *Cloud) reconcileLoadBalancer(clusterName string, service *v1.Service, if lb.LoadBalancerPropertiesFormat != nil && lb.BackendAddressPools != nil { backendPools := *lb.BackendAddressPools for _, backendPool := range backendPools { - if strings.EqualFold(to.String(backendPool.Name), getBackendPoolName(clusterName, service)) { + isIPv6 := isBackendPoolIPv6(pointer.StringDeref(backendPool.Name, "")) + if strings.EqualFold(pointer.StringDeref(backendPool.Name, ""), getBackendPoolName(clusterName, isIPv6)) { if err := az.LoadBalancerBackendPool.EnsureHostsInPool(service, nodes, lbBackendPoolID, vmSetName, clusterName, lbName, backendPool); err != nil { return nil, err } @@ -1783,13 +1800,11 @@ func (az *Cloud) reconcileFrontendIPConfigs(clusterName string, service *v1.Serv newConfigs = *lb.FrontendIPConfigurations } - // Save pip list so it can be reused in loop - var pips []network.PublicIPAddress var ownedFIPConfig *network.FrontendIPConfiguration if !wantLb { for i := len(newConfigs) - 1; i >= 0; i-- { config := newConfigs[i] - isServiceOwnsFrontendIP, _, err := az.serviceOwnsFrontendIP(config, service, &pips) + isServiceOwnsFrontendIP, _, err := az.serviceOwnsFrontendIP(config, service) if err != nil { return nil, toDeleteConfigs, false, err } @@ -1827,13 +1842,13 @@ func (az *Cloud) reconcileFrontendIPConfigs(clusterName string, service *v1.Serv ) for i := len(newConfigs) - 1; i >= 0; i-- { config := newConfigs[i] - isServiceOwnsFrontendIP, _, _ := az.serviceOwnsFrontendIP(config, service, &pips) + isServiceOwnsFrontendIP, _, _ := az.serviceOwnsFrontendIP(config, service) if !isServiceOwnsFrontendIP { - klog.V(4).Infof("reconcileFrontendIPConfigs for service (%s): the frontend IP configuration %s does not belong to the service", serviceName, to.String(config.Name)) + klog.V(4).Infof("reconcileFrontendIPConfigs for service (%s): the frontend IP configuration %s does not belong to the service", serviceName, pointer.StringDeref(config.Name, "")) continue } - klog.V(4).Infof("reconcileFrontendIPConfigs for service (%s): checking owned frontend IP configuration %s", serviceName, to.String(config.Name)) - isFipChanged, err = az.isFrontendIPChanged(clusterName, config, service, defaultLBFrontendIPConfigName, &pips) + klog.V(4).Infof("reconcileFrontendIPConfigs for service (%s): checking owned frontend IP configuration %s", serviceName, pointer.StringDeref(config.Name, "")) + isFipChanged, err = az.isFrontendIPChanged(clusterName, config, service, defaultLBFrontendIPConfigName) if err != nil { return nil, toDeleteConfigs, false, err } @@ -1847,7 +1862,7 @@ func (az *Cloud) reconcileFrontendIPConfigs(clusterName string, service *v1.Serv break } - ownedFIPConfig, err = az.findFrontendIPConfigOfService(&newConfigs, service, &pips) + ownedFIPConfig, err = az.findFrontendIPConfigOfService(&newConfigs, service) if err != nil { return nil, toDeleteConfigs, false, err } @@ -1875,32 +1890,34 @@ func (az *Cloud) reconcileFrontendIPConfigs(clusterName string, service *v1.Serv Subnet: &subnet, } - if utilnet.IsIPv6String(service.Spec.ClusterIP) { - configProperties.PrivateIPAddressVersion = network.IPVersionIPv6 + isIPv6 := utilnet.IsIPv6String(service.Spec.ClusterIP) + if isIPv6 { + configProperties.PrivateIPAddressVersion = network.IPv6 } - loadBalancerIP := getServiceLoadBalancerIP(service) + loadBalancerIP := getServiceLoadBalancerIP(service, isIPv6) if loadBalancerIP != "" { - configProperties.PrivateIPAllocationMethod = network.IPAllocationMethodStatic + configProperties.PrivateIPAllocationMethod = network.Static configProperties.PrivateIPAddress = &loadBalancerIP } else if status != nil && len(status.Ingress) > 0 && ipInSubnet(status.Ingress[0].IP, &subnet) { klog.V(4).Infof("reconcileFrontendIPConfigs for service (%s): keep the original private IP %s", serviceName, status.Ingress[0].IP) - configProperties.PrivateIPAllocationMethod = network.IPAllocationMethodStatic - configProperties.PrivateIPAddress = to.StringPtr(status.Ingress[0].IP) + configProperties.PrivateIPAllocationMethod = network.Static + configProperties.PrivateIPAddress = pointer.String(status.Ingress[0].IP) } else { // We'll need to call GetLoadBalancer later to retrieve allocated IP. klog.V(4).Infof("reconcileFrontendIPConfigs for service (%s): dynamically allocate the private IP", serviceName) - configProperties.PrivateIPAllocationMethod = network.IPAllocationMethodDynamic + configProperties.PrivateIPAllocationMethod = network.Dynamic } fipConfigurationProperties = &configProperties } else { - pipName, shouldPIPExisted, err := az.determinePublicIPName(clusterName, service, &pips) + isIPv6 := utilnet.IsIPv6String(service.Spec.ClusterIP) // TODO: dualstack support + pipName, shouldPIPExisted, err := az.determinePublicIPName(clusterName, service, isIPv6) if err != nil { return nil, toDeleteConfigs, false, err } domainNameLabel, found := getPublicIPDomainNameLabel(service) - pip, err := az.ensurePublicIPExists(service, pipName, domainNameLabel, clusterName, shouldPIPExisted, found) + pip, err := az.ensurePublicIPExists(service, pipName, domainNameLabel, clusterName, shouldPIPExisted, found, isIPv6) if err != nil { return nil, toDeleteConfigs, false, err } @@ -1910,8 +1927,8 @@ func (az *Cloud) reconcileFrontendIPConfigs(clusterName string, service *v1.Serv } newConfig := network.FrontendIPConfiguration{ - Name: to.StringPtr(defaultLBFrontendIPConfigName), - ID: to.StringPtr(fmt.Sprintf(consts.FrontendIPConfigIDTemplate, az.getNetworkResourceSubscriptionID(), az.ResourceGroup, *lb.Name, defaultLBFrontendIPConfigName)), + Name: pointer.String(defaultLBFrontendIPConfigName), + ID: pointer.String(fmt.Sprintf(consts.FrontendIPConfigIDTemplate, az.getNetworkResourceSubscriptionID(), az.ResourceGroup, *lb.Name, defaultLBFrontendIPConfigName)), FrontendIPConfigurationPropertiesFormat: fipConfigurationProperties, } @@ -2104,7 +2121,7 @@ func (az *Cloud) buildHealthProbeRulesForPort(serviceManifest *v1.Service, port // 4. Finally, if protocol is still nil, default to TCP if protocol == nil { - protocol = to.StringPtr(string(network.ProtocolTCP)) + protocol = pointer.String(string(network.ProtocolTCP)) } *protocol = strings.TrimSpace(*protocol) @@ -2169,17 +2186,16 @@ func (az *Cloud) buildHealthProbeRulesForPort(serviceManifest *v1.Service, port for _, item := range serviceManifest.Spec.Ports { if strings.EqualFold(item.Name, *probePort) { //found the port - properties.Port = to.Int32Ptr(item.NodePort) + properties.Port = pointer.Int32(item.NodePort) } } } else { - if port >= 0 || port <= 65535 { - for _, item := range serviceManifest.Spec.Ports { - //nolint:gosec - if item.Port == int32(port) { - //found the port - properties.Port = to.Int32Ptr(item.NodePort) - } + // Not need to verify probePort is in correct range again. + for _, item := range serviceManifest.Spec.Ports { + //nolint:gosec + if item.Port == int32(port) { + //found the port + properties.Port = pointer.Int32(item.NodePort) } } } @@ -2198,7 +2214,7 @@ func (az *Cloud) buildHealthProbeRulesForPort(serviceManifest *v1.Service, port } } if path == nil { - path = to.StringPtr(consts.HealthProbeDefaultRequestPath) + path = pointer.String(consts.HealthProbeDefaultRequestPath) } properties.RequestPath = path } @@ -2225,7 +2241,7 @@ func (az *Cloud) buildHealthProbeRulesForPort(serviceManifest *v1.Service, port // if numberOfProbes is not set, set it to default instead ref: https://docs.microsoft.com/en-us/rest/api/load-balancer/load-balancers/create-or-update#probe if numberOfProbes == nil { - numberOfProbes = to.Int32Ptr(consts.HealthProbeDefaultNumOfProbe) + numberOfProbes = pointer.Int32(consts.HealthProbeDefaultNumOfProbe) } // get probe interval in seconds @@ -2250,7 +2266,7 @@ func (az *Cloud) buildHealthProbeRulesForPort(serviceManifest *v1.Service, port } // if probeInterval is not set, set it to default instead ref: https://docs.microsoft.com/en-us/rest/api/load-balancer/load-balancers/create-or-update#probe if probeInterval == nil { - probeInterval = to.Int32Ptr(consts.HealthProbeDefaultProbeInterval) + probeInterval = pointer.Int32(consts.HealthProbeDefaultProbeInterval) } // total probe should be less than 120 seconds ref: https://docs.microsoft.com/en-us/rest/api/load-balancer/load-balancers/create-or-update#probe @@ -2258,7 +2274,7 @@ func (az *Cloud) buildHealthProbeRulesForPort(serviceManifest *v1.Service, port return nil, fmt.Errorf("total probe should be less than 120, please adjust interval and number of probe accordingly") } properties.IntervalInSeconds = probeInterval - properties.NumberOfProbes = numberOfProbes + properties.ProbeThreshold = numberOfProbes probe := &network.Probe{ Name: &lbrule, ProbePropertiesFormat: properties, @@ -2283,18 +2299,18 @@ func (az *Cloud) getExpectedLBRules( // healthcheck proxy server serves http requests // https://github.com/kubernetes/kubernetes/blob/7c013c3f64db33cf19f38bb2fc8d9182e42b0b7b/pkg/proxy/healthcheck/service_health.go#L236 var nodeEndpointHealthprobe *network.Probe - if servicehelpers.NeedsHealthCheck(service) { + if servicehelpers.NeedsHealthCheck(service) && !(consts.IsPLSEnabled(service.Annotations) && consts.IsPLSProxyProtocolEnabled(service.Annotations)) { podPresencePath, podPresencePort := servicehelpers.GetServiceHealthCheckPathPort(service) - lbRuleName := az.getLoadBalancerRuleName(service, v1.ProtocolTCP, podPresencePort) + lbRuleName := az.getLoadBalancerRuleName(service, v1.ProtocolTCP, podPresencePort, utilnet.IsIPv6String(service.Spec.ClusterIP)) nodeEndpointHealthprobe = &network.Probe{ Name: &lbRuleName, ProbePropertiesFormat: &network.ProbePropertiesFormat{ - RequestPath: to.StringPtr(podPresencePath), + RequestPath: pointer.String(podPresencePath), Protocol: network.ProbeProtocolHTTP, - Port: to.Int32Ptr(podPresencePort), - IntervalInSeconds: to.Int32Ptr(consts.HealthProbeDefaultProbeInterval), - NumberOfProbes: to.Int32Ptr(consts.HealthProbeDefaultNumOfProbe), + Port: pointer.Int32(podPresencePort), + IntervalInSeconds: pointer.Int32(consts.HealthProbeDefaultProbeInterval), + ProbeThreshold: pointer.Int32(consts.HealthProbeDefaultNumOfProbe), }, } expectedProbes = append(expectedProbes, *nodeEndpointHealthprobe) @@ -2306,7 +2322,7 @@ func (az *Cloud) getExpectedLBRules( az.useStandardLoadBalancer() && consts.IsK8sServiceHasHAModeEnabled(service) { - lbRuleName := az.getloadbalancerHAmodeRuleName(service) + lbRuleName := az.getloadbalancerHAmodeRuleName(service, utilnet.IsIPv6String(service.Spec.ClusterIP)) klog.V(2).Infof("getExpectedLBRules lb name (%s) rule name (%s)", lbName, lbRuleName) props, err := az.getExpectedHAModeLoadBalancingRuleProperties(service, lbFrontendIPConfigID, lbBackendPoolID) @@ -2325,7 +2341,7 @@ func (az *Cloud) getExpectedLBRules( } if portprobe != nil { props.Probe = &network.SubResource{ - ID: to.StringPtr(az.getLoadBalancerProbeID(lbName, az.getLoadBalancerResourceGroup(), *portprobe.Name)), + ID: pointer.String(az.getLoadBalancerProbeID(lbName, az.getLoadBalancerResourceGroup(), *portprobe.Name)), } expectedProbes = append(expectedProbes, *portprobe) break @@ -2333,7 +2349,7 @@ func (az *Cloud) getExpectedLBRules( } } else { props.Probe = &network.SubResource{ - ID: to.StringPtr(az.getLoadBalancerProbeID(lbName, az.getLoadBalancerResourceGroup(), *nodeEndpointHealthprobe.Name)), + ID: pointer.String(az.getLoadBalancerProbeID(lbName, az.getLoadBalancerResourceGroup(), *nodeEndpointHealthprobe.Name)), } } @@ -2346,7 +2362,7 @@ func (az *Cloud) getExpectedLBRules( // generate lb rule for each port defined in svc object for _, port := range service.Spec.Ports { - lbRuleName := az.getLoadBalancerRuleName(service, port.Protocol, port.Port) + lbRuleName := az.getLoadBalancerRuleName(service, port.Protocol, port.Port, utilnet.IsIPv6String(service.Spec.ClusterIP)) klog.V(2).Infof("getExpectedLBRules lb name (%s) rule name (%s)", lbName, lbRuleName) isNoLBRuleRequired, err := consts.IsLBRuleOnK8sServicePortDisabled(service.Annotations, port.Port) if err != nil { @@ -2387,19 +2403,19 @@ func (az *Cloud) getExpectedLBRules( } if portprobe != nil { props.Probe = &network.SubResource{ - ID: to.StringPtr(az.getLoadBalancerProbeID(lbName, az.getLoadBalancerResourceGroup(), *portprobe.Name)), + ID: pointer.String(az.getLoadBalancerProbeID(lbName, az.getLoadBalancerResourceGroup(), *portprobe.Name)), } expectedProbes = append(expectedProbes, *portprobe) } } else { props.Probe = &network.SubResource{ - ID: to.StringPtr(az.getLoadBalancerProbeID(lbName, az.getLoadBalancerResourceGroup(), *nodeEndpointHealthprobe.Name)), + ID: pointer.String(az.getLoadBalancerProbeID(lbName, az.getLoadBalancerResourceGroup(), *nodeEndpointHealthprobe.Name)), } } } if consts.IsK8sServiceDisableLoadBalancerFloatingIP(service) { - props.BackendPort = to.Int32Ptr(port.NodePort) - props.EnableFloatingIP = to.BoolPtr(false) + props.BackendPort = pointer.Int32(port.NodePort) + props.EnableFloatingIP = pointer.Bool(false) } expectedRules = append(expectedRules, network.LoadBalancingRule{ Name: &lbRuleName, @@ -2436,33 +2452,33 @@ func (az *Cloud) getExpectedLoadBalancingRulePropertiesForPort( }); err != nil { return nil, fmt.Errorf("error parsing idle timeout key: %s, err: %w", consts.ServiceAnnotationLoadBalancerIdleTimeout, err) } else if lbIdleTimeout == nil { - lbIdleTimeout = to.Int32Ptr(4) + lbIdleTimeout = pointer.Int32(4) } props := &network.LoadBalancingRulePropertiesFormat{ Protocol: transportProto, - FrontendPort: to.Int32Ptr(servicePort.Port), - BackendPort: to.Int32Ptr(servicePort.Port), - DisableOutboundSnat: to.BoolPtr(az.disableLoadBalancerOutboundSNAT()), - EnableFloatingIP: to.BoolPtr(true), + FrontendPort: pointer.Int32(servicePort.Port), + BackendPort: pointer.Int32(servicePort.Port), + DisableOutboundSnat: pointer.Bool(az.disableLoadBalancerOutboundSNAT()), + EnableFloatingIP: pointer.Bool(true), LoadDistribution: loadDistribution, FrontendIPConfiguration: &network.SubResource{ - ID: to.StringPtr(lbFrontendIPConfigID), + ID: pointer.String(lbFrontendIPConfigID), }, BackendAddressPool: &network.SubResource{ - ID: to.StringPtr(lbBackendPoolID), + ID: pointer.String(lbBackendPoolID), }, IdleTimeoutInMinutes: lbIdleTimeout, } if strings.EqualFold(string(transportProto), string(network.TransportProtocolTCP)) && az.useStandardLoadBalancer() { - props.EnableTCPReset = to.BoolPtr(true) + props.EnableTCPReset = pointer.Bool(true) } // Azure ILB does not support secondary IPs as floating IPs on the LB. Therefore, floating IP needs to be turned // off and the rule should point to the nodeIP:nodePort. if consts.IsK8sServiceInternalIPv6(service) { - props.BackendPort = to.Int32Ptr(servicePort.NodePort) - props.EnableFloatingIP = to.BoolPtr(false) + props.BackendPort = pointer.Int32(servicePort.NodePort) + props.EnableFloatingIP = pointer.Bool(false) } return props, nil } @@ -2476,7 +2492,7 @@ func (az *Cloud) getExpectedHAModeLoadBalancingRuleProperties( if err != nil { return nil, fmt.Errorf("error generate lb rule for ha mod loadbalancer. err: %w", err) } - props.EnableTCPReset = to.BoolPtr(true) + props.EnableTCPReset = pointer.Bool(true) return props, nil } @@ -2519,12 +2535,12 @@ func (az *Cloud) reconcileSecurityGroup(clusterName string, service *v1.Service, backendIPAddresses := make([]string, 0) if wantLb && disableFloatingIP { - lb, exist, err := az.getAzureLoadBalancer(to.String(lbName), azcache.CacheReadTypeDefault) + lb, exist, err := az.getAzureLoadBalancer(pointer.StringDeref(lbName, ""), azcache.CacheReadTypeDefault) if err != nil { return nil, err } if !exist { - return nil, fmt.Errorf("unable to get lb %s", to.String(lbName)) + return nil, fmt.Errorf("unable to get lb %s", pointer.StringDeref(lbName, "")) } backendPrivateIPv4s, backendPrivateIPv6s := az.LoadBalancerBackendPool.GetBackendPrivateIPs(clusterName, service, lb) backendIPAddresses = backendPrivateIPv4s @@ -2590,7 +2606,7 @@ func (az *Cloud) reconcileSecurityGroup(clusterName string, service *v1.Service, return nil, err } klog.V(10).Infof("CreateOrUpdateSecurityGroup(%q): end", *sg.Name) - _ = az.nsgCache.Delete(to.String(sg.Name)) + _ = az.nsgCache.Delete(pointer.StringDeref(sg.Name, "")) } return &sg, nil } @@ -2630,33 +2646,41 @@ func (az *Cloud) reconcileSecurityRules(sg network.SecurityGroup, service *v1.Se if useSharedSecurityRule(service) && !wantLb { for _, port := range ports { for _, sourceAddressPrefix := range sourceAddressPrefixes { - sharedRuleName := az.getSecurityRuleName(service, port, sourceAddressPrefix) + sharedRuleName := az.getSecurityRuleName(service, port, sourceAddressPrefix, utilnet.IsIPv6String(service.Spec.ClusterIP)) sharedIndex, sharedRule, sharedRuleFound := findSecurityRuleByName(updatedRules, sharedRuleName) if !sharedRuleFound { klog.V(4).Infof("Didn't find shared rule %s for service %s", sharedRuleName, service.Name) continue } - if sharedRule.DestinationAddressPrefixes == nil { - klog.V(4).Infof("Didn't find DestinationAddressPrefixes in shared rule for service %s", service.Name) - continue - } - existingPrefixes := *sharedRule.DestinationAddressPrefixes - for _, destinationIPAddress := range destinationIPAddresses { - addressIndex, found := findIndex(existingPrefixes, destinationIPAddress) - if !found { - klog.Warningf("Didn't find destination address %v in shared rule %s for service %s", destinationIPAddress, sharedRuleName, service.Name) - continue - } - if len(existingPrefixes) == 1 { - updatedRules = append(updatedRules[:sharedIndex], updatedRules[sharedIndex+1:]...) - } else { - newDestinations := append(existingPrefixes[:addressIndex], existingPrefixes[addressIndex+1:]...) - sharedRule.DestinationAddressPrefixes = &newDestinations - updatedRules[sharedIndex] = sharedRule + shouldDeleteNSGRule := false + if sharedRule.DestinationAddressPrefixes == nil || len(*sharedRule.DestinationAddressPrefixes) == 0 { + shouldDeleteNSGRule = true + } else { + existingPrefixes := *sharedRule.DestinationAddressPrefixes + for _, destinationIPAddress := range destinationIPAddresses { + addressIndex, found := findIndex(existingPrefixes, destinationIPAddress) + if !found { + klog.Warningf("Didn't find destination address %v in shared rule %s for service %s", destinationIPAddress, sharedRuleName, service.Name) + continue + } + if len(existingPrefixes) == 1 { + shouldDeleteNSGRule = true + break //shared nsg rule has only one entry and entry owned by deleted svc has been found. skip the rest of the entries + } else { + newDestinations := append(existingPrefixes[:addressIndex], existingPrefixes[addressIndex+1:]...) + sharedRule.DestinationAddressPrefixes = &newDestinations + updatedRules[sharedIndex] = sharedRule + } + dirtySg = true } - dirtySg = true } + if shouldDeleteNSGRule { + klog.V(4).Infof("shared rule will be deleted because last service %s which refers this rule is deleted.", service.Name) + updatedRules = append(updatedRules[:sharedIndex], updatedRules[sharedIndex+1:]...) + dirtySg = true + continue + } } } } @@ -2681,10 +2705,14 @@ func (az *Cloud) reconcileSecurityRules(sg network.SecurityGroup, service *v1.Se } if foundRule && allowsConsolidation(expectedRule) { index, _ := findConsolidationCandidate(updatedRules, expectedRule) - updatedRules[index] = consolidate(updatedRules[index], expectedRule) + if updatedRules[index].DestinationAddressPrefixes != nil { + updatedRules[index] = consolidate(updatedRules[index], expectedRule) + } else { + updatedRules = append(updatedRules[:index], updatedRules[index+1:]...) + } dirtySg = true } - if !foundRule { + if !foundRule && wantLb { klog.V(10).Infof("reconcile(%s)(%t): sg rule(%s) - adding", serviceName, wantLb, *expectedRule.Name) nextAvailablePriority, err := getNextAvailablePriority(updatedRules) @@ -2692,7 +2720,7 @@ func (az *Cloud) reconcileSecurityRules(sg network.SecurityGroup, service *v1.Se return false, nil, err } - expectedRule.Priority = to.Int32Ptr(nextAvailablePriority) + expectedRule.Priority = pointer.Int32(nextAvailablePriority) updatedRules = append(updatedRules, expectedRule) dirtySg = true } @@ -2723,26 +2751,26 @@ func (az *Cloud) getExpectedSecurityRules(wantLb bool, ports []v1.ServicePort, s } for j := range sourceAddressPrefixes { ix := i*len(sourceAddressPrefixes) + j - securityRuleName := az.getSecurityRuleName(service, port, sourceAddressPrefixes[j]) + securityRuleName := az.getSecurityRuleName(service, port, sourceAddressPrefixes[j], utilnet.IsIPv6String(service.Spec.ClusterIP)) nsgRule := network.SecurityRule{ - Name: to.StringPtr(securityRuleName), + Name: pointer.String(securityRuleName), SecurityRulePropertiesFormat: &network.SecurityRulePropertiesFormat{ Protocol: *securityProto, - SourcePortRange: to.StringPtr("*"), - DestinationPortRange: to.StringPtr(strconv.Itoa(int(dstPort))), - SourceAddressPrefix: to.StringPtr(sourceAddressPrefixes[j]), + SourcePortRange: pointer.String("*"), + DestinationPortRange: pointer.String(strconv.Itoa(int(dstPort))), + SourceAddressPrefix: pointer.String(sourceAddressPrefixes[j]), Access: network.SecurityRuleAccessAllow, Direction: network.SecurityRuleDirectionInbound, }, } if len(destinationIPAddresses) == 1 && disableFloatingIP { - nsgRule.DestinationAddressPrefixes = to.StringSlicePtr(backendIPAddresses) + nsgRule.DestinationAddressPrefixes = &(backendIPAddresses) } else if len(destinationIPAddresses) == 1 && !disableFloatingIP { // continue to use DestinationAddressPrefix to avoid NSG updates for existing rules. - nsgRule.DestinationAddressPrefix = to.StringPtr(destinationIPAddresses[0]) + nsgRule.DestinationAddressPrefix = pointer.String(destinationIPAddresses[0]) } else { - nsgRule.DestinationAddressPrefixes = to.StringSlicePtr(destinationIPAddresses) + nsgRule.DestinationAddressPrefixes = &(destinationIPAddresses) } expectedSecurityRules[ix] = nsgRule } @@ -2760,23 +2788,23 @@ func (az *Cloud) getExpectedSecurityRules(wantLb bool, ports []v1.ServicePort, s if err != nil { return nil, err } - securityRuleName := az.getSecurityRuleName(service, port, "deny_all") + securityRuleName := az.getSecurityRuleName(service, port, "deny_all", utilnet.IsIPv6String(service.Spec.ClusterIP)) nsgRule := network.SecurityRule{ - Name: to.StringPtr(securityRuleName), + Name: pointer.String(securityRuleName), SecurityRulePropertiesFormat: &network.SecurityRulePropertiesFormat{ Protocol: *securityProto, - SourcePortRange: to.StringPtr("*"), - DestinationPortRange: to.StringPtr(strconv.Itoa(int(port.Port))), - SourceAddressPrefix: to.StringPtr("*"), + SourcePortRange: pointer.String("*"), + DestinationPortRange: pointer.String(strconv.Itoa(int(port.Port))), + SourceAddressPrefix: pointer.String("*"), Access: network.SecurityRuleAccessDeny, Direction: network.SecurityRuleDirectionInbound, }, } if len(destinationIPAddresses) == 1 { // continue to use DestinationAddressPrefix to avoid NSG updates for existing rules. - nsgRule.DestinationAddressPrefix = to.StringPtr(destinationIPAddresses[0]) + nsgRule.DestinationAddressPrefix = pointer.String(destinationIPAddresses[0]) } else { - nsgRule.DestinationAddressPrefixes = to.StringSlicePtr(destinationIPAddresses) + nsgRule.DestinationAddressPrefixes = &(destinationIPAddresses) } expectedSecurityRules = append(expectedSecurityRules, nsgRule) } @@ -2784,7 +2812,7 @@ func (az *Cloud) getExpectedSecurityRules(wantLb bool, ports []v1.ServicePort, s } for _, r := range expectedSecurityRules { - klog.V(10).Infof("Expecting security rule for %s: %s:%s -> %v %v :%s", service.Name, to.String(r.SourceAddressPrefix), to.String(r.SourcePortRange), to.String(r.DestinationAddressPrefix), to.StringSlice(r.DestinationAddressPrefixes), to.String(r.DestinationPortRange)) + klog.V(10).Infof("Expecting security rule for %s: %s:%s -> %v %v :%s", service.Name, pointer.StringDeref(r.SourceAddressPrefix, ""), pointer.StringDeref(r.SourcePortRange, ""), pointer.StringDeref(r.DestinationAddressPrefix, ""), stringSlice(r.DestinationAddressPrefixes), pointer.StringDeref(r.DestinationPortRange, "")) } return expectedSecurityRules, nil } @@ -2835,13 +2863,13 @@ func findIndex(strs []string, s string) (int, bool) { } func allowsConsolidation(rule network.SecurityRule) bool { - return strings.HasPrefix(to.String(rule.Name), "shared") + return strings.HasPrefix(pointer.StringDeref(rule.Name, ""), "shared") } func findConsolidationCandidate(rules []network.SecurityRule, rule network.SecurityRule) (int, bool) { for index, r := range rules { if allowsConsolidation(r) { - if strings.EqualFold(to.String(r.Name), to.String(rule.Name)) { + if strings.EqualFold(pointer.StringDeref(r.Name, ""), pointer.StringDeref(rule.Name, "")) { return index, true } } @@ -2974,6 +3002,8 @@ func shouldReleaseExistingOwnedPublicIP(existingPip *network.PublicIPAddress, lb // #2 - If the load balancer is internal, and thus doesn't require public exposure lbIsInternal || // #3 - If the name of this public ip does not match the desired name, + // NOTICE: For IPv6 Service created with CCM v1.27.1, the created PIP has IPv6 suffix. + // We need to recreate such PIP and current logic to delete needs no change. (pipName != desiredPipName) || // #4 If the service annotations have specified the ip tags that the public ip must have, but they do not match the ip tags of the existing instance (ipTagRequest.IPTagsRequestedByAnnotation && !areIPTagsEquivalent(currentIPTags, ipTagRequest.IPTags)) @@ -2991,25 +3021,31 @@ func (az *Cloud) ensurePIPTagged(service *v1.Service, pip *network.PublicIPAddre found, key := findKeyInMapCaseInsensitive(configTags, k) if !found { configTags[k] = v - } else if !strings.EqualFold(to.String(v), to.String(configTags[key])) { + } else if !strings.EqualFold(pointer.StringDeref(v, ""), pointer.StringDeref(configTags[key], "")) { configTags[key] = v } } // include the cluster name and service names tags when comparing - var clusterName, serviceNames *string + var clusterName, serviceNames, serviceNameUsingDNS *string if v := getClusterFromPIPClusterTags(pip.Tags); v != "" { clusterName = &v } if v := getServiceFromPIPServiceTags(pip.Tags); v != "" { serviceNames = &v } + if v := getServiceFromPIPDNSTags(pip.Tags); v != "" { + serviceNameUsingDNS = &v + } if clusterName != nil { configTags[consts.ClusterNameKey] = clusterName } if serviceNames != nil { configTags[consts.ServiceTagKey] = serviceNames } + if serviceNameUsingDNS != nil { + configTags[consts.ServiceUsingDNSKey] = serviceNameUsingDNS + } tags, changed := az.reconcileTags(pip.Tags, configTags) pip.Tags = tags @@ -3017,11 +3053,54 @@ func (az *Cloud) ensurePIPTagged(service *v1.Service, pip *network.PublicIPAddre return changed } -// This reconciles the PublicIP resources similar to how the LB is reconciled. -func (az *Cloud) reconcilePublicIP(clusterName string, service *v1.Service, lbName string, wantLb bool) (*network.PublicIPAddress, error) { +// reconcilePublicIPs reconciles the PublicIP resources similar to how the LB is reconciled. +func (az *Cloud) reconcilePublicIPs(clusterName string, service *v1.Service, lbName string, wantLb bool) ([]*network.PublicIPAddress, error) { + pipResourceGroup := az.getPublicIPAddressResourceGroup(service) + + reconciledPIPs := []*network.PublicIPAddress{} + pips, err := az.listPIP(pipResourceGroup, azcache.CacheReadTypeDefault) + if err != nil { + return nil, err + } + + pipsV4, pipsV6 := []network.PublicIPAddress{}, []network.PublicIPAddress{} + for _, pip := range pips { + if pip.PublicIPAddressPropertiesFormat == nil || pip.PublicIPAddressPropertiesFormat.PublicIPAddressVersion == "" || + pip.PublicIPAddressPropertiesFormat.PublicIPAddressVersion == network.IPv4 { + pipsV4 = append(pipsV4, pip) + } else { + pipsV6 = append(pipsV6, pip) + } + } + + v4Enabled, v6Enabled := getIPFamiliesEnabled(service) + if v4Enabled { + reconciledPIP, err := az.reconcilePublicIP(pipsV4, clusterName, service, lbName, wantLb, false) + if err != nil { + return reconciledPIPs, err + } + if reconciledPIP != nil { + reconciledPIPs = append(reconciledPIPs, reconciledPIP) + } + } + if v6Enabled { + reconciledPIP, err := az.reconcilePublicIP(pipsV6, clusterName, service, lbName, wantLb, true) + if err != nil { + return reconciledPIPs, err + } + if reconciledPIP != nil { + reconciledPIPs = append(reconciledPIPs, reconciledPIP) + } + } + return reconciledPIPs, nil +} + +// reconcilePublicIP reconciles the PublicIP resources similar to how the LB is reconciled with the specified IP family. +func (az *Cloud) reconcilePublicIP(pips []network.PublicIPAddress, clusterName string, service *v1.Service, lbName string, wantLb, isIPv6 bool) (*network.PublicIPAddress, error) { isInternal := requiresInternalLoadBalancer(service) serviceName := getServiceName(service) serviceIPTagRequest := getServiceIPTagRequestForPublicIP(service) + pipResourceGroup := az.getPublicIPAddressResourceGroup(service) var ( lb *network.LoadBalancer @@ -3030,15 +3109,8 @@ func (az *Cloud) reconcilePublicIP(clusterName string, service *v1.Service, lbNa shouldPIPExisted bool ) - pipResourceGroup := az.getPublicIPAddressResourceGroup(service) - - pips, err := az.ListPIP(service, pipResourceGroup) - if err != nil { - return nil, err - } - if !isInternal && wantLb { - desiredPipName, shouldPIPExisted, err = az.determinePublicIPName(clusterName, service, &pips) + desiredPipName, shouldPIPExisted, err = az.determinePublicIPName(clusterName, service, isIPv6) if err != nil { return nil, err } @@ -3052,7 +3124,7 @@ func (az *Cloud) reconcilePublicIP(clusterName string, service *v1.Service, lbNa } discoveredDesiredPublicIP, pipsToBeDeleted, deletedDesiredPublicIP, pipsToBeUpdated, err := az.getPublicIPUpdates( - clusterName, service, pips, wantLb, isInternal, desiredPipName, serviceName, serviceIPTagRequest, shouldPIPExisted) + clusterName, service, pips, wantLb, isInternal, desiredPipName, serviceName, serviceIPTagRequest, shouldPIPExisted, isIPv6) if err != nil { return nil, err } @@ -3061,7 +3133,7 @@ func (az *Cloud) reconcilePublicIP(clusterName string, service *v1.Service, lbNa for _, pip := range pipsToBeUpdated { pipCopy := *pip updateFuncs = append(updateFuncs, func() error { - klog.V(2).Infof("reconcilePublicIP for service(%s): pip(%s) - updating", serviceName, *pip.Name) + klog.V(2).Infof("reconcilePublicIP for service(%s): pip(%s), isIPv6(%v) - updating", serviceName, *pip.Name, isIPv6) return az.CreateOrUpdatePIP(service, pipResourceGroup, pipCopy) }) } @@ -3073,7 +3145,7 @@ func (az *Cloud) reconcilePublicIP(clusterName string, service *v1.Service, lbNa for _, pip := range pipsToBeDeleted { pipCopy := *pip deleteFuncs = append(deleteFuncs, func() error { - klog.V(2).Infof("reconcilePublicIP for service(%s): pip(%s) - deleting", serviceName, *pip.Name) + klog.V(2).Infof("reconcilePublicIP for service(%s): pip(%s), isIPv6(%v) - deleting", serviceName, *pip.Name, isIPv6) return az.safeDeletePublicIP(service, pipResourceGroup, &pipCopy, lb) }) } @@ -3087,7 +3159,7 @@ func (az *Cloud) reconcilePublicIP(clusterName string, service *v1.Service, lbNa var pip *network.PublicIPAddress domainNameLabel, found := getPublicIPDomainNameLabel(service) errorIfPublicIPDoesNotExist := shouldPIPExisted && discoveredDesiredPublicIP && !deletedDesiredPublicIP - if pip, err = az.ensurePublicIPExists(service, desiredPipName, domainNameLabel, clusterName, errorIfPublicIPDoesNotExist, found); err != nil { + if pip, err = az.ensurePublicIPExists(service, desiredPipName, domainNameLabel, clusterName, errorIfPublicIPDoesNotExist, found, isIPv6); err != nil { return nil, err } return pip, nil @@ -3095,6 +3167,7 @@ func (az *Cloud) reconcilePublicIP(clusterName string, service *v1.Service, lbNa return nil, nil } +// getPublicIPUpdates handles one IP family only according to isIPv6 and PIP IP version. func (az *Cloud) getPublicIPUpdates( clusterName string, service *v1.Service, @@ -3104,7 +3177,8 @@ func (az *Cloud) getPublicIPUpdates( desiredPipName string, serviceName string, serviceIPTagRequest serviceIPTagRequest, - serviceAnnotationRequestsNamedPublicIP bool, + serviceAnnotationRequestsNamedPublicIP, + isIPv6 bool, ) (bool, []*network.PublicIPAddress, bool, []*network.PublicIPAddress, error) { var ( err error @@ -3115,6 +3189,13 @@ func (az *Cloud) getPublicIPUpdates( ) for i := range pips { pip := pips[i] + if pip.PublicIPAddressPropertiesFormat != nil && pip.PublicIPAddressPropertiesFormat.PublicIPAddressVersion != "" { + if (pip.PublicIPAddressPropertiesFormat.PublicIPAddressVersion == network.IPv4 && isIPv6) || + (pip.PublicIPAddressPropertiesFormat.PublicIPAddressVersion == network.IPv6 && !isIPv6) { + continue + } + } + pipName := *pip.Name // If we've been told to use a specific public ip by the client, let's track whether or not it actually existed @@ -3126,7 +3207,7 @@ func (az *Cloud) getPublicIPUpdates( owns, isUserAssignedPIP := serviceOwnsPublicIP(service, &pip, clusterName) if owns { var dirtyPIP, toBeDeleted bool - if !wantLb { + if !wantLb && !isUserAssignedPIP { klog.V(2).Infof("reconcilePublicIP for service(%s): unbinding the service from pip %s", serviceName, *pip.Name) if err = unbindServiceFromPIP(&pip, service, serviceName, clusterName, isUserAssignedPIP); err != nil { return false, nil, false, nil, err @@ -3171,70 +3252,82 @@ func (az *Cloud) getPublicIPUpdates( func (az *Cloud) safeDeletePublicIP(service *v1.Service, pipResourceGroup string, pip *network.PublicIPAddress, lb *network.LoadBalancer) error { // Remove references if pip.IPConfiguration is not nil. if pip.PublicIPAddressPropertiesFormat != nil && - pip.PublicIPAddressPropertiesFormat.IPConfiguration != nil && - lb != nil && lb.LoadBalancerPropertiesFormat != nil && - lb.LoadBalancerPropertiesFormat.FrontendIPConfigurations != nil { - referencedLBRules := []network.SubResource{} - frontendIPConfigUpdated := false - loadBalancerRuleUpdated := false - - // Check whether there are still frontend IP configurations referring to it. - ipConfigurationID := to.String(pip.PublicIPAddressPropertiesFormat.IPConfiguration.ID) - if ipConfigurationID != "" { - lbFrontendIPConfigs := *lb.LoadBalancerPropertiesFormat.FrontendIPConfigurations - for i := len(lbFrontendIPConfigs) - 1; i >= 0; i-- { - config := lbFrontendIPConfigs[i] - if strings.EqualFold(ipConfigurationID, to.String(config.ID)) { - if config.FrontendIPConfigurationPropertiesFormat != nil && - config.FrontendIPConfigurationPropertiesFormat.LoadBalancingRules != nil { - referencedLBRules = *config.FrontendIPConfigurationPropertiesFormat.LoadBalancingRules - } + pip.PublicIPAddressPropertiesFormat.IPConfiguration != nil { + // Fetch latest pip to check if the pip in the cache is stale. + // In some cases the public IP to be deleted is still referencing + // the frontend IP config on the LB. This is because the pip is + // stored in the cache and is not up-to-date. + latestPIP, ok, err := az.getPublicIPAddress(pipResourceGroup, *pip.Name, azcache.CacheReadTypeForceRefresh) + if err != nil { + klog.Errorf("safeDeletePublicIP: failed to get latest public IP %s/%s: %s", pipResourceGroup, *pip.Name, err.Error()) + return err + } + if ok && latestPIP.PublicIPAddressPropertiesFormat != nil && + latestPIP.PublicIPAddressPropertiesFormat.IPConfiguration != nil && + lb != nil && lb.LoadBalancerPropertiesFormat != nil && + lb.LoadBalancerPropertiesFormat.FrontendIPConfigurations != nil { + referencedLBRules := []network.SubResource{} + frontendIPConfigUpdated := false + loadBalancerRuleUpdated := false + + // Check whether there are still frontend IP configurations referring to it. + ipConfigurationID := pointer.StringDeref(pip.PublicIPAddressPropertiesFormat.IPConfiguration.ID, "") + if ipConfigurationID != "" { + lbFrontendIPConfigs := *lb.LoadBalancerPropertiesFormat.FrontendIPConfigurations + for i := len(lbFrontendIPConfigs) - 1; i >= 0; i-- { + config := lbFrontendIPConfigs[i] + if strings.EqualFold(ipConfigurationID, pointer.StringDeref(config.ID, "")) { + if config.FrontendIPConfigurationPropertiesFormat != nil && + config.FrontendIPConfigurationPropertiesFormat.LoadBalancingRules != nil { + referencedLBRules = *config.FrontendIPConfigurationPropertiesFormat.LoadBalancingRules + } - frontendIPConfigUpdated = true - lbFrontendIPConfigs = append(lbFrontendIPConfigs[:i], lbFrontendIPConfigs[i+1:]...) - break + frontendIPConfigUpdated = true + lbFrontendIPConfigs = append(lbFrontendIPConfigs[:i], lbFrontendIPConfigs[i+1:]...) + break + } } - } - if frontendIPConfigUpdated { - lb.LoadBalancerPropertiesFormat.FrontendIPConfigurations = &lbFrontendIPConfigs + if frontendIPConfigUpdated { + lb.LoadBalancerPropertiesFormat.FrontendIPConfigurations = &lbFrontendIPConfigs + } } - } - // Check whether there are still load balancer rules referring to it. - if len(referencedLBRules) > 0 { - referencedLBRuleIDs := sets.NewString() - for _, refer := range referencedLBRules { - referencedLBRuleIDs.Insert(to.String(refer.ID)) - } + // Check whether there are still load balancer rules referring to it. + if len(referencedLBRules) > 0 { + referencedLBRuleIDs := sets.New[string]() + for _, refer := range referencedLBRules { + referencedLBRuleIDs.Insert(pointer.StringDeref(refer.ID, "")) + } - if lb.LoadBalancerPropertiesFormat.LoadBalancingRules != nil { - lbRules := *lb.LoadBalancerPropertiesFormat.LoadBalancingRules - for i := len(lbRules) - 1; i >= 0; i-- { - ruleID := to.String(lbRules[i].ID) - if ruleID != "" && referencedLBRuleIDs.Has(ruleID) { - loadBalancerRuleUpdated = true - lbRules = append(lbRules[:i], lbRules[i+1:]...) + if lb.LoadBalancerPropertiesFormat.LoadBalancingRules != nil { + lbRules := *lb.LoadBalancerPropertiesFormat.LoadBalancingRules + for i := len(lbRules) - 1; i >= 0; i-- { + ruleID := pointer.StringDeref(lbRules[i].ID, "") + if ruleID != "" && referencedLBRuleIDs.Has(ruleID) { + loadBalancerRuleUpdated = true + lbRules = append(lbRules[:i], lbRules[i+1:]...) + } } - } - if loadBalancerRuleUpdated { - lb.LoadBalancerPropertiesFormat.LoadBalancingRules = &lbRules + if loadBalancerRuleUpdated { + lb.LoadBalancerPropertiesFormat.LoadBalancingRules = &lbRules + } } } - } - // Update load balancer when frontendIPConfigUpdated or loadBalancerRuleUpdated. - if frontendIPConfigUpdated || loadBalancerRuleUpdated { - err := az.CreateOrUpdateLB(service, *lb) - if err != nil { - klog.Errorf("safeDeletePublicIP for service(%s) failed with error: %v", getServiceName(service), err) - return err + // Update load balancer when frontendIPConfigUpdated or loadBalancerRuleUpdated. + if frontendIPConfigUpdated || loadBalancerRuleUpdated { + err := az.CreateOrUpdateLB(service, *lb) + if err != nil { + klog.Errorf("safeDeletePublicIP for service(%s) failed with error: %v", getServiceName(service), err) + return err + } } } } - pipName := to.String(pip.Name) + pipName := pointer.StringDeref(pip.Name, "") klog.V(10).Infof("DeletePublicIP(%s, %q): start", pipResourceGroup, pipName) err := az.DeletePublicIP(service, pipResourceGroup, pipName) if err != nil { @@ -3247,12 +3340,12 @@ func (az *Cloud) safeDeletePublicIP(service *v1.Service, pipResourceGroup string func findProbe(probes []network.Probe, probe network.Probe) bool { for _, existingProbe := range probes { - if strings.EqualFold(to.String(existingProbe.Name), to.String(probe.Name)) && - to.Int32(existingProbe.Port) == to.Int32(probe.Port) && + if strings.EqualFold(pointer.StringDeref(existingProbe.Name, ""), pointer.StringDeref(probe.Name, "")) && + pointer.Int32Deref(existingProbe.Port, 0) == pointer.Int32Deref(probe.Port, 0) && strings.EqualFold(string(existingProbe.Protocol), string(probe.Protocol)) && - strings.EqualFold(to.String(existingProbe.RequestPath), to.String(probe.RequestPath)) && - to.Int32(existingProbe.IntervalInSeconds) == to.Int32(probe.IntervalInSeconds) && - to.Int32(existingProbe.NumberOfProbes) == to.Int32(probe.NumberOfProbes) { + strings.EqualFold(pointer.StringDeref(existingProbe.RequestPath, ""), pointer.StringDeref(probe.RequestPath, "")) && + pointer.Int32Deref(existingProbe.IntervalInSeconds, 0) == pointer.Int32Deref(probe.IntervalInSeconds, 0) && + pointer.Int32Deref(existingProbe.ProbeThreshold, 0) == pointer.Int32Deref(probe.ProbeThreshold, 0) { return true } } @@ -3261,7 +3354,7 @@ func findProbe(probes []network.Probe, probe network.Probe) bool { func findRule(rules []network.LoadBalancingRule, rule network.LoadBalancingRule, wantLB bool) bool { for _, existingRule := range rules { - if strings.EqualFold(to.String(existingRule.Name), to.String(rule.Name)) && + if strings.EqualFold(pointer.StringDeref(existingRule.Name, ""), pointer.StringDeref(rule.Name, "")) && equalLoadBalancingRulePropertiesFormat(existingRule.LoadBalancingRulePropertiesFormat, rule.LoadBalancingRulePropertiesFormat, wantLB) { return true } @@ -3282,7 +3375,7 @@ func equalLoadBalancingRulePropertiesFormat(s *network.LoadBalancingRuleProperti } if reflect.DeepEqual(s.Protocol, network.TransportProtocolTCP) { - properties = properties && reflect.DeepEqual(to.Bool(s.EnableTCPReset), to.Bool(t.EnableTCPReset)) + properties = properties && reflect.DeepEqual(pointer.BoolDeref(s.EnableTCPReset, false), pointer.BoolDeref(t.EnableTCPReset, false)) } properties = properties && equalSubResource(s.FrontendIPConfiguration, t.FrontendIPConfiguration) && @@ -3292,7 +3385,7 @@ func equalLoadBalancingRulePropertiesFormat(s *network.LoadBalancingRuleProperti reflect.DeepEqual(s.BackendPort, t.BackendPort) && equalSubResource(s.Probe, t.Probe) && reflect.DeepEqual(s.EnableFloatingIP, t.EnableFloatingIP) && - reflect.DeepEqual(to.Bool(s.DisableOutboundSnat), to.Bool(t.DisableOutboundSnat)) + reflect.DeepEqual(pointer.BoolDeref(s.DisableOutboundSnat, false), pointer.BoolDeref(t.DisableOutboundSnat, false)) if wantLB && s.IdleTimeoutInMinutes != nil && t.IdleTimeoutInMinutes != nil { return properties && reflect.DeepEqual(s.IdleTimeoutInMinutes, t.IdleTimeoutInMinutes) @@ -3307,7 +3400,7 @@ func equalSubResource(s *network.SubResource, t *network.SubResource) bool { if s == nil || t == nil { return false } - return strings.EqualFold(to.String(s.ID), to.String(t.ID)) + return strings.EqualFold(pointer.StringDeref(s.ID, ""), pointer.StringDeref(t.ID, "")) } // This compares rule's Name, Protocol, SourcePortRange, DestinationPortRange, SourceAddressPrefix, Access, and Direction. @@ -3316,26 +3409,26 @@ func equalSubResource(s *network.SubResource, t *network.SubResource) bool { // despite different DestinationAddressPrefixes, in order to give it a chance to consolidate the two rules. func findSecurityRule(rules []network.SecurityRule, rule network.SecurityRule) bool { for _, existingRule := range rules { - if !strings.EqualFold(to.String(existingRule.Name), to.String(rule.Name)) { + if !strings.EqualFold(pointer.StringDeref(existingRule.Name, ""), pointer.StringDeref(rule.Name, "")) { continue } if !strings.EqualFold(string(existingRule.Protocol), string(rule.Protocol)) { continue } - if !strings.EqualFold(to.String(existingRule.SourcePortRange), to.String(rule.SourcePortRange)) { + if !strings.EqualFold(pointer.StringDeref(existingRule.SourcePortRange, ""), pointer.StringDeref(rule.SourcePortRange, "")) { continue } - if !strings.EqualFold(to.String(existingRule.DestinationPortRange), to.String(rule.DestinationPortRange)) { + if !strings.EqualFold(pointer.StringDeref(existingRule.DestinationPortRange, ""), pointer.StringDeref(rule.DestinationPortRange, "")) { continue } - if !strings.EqualFold(to.String(existingRule.SourceAddressPrefix), to.String(rule.SourceAddressPrefix)) { + if !strings.EqualFold(pointer.StringDeref(existingRule.SourceAddressPrefix, ""), pointer.StringDeref(rule.SourceAddressPrefix, "")) { continue } if !allowsConsolidation(existingRule) && !allowsConsolidation(rule) { - if !strings.EqualFold(to.String(existingRule.DestinationAddressPrefix), to.String(rule.DestinationAddressPrefix)) { + if !strings.EqualFold(pointer.StringDeref(existingRule.DestinationAddressPrefix, ""), pointer.StringDeref(rule.DestinationAddressPrefix, "")) { continue } - if !slices.Equal(to.StringSlice(existingRule.DestinationAddressPrefixes), to.StringSlice(rule.DestinationAddressPrefixes)) { + if !slices.Equal(stringSlice(existingRule.DestinationAddressPrefixes), stringSlice(rule.DestinationAddressPrefixes)) { continue } } @@ -3481,20 +3574,21 @@ func serviceOwnsPublicIP(service *v1.Service, pip *network.PublicIPAddress, clus return false, false } - if pip.PublicIPAddressPropertiesFormat == nil || to.String(pip.IPAddress) == "" { + if pip.PublicIPAddressPropertiesFormat == nil || pointer.StringDeref(pip.IPAddress, "") == "" { klog.Warningf("serviceOwnsPublicIP: empty pip.IPAddress") return false, false } serviceName := getServiceName(service) + isIPv6 := pip.PublicIPAddressVersion == network.IPv6 if pip.Tags != nil { serviceTag := getServiceFromPIPServiceTags(pip.Tags) clusterTag := getClusterFromPIPClusterTags(pip.Tags) // if there is no service tag on the pip, it is user-created pip if serviceTag == "" { - return strings.EqualFold(to.String(pip.IPAddress), getServiceLoadBalancerIP(service)), true + return isServiceLoadBalancerIPMatchesPIP(service, pip, isIPv6), true } // if there is service tag on the pip, it is system-created pip @@ -3506,17 +3600,20 @@ func serviceOwnsPublicIP(service *v1.Service, pip *network.PublicIPAddress, clus } // If cluster name tag is set, then return true if it matches. - if clusterTag == clusterName { - return true, false - } - } else { - // if the service is not included in the tags of the system-created pip, check the ip address - // this could happen for secondary services - return strings.EqualFold(to.String(pip.IPAddress), getServiceLoadBalancerIP(service)), false + return strings.EqualFold(clusterTag, clusterName), false } + + // if the service is not included in the tags of the system-created pip, check the ip address + // this could happen for secondary services + return isServiceLoadBalancerIPMatchesPIP(service, pip, isIPv6), false } - return false, false + // if the pip has no tags, it should be user-created + return isServiceLoadBalancerIPMatchesPIP(service, pip, isIPv6), true +} + +func isServiceLoadBalancerIPMatchesPIP(service *v1.Service, pip *network.PublicIPAddress, isIPV6 bool) bool { + return strings.EqualFold(pointer.StringDeref(pip.IPAddress, ""), getServiceLoadBalancerIP(service, isIPV6)) } func isSVCNameInPIPTag(tag, svcName string) bool { @@ -3559,17 +3656,17 @@ func bindServicesToPIP(pip *network.PublicIPAddress, incomingServiceNames []stri } if pip.Tags == nil { - pip.Tags = map[string]*string{consts.ServiceTagKey: to.StringPtr("")} + pip.Tags = map[string]*string{consts.ServiceTagKey: pointer.String("")} } - serviceTagValue := to.StringPtr(getServiceFromPIPServiceTags(pip.Tags)) + serviceTagValue := pointer.String(getServiceFromPIPServiceTags(pip.Tags)) serviceTagValueSet := make(map[string]struct{}) existingServiceNames := parsePIPServiceTag(serviceTagValue) addedNew := false // replace is used when unbinding the service from PIP so addedNew remains false all the time if replace { - serviceTagValue = to.StringPtr(strings.Join(incomingServiceNames, ",")) + serviceTagValue = pointer.String(strings.Join(incomingServiceNames, ",")) pip.Tags[consts.ServiceTagKey] = serviceTagValue return false, nil @@ -3583,7 +3680,7 @@ func bindServicesToPIP(pip *network.PublicIPAddress, incomingServiceNames []stri for _, serviceName := range incomingServiceNames { if serviceTagValue == nil || *serviceTagValue == "" { - serviceTagValue = to.StringPtr(serviceName) + serviceTagValue = pointer.String(serviceName) addedNew = true } else { // detect duplicates @@ -3614,7 +3711,7 @@ func unbindServiceFromPIP(pip *network.PublicIPAddress, service *v1.Service, } // skip removing tags for user assigned pips - serviceTagValue := to.StringPtr(getServiceFromPIPServiceTags(pip.Tags)) + serviceTagValue := pointer.String(getServiceFromPIPServiceTags(pip.Tags)) existingServiceNames := parsePIPServiceTag(serviceTagValue) var found bool for i := len(existingServiceNames) - 1; i >= 0; i-- { @@ -3663,3 +3760,12 @@ func (az *Cloud) ensureSecurityGroupTagged(sg *network.SecurityGroup) bool { return changed } + +// stringSlice returns a string slice value for the passed string slice pointer. It returns a nil +// slice if the pointer is nil. +func stringSlice(s *[]string) []string { + if s != nil { + return *s + } + return nil +} diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_loadbalancer_backendpool.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_loadbalancer_backendpool.go index a94f54eb8b90..052b81bc962e 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_loadbalancer_backendpool.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_loadbalancer_backendpool.go @@ -23,17 +23,18 @@ import ( "fmt" "strings" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" - "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/sets" cloudprovider "k8s.io/cloud-provider" "k8s.io/klog/v2" utilnet "k8s.io/utils/net" + "k8s.io/utils/pointer" "sigs.k8s.io/cloud-provider-azure/pkg/cache" "sigs.k8s.io/cloud-provider-azure/pkg/consts" + "sigs.k8s.io/cloud-provider-azure/pkg/metrics" ) type BackendPool interface { @@ -51,7 +52,7 @@ type BackendPool interface { // ReconcileBackendPools creates the inbound backend pool if it is not existed, and removes nodes that are supposed to be // excluded from the load balancers. - ReconcileBackendPools(clusterName string, service *v1.Service, lb *network.LoadBalancer) (bool, bool, error) + ReconcileBackendPools(clusterName string, service *v1.Service, lb *network.LoadBalancer) (bool, bool, bool, error) // GetBackendPrivateIPs returns the private IPs of LoadBalancer's backend pool GetBackendPrivateIPs(clusterName string, service *v1.Service, lb *network.LoadBalancer) ([]string, []string) @@ -69,10 +70,30 @@ func (bc *backendPoolTypeNodeIPConfig) EnsureHostsInPool(service *v1.Service, no return bc.VMSet.EnsureHostsInPool(service, nodes, backendPoolID, vmSetName) } +func isLBBackendPoolsExisting(lbBackendPoolNames map[bool]string, bpName *string) (found, isIPv6 bool) { + if strings.EqualFold(pointer.StringDeref(bpName, ""), lbBackendPoolNames[false]) { + isIPv6 = false + found = true + } + if strings.EqualFold(pointer.StringDeref(bpName, ""), lbBackendPoolNames[true]) { + isIPv6 = true + found = true + } + return found, isIPv6 +} + func (bc *backendPoolTypeNodeIPConfig) CleanupVMSetFromBackendPoolByCondition(slb *network.LoadBalancer, service *v1.Service, nodes []*v1.Node, clusterName string, shouldRemoveVMSetFromSLB func(string) bool) (*network.LoadBalancer, error) { - lbBackendPoolName := getBackendPoolName(clusterName, service) + v4Enabled, v6Enabled := getIPFamiliesEnabled(service) + + lbBackendPoolNames := map[bool]string{ + false: getBackendPoolName(clusterName, false), + true: getBackendPoolName(clusterName, true), + } lbResourceGroup := bc.getLoadBalancerResourceGroup() - lbBackendPoolID := bc.getBackendPoolID(to.String(slb.Name), lbResourceGroup, lbBackendPoolName) + lbBackendPoolIDs := map[bool]string{ + false: bc.getBackendPoolID(pointer.StringDeref(slb.Name, ""), lbResourceGroup, lbBackendPoolNames[false]), + true: bc.getBackendPoolID(pointer.StringDeref(slb.Name, ""), lbResourceGroup, lbBackendPoolNames[true]), + } newBackendPools := make([]network.BackendAddressPool, 0) if slb.LoadBalancerPropertiesFormat != nil && slb.BackendAddressPools != nil { newBackendPools = *slb.BackendAddressPools @@ -80,12 +101,12 @@ func (bc *backendPoolTypeNodeIPConfig) CleanupVMSetFromBackendPoolByCondition(sl vmSetNameToBackendIPConfigurationsToBeDeleted := make(map[string][]network.InterfaceIPConfiguration) for j, bp := range newBackendPools { - if strings.EqualFold(to.String(bp.Name), lbBackendPoolName) { - klog.V(2).Infof("bc.CleanupVMSetFromBackendPoolByCondition: checking the backend pool %s from standard load balancer %s", to.String(bp.Name), to.String(slb.Name)) + if found, _ := isLBBackendPoolsExisting(lbBackendPoolNames, bp.Name); found { + klog.V(2).Infof("bc.CleanupVMSetFromBackendPoolByCondition: checking the backend pool %s from standard load balancer %s", pointer.StringDeref(bp.Name, ""), pointer.StringDeref(slb.Name, "")) if bp.BackendAddressPoolPropertiesFormat != nil && bp.BackendIPConfigurations != nil { for i := len(*bp.BackendIPConfigurations) - 1; i >= 0; i-- { ipConf := (*bp.BackendIPConfigurations)[i] - ipConfigID := to.String(ipConf.ID) + ipConfigID := pointer.StringDeref(ipConf.ID, "") _, vmSetName, err := bc.VMSet.GetNodeNameByIPConfigurationID(ipConfigID) if err != nil && !errors.Is(err, cloudprovider.InstanceNotFound) { return nil, err @@ -95,7 +116,7 @@ func (bc *backendPoolTypeNodeIPConfig) CleanupVMSetFromBackendPoolByCondition(sl klog.V(2).Infof("bc.CleanupVMSetFromBackendPoolByCondition: found unwanted vmSet %s, decouple it from the LB", vmSetName) // construct a backendPool that only contains the IP config of the node to be deleted interfaceIPConfigToBeDeleted := network.InterfaceIPConfiguration{ - ID: to.StringPtr(ipConfigID), + ID: pointer.String(ipConfigID), } vmSetNameToBackendIPConfigurationsToBeDeleted[vmSetName] = append(vmSetNameToBackendIPConfigurationsToBeDeleted[vmSetName], interfaceIPConfigToBeDeleted) *bp.BackendIPConfigurations = append((*bp.BackendIPConfigurations)[:i], (*bp.BackendIPConfigurations)[i+1:]...) @@ -104,29 +125,38 @@ func (bc *backendPoolTypeNodeIPConfig) CleanupVMSetFromBackendPoolByCondition(sl } newBackendPools[j] = bp - break } } for vmSetName := range vmSetNameToBackendIPConfigurationsToBeDeleted { + shouldRefreshLB := false backendIPConfigurationsToBeDeleted := vmSetNameToBackendIPConfigurationsToBeDeleted[vmSetName] - backendpoolToBeDeleted := &[]network.BackendAddressPool{ - { - ID: to.StringPtr(lbBackendPoolID), + backendpoolToBeDeleted := []network.BackendAddressPool{} + lbBackendPoolIDsSlice := []string{} + findBackendpoolToBeDeleted := func(isIPv6 bool) { + lbBackendPoolIDsSlice = append(lbBackendPoolIDsSlice, lbBackendPoolIDs[isIPv6]) + backendpoolToBeDeleted = append(backendpoolToBeDeleted, network.BackendAddressPool{ + ID: pointer.String(lbBackendPoolIDs[isIPv6]), BackendAddressPoolPropertiesFormat: &network.BackendAddressPoolPropertiesFormat{ BackendIPConfigurations: &backendIPConfigurationsToBeDeleted, }, - }, + }) + } + if v4Enabled { + findBackendpoolToBeDeleted(false) + } + if v6Enabled { + findBackendpoolToBeDeleted(true) } // decouple the backendPool from the node - shouldRefreshLB, err := bc.VMSet.EnsureBackendPoolDeleted(service, lbBackendPoolID, vmSetName, backendpoolToBeDeleted, true) + shouldRefreshLB, err := bc.VMSet.EnsureBackendPoolDeleted(service, lbBackendPoolIDsSlice, vmSetName, &backendpoolToBeDeleted, true) if err != nil { return nil, err } if shouldRefreshLB { - slb, _, err = bc.getAzureLoadBalancer(to.String(slb.Name), cache.CacheReadTypeForceRefresh) + slb, _, err := bc.getAzureLoadBalancer(pointer.StringDeref(slb.Name, ""), cache.CacheReadTypeForceRefresh) if err != nil { - return nil, fmt.Errorf("bc.CleanupVMSetFromBackendPoolByCondition: failed to get load balancer %s, err: %w", to.String(slb.Name), err) + return nil, fmt.Errorf("bc.CleanupVMSetFromBackendPoolByCondition: failed to get load balancer %s, err: %w", pointer.StringDeref(slb.Name, ""), err) } } } @@ -134,29 +164,39 @@ func (bc *backendPoolTypeNodeIPConfig) CleanupVMSetFromBackendPoolByCondition(sl return slb, nil } -func (bc *backendPoolTypeNodeIPConfig) ReconcileBackendPools(clusterName string, service *v1.Service, lb *network.LoadBalancer) (bool, bool, error) { +func (bc *backendPoolTypeNodeIPConfig) ReconcileBackendPools(clusterName string, service *v1.Service, lb *network.LoadBalancer) (bool, bool, bool, error) { var newBackendPools []network.BackendAddressPool var err error if lb.BackendAddressPools != nil { newBackendPools = *lb.BackendAddressPools } - foundBackendPool := false - changed := false - shouldRefreshLB := false + var changed, shouldRefreshLB, isOperationSucceeded, isMigration bool + foundBackendPools := map[bool]bool{} lbName := *lb.Name serviceName := getServiceName(service) - lbBackendPoolName := getBackendPoolName(clusterName, service) - lbBackendPoolID := bc.getBackendPoolID(lbName, bc.getLoadBalancerResourceGroup(), lbBackendPoolName) + lbBackendPoolNames := map[bool]string{ + false: getBackendPoolName(clusterName, false), + true: getBackendPoolName(clusterName, true), + } + lbBackendPoolIDs := map[bool]string{ + false: bc.getBackendPoolID(lbName, bc.getLoadBalancerResourceGroup(), lbBackendPoolNames[false]), + true: bc.getBackendPoolID(lbName, bc.getLoadBalancerResourceGroup(), lbBackendPoolNames[true]), + } vmSetName := bc.mapLoadBalancerNameToVMSet(lbName, clusterName) isBackendPoolPreConfigured := bc.isBackendPoolPreConfigured(service) + mc := metrics.NewMetricContext("services", "migrate_to_nic_based_backend_pool", bc.ResourceGroup, bc.getNetworkResourceSubscriptionID(), serviceName) + + backendpoolToBeDeleted := []network.BackendAddressPool{} + lbBackendPoolIDsSlice := []string{} for i := len(newBackendPools) - 1; i >= 0; i-- { bp := newBackendPools[i] - if strings.EqualFold(*bp.Name, lbBackendPoolName) { + found, isIPv6 := isLBBackendPoolsExisting(lbBackendPoolNames, bp.Name) + if found { klog.V(10).Infof("bc.ReconcileBackendPools for service (%s): lb backendpool - found wanted backendpool. not adding anything", serviceName) - foundBackendPool = true + foundBackendPools[isBackendPoolIPv6(pointer.StringDeref(bp.Name, ""))] = true // Don't bother to remove unused nodeIPConfiguration if backend pool is pre configured if isBackendPoolPreConfigured { @@ -170,9 +210,11 @@ func (bc *backendPoolTypeNodeIPConfig) ReconcileBackendPools(clusterName string, bp.LoadBalancerBackendAddresses != nil && len(*bp.LoadBalancerBackendAddresses) > 0 { if removeNodeIPAddressesFromBackendPool(bp, []string{}, true) { + isMigration = true + bp.VirtualNetwork = nil if err := bc.CreateOrUpdateLBBackendPool(lbName, bp); err != nil { - klog.Errorf("bc.ReconcileBackendPools for service (%s): failed to cleanup IP based backend pool %s: %s", serviceName, lbBackendPoolName, err.Error()) - return false, false, fmt.Errorf("bc.ReconcileBackendPools for service (%s): failed to cleanup IP based backend pool %s: %w", serviceName, lbBackendPoolName, err) + klog.Errorf("bc.ReconcileBackendPools for service (%s): failed to cleanup IP based backend pool %s: %s", serviceName, lbBackendPoolNames[isIPv6], err.Error()) + return false, false, false, fmt.Errorf("bc.ReconcileBackendPools for service (%s): failed to cleanup IP based backend pool %s: %w", serviceName, lbBackendPoolNames[isIPv6], err) } newBackendPools[i] = bp lb.BackendAddressPools = &newBackendPools @@ -180,17 +222,17 @@ func (bc *backendPoolTypeNodeIPConfig) ReconcileBackendPools(clusterName string, } } - var backendIPConfigurationsToBeDeleted []network.InterfaceIPConfiguration + var backendIPConfigurationsToBeDeleted, bipConfigNotFound, bipConfigExclude []network.InterfaceIPConfiguration if bp.BackendAddressPoolPropertiesFormat != nil && bp.BackendIPConfigurations != nil { for _, ipConf := range *bp.BackendIPConfigurations { - ipConfID := to.String(ipConf.ID) + ipConfID := pointer.StringDeref(ipConf.ID, "") nodeName, _, err := bc.VMSet.GetNodeNameByIPConfigurationID(ipConfID) if err != nil { if errors.Is(err, cloudprovider.InstanceNotFound) { klog.V(2).Infof("bc.ReconcileBackendPools for service (%s): vm not found for ipConfID %s", serviceName, ipConfID) - backendIPConfigurationsToBeDeleted = append(backendIPConfigurationsToBeDeleted, ipConf) + bipConfigNotFound = append(bipConfigNotFound, ipConf) } else { - return false, false, err + return false, false, false, err } } @@ -201,68 +243,127 @@ func (bc *backendPoolTypeNodeIPConfig) ReconcileBackendPools(clusterName string, shouldExcludeLoadBalancer, err := bc.ShouldNodeExcludedFromLoadBalancer(nodeName) if err != nil { klog.Errorf("bc.ReconcileBackendPools: ShouldNodeExcludedFromLoadBalancer(%s) failed with error: %v", nodeName, err) - return false, false, err + return false, false, false, err } if shouldExcludeLoadBalancer { klog.V(2).Infof("bc.ReconcileBackendPools for service (%s): lb backendpool - found unwanted node %s, decouple it from the LB %s", serviceName, nodeName, lbName) // construct a backendPool that only contains the IP config of the node to be deleted - backendIPConfigurationsToBeDeleted = append(backendIPConfigurationsToBeDeleted, network.InterfaceIPConfiguration{ID: to.StringPtr(ipConfID)}) + bipConfigExclude = append(bipConfigExclude, network.InterfaceIPConfiguration{ID: pointer.String(ipConfID)}) } } } + backendIPConfigurationsToBeDeleted = getBackendIPConfigurationsToBeDeleted(bp, bipConfigNotFound, bipConfigExclude) if len(backendIPConfigurationsToBeDeleted) > 0 { - backendpoolToBeDeleted := &[]network.BackendAddressPool{ - { - ID: to.StringPtr(lbBackendPoolID), - BackendAddressPoolPropertiesFormat: &network.BackendAddressPoolPropertiesFormat{ - BackendIPConfigurations: &backendIPConfigurationsToBeDeleted, - }, + backendpoolToBeDeleted = append(backendpoolToBeDeleted, network.BackendAddressPool{ + ID: pointer.String(lbBackendPoolIDs[isIPv6]), + BackendAddressPoolPropertiesFormat: &network.BackendAddressPoolPropertiesFormat{ + BackendIPConfigurations: &backendIPConfigurationsToBeDeleted, }, - } - // decouple the backendPool from the node - updated, err := bc.VMSet.EnsureBackendPoolDeleted(service, lbBackendPoolID, vmSetName, backendpoolToBeDeleted, false) - if err != nil { - return false, false, err - } - if updated { - shouldRefreshLB = true - } + }) + lbBackendPoolIDsSlice = append(lbBackendPoolIDsSlice, lbBackendPoolIDs[isIPv6]) + } - break } else { - klog.V(10).Infof("bc.ReconcileBackendPools for service (%s): lb backendpool - found unmanaged backendpool %s", serviceName, *bp.Name) + klog.V(10).Infof("bc.ReconcileBackendPools for service (%s): lb backendpool - found unmanaged backendpool %s", serviceName, pointer.StringDeref(bp.Name, "")) + } + } + if len(backendpoolToBeDeleted) > 0 { + // decouple the backendPool from the node + updated, err := bc.VMSet.EnsureBackendPoolDeleted(service, lbBackendPoolIDsSlice, vmSetName, &backendpoolToBeDeleted, false) + if err != nil { + return false, false, false, err + } + if updated { + shouldRefreshLB = true } } if shouldRefreshLB { lb, _, err = bc.getAzureLoadBalancer(lbName, cache.CacheReadTypeForceRefresh) if err != nil { - return false, false, fmt.Errorf("bc.ReconcileBackendPools for service (%s): failed to get loadbalancer %s: %w", serviceName, lbName, err) + return false, false, false, fmt.Errorf("bc.ReconcileBackendPools for service (%s): failed to get loadbalancer %s: %w", serviceName, lbName, err) } } - if !foundBackendPool { - isBackendPoolPreConfigured = newBackendPool(lb, isBackendPoolPreConfigured, bc.PreConfiguredBackendPoolLoadBalancerTypes, getServiceName(service), getBackendPoolName(clusterName, service)) + for _, ipFamily := range service.Spec.IPFamilies { + if foundBackendPools[ipFamily == v1.IPv6Protocol] { + continue + } + isBackendPoolPreConfigured = newBackendPool(lb, isBackendPoolPreConfigured, + bc.PreConfiguredBackendPoolLoadBalancerTypes, serviceName, + lbBackendPoolNames[ipFamily == v1.IPv6Protocol]) changed = true } - return isBackendPoolPreConfigured, changed, err + if isMigration { + defer func() { + mc.ObserveOperationWithResult(isOperationSucceeded) + }() + } + + isOperationSucceeded = true + return isBackendPoolPreConfigured, changed, false, err +} + +func getBackendIPConfigurationsToBeDeleted( + bp network.BackendAddressPool, + bipConfigNotFound, bipConfigExclude []network.InterfaceIPConfiguration, +) []network.InterfaceIPConfiguration { + if bp.BackendAddressPoolPropertiesFormat == nil || bp.BackendIPConfigurations == nil { + return []network.InterfaceIPConfiguration{} + } + + bipConfigNotFoundIDSet := sets.New[string]() + bipConfigExcludeIDSet := sets.New[string]() + for _, ipConfig := range bipConfigNotFound { + bipConfigNotFoundIDSet.Insert(pointer.StringDeref(ipConfig.ID, "")) + } + for _, ipConfig := range bipConfigExclude { + bipConfigExcludeIDSet.Insert(pointer.StringDeref(ipConfig.ID, "")) + } + + var bipConfigToBeDeleted []network.InterfaceIPConfiguration + ipConfigs := *bp.BackendIPConfigurations + for i := len(ipConfigs) - 1; i >= 0; i-- { + ipConfigID := pointer.StringDeref(ipConfigs[i].ID, "") + if bipConfigNotFoundIDSet.Has(ipConfigID) { + bipConfigToBeDeleted = append(bipConfigToBeDeleted, ipConfigs[i]) + ipConfigs = append(ipConfigs[:i], ipConfigs[i+1:]...) + } + } + + var unwantedIPConfigs []network.InterfaceIPConfiguration + for _, ipConfig := range ipConfigs { + ipConfigID := pointer.StringDeref(ipConfig.ID, "") + if bipConfigExcludeIDSet.Has(ipConfigID) { + unwantedIPConfigs = append(unwantedIPConfigs, ipConfig) + } + } + if len(unwantedIPConfigs) == len(ipConfigs) { + klog.V(2).Info("getBackendIPConfigurationsToBeDeleted: the pool is empty or will be empty after removing the unwanted IP addresses, skipping the removal") + return bipConfigToBeDeleted + } + return append(bipConfigToBeDeleted, unwantedIPConfigs...) } func (bc *backendPoolTypeNodeIPConfig) GetBackendPrivateIPs(clusterName string, service *v1.Service, lb *network.LoadBalancer) ([]string, []string) { serviceName := getServiceName(service) - lbBackendPoolName := getBackendPoolName(clusterName, service) + lbBackendPoolNames := map[bool]string{ + false: getBackendPoolName(clusterName, false), + true: getBackendPoolName(clusterName, true), + } if lb.LoadBalancerPropertiesFormat == nil || lb.LoadBalancerPropertiesFormat.BackendAddressPools == nil { return nil, nil } - backendPrivateIPv4s, backendPrivateIPv6s := sets.NewString(), sets.NewString() + backendPrivateIPv4s, backendPrivateIPv6s := sets.New[string](), sets.New[string]() for _, bp := range *lb.BackendAddressPools { - if strings.EqualFold(to.String(bp.Name), lbBackendPoolName) { - klog.V(10).Infof("bc.GetBackendPrivateIPs for service (%s): found wanted backendpool %s", serviceName, to.String(bp.Name)) + found, _ := isLBBackendPoolsExisting(lbBackendPoolNames, bp.Name) + if found { + klog.V(10).Infof("bc.GetBackendPrivateIPs for service (%s): found wanted backendpool %s", serviceName, pointer.StringDeref(bp.Name, "")) if bp.BackendAddressPoolPropertiesFormat != nil && bp.BackendIPConfigurations != nil { for _, backendIPConfig := range *bp.BackendIPConfigurations { - ipConfigID := to.String(backendIPConfig.ID) + ipConfigID := pointer.StringDeref(backendIPConfig.ID, "") nodeName, _, err := bc.VMSet.GetNodeNameByIPConfigurationID(ipConfigID) if err != nil { klog.Errorf("bc.GetBackendPrivateIPs for service (%s): GetNodeNameByIPConfigurationID failed with error: %v", serviceName, err) @@ -273,7 +374,7 @@ func (bc *backendPoolTypeNodeIPConfig) GetBackendPrivateIPs(clusterName string, klog.Warningf("bc.GetBackendPrivateIPs for service (%s): failed to get private IPs of node %s", serviceName, nodeName) continue } - privateIPs := privateIPsSet.List() + privateIPs := privateIPsSet.UnsortedList() for _, ip := range privateIPs { klog.V(2).Infof("bc.GetBackendPrivateIPs for service (%s): lb backendpool - found private IPs %s of node %s", serviceName, ip, nodeName) if utilnet.IsIPv4String(ip) { @@ -285,10 +386,10 @@ func (bc *backendPoolTypeNodeIPConfig) GetBackendPrivateIPs(clusterName string, } } } else { - klog.V(10).Infof("bc.GetBackendPrivateIPs for service (%s): found unmanaged backendpool %s", serviceName, to.String(bp.Name)) + klog.V(10).Infof("bc.GetBackendPrivateIPs for service (%s): found unmanaged backendpool %s", serviceName, pointer.StringDeref(bp.Name, "")) } } - return backendPrivateIPv4s.List(), backendPrivateIPv6s.List() + return backendPrivateIPv4s.UnsortedList(), backendPrivateIPv6s.UnsortedList() } type backendPoolTypeNodeIP struct { @@ -300,6 +401,7 @@ func newBackendPoolTypeNodeIP(c *Cloud) BackendPool { } func (bi *backendPoolTypeNodeIP) EnsureHostsInPool(service *v1.Service, nodes []*v1.Node, backendPoolID, vmSetName, clusterName, lbName string, backendPool network.BackendAddressPool) error { + isIPv6 := isBackendPoolIPv6(pointer.StringDeref(backendPool.Name, "")) vnetResourceGroup := bi.ResourceGroup if len(bi.VnetResourceGroup) > 0 { vnetResourceGroup = bi.VnetResourceGroup @@ -308,20 +410,24 @@ func (bi *backendPoolTypeNodeIP) EnsureHostsInPool(service *v1.Service, nodes [] changed := false numOfAdd := 0 - lbBackendPoolName := getBackendPoolName(clusterName, service) - if strings.EqualFold(to.String(backendPool.Name), lbBackendPoolName) && + lbBackendPoolName := getBackendPoolName(clusterName, isIPv6) + if strings.EqualFold(pointer.StringDeref(backendPool.Name, ""), lbBackendPoolName) && backendPool.BackendAddressPoolPropertiesFormat != nil { + backendPool.VirtualNetwork = &network.SubResource{ + ID: &vnetID, + } + if backendPool.LoadBalancerBackendAddresses == nil { lbBackendPoolAddresses := make([]network.LoadBalancerBackendAddress, 0) backendPool.LoadBalancerBackendAddresses = &lbBackendPoolAddresses } - existingIPs := sets.NewString() + existingIPs := sets.New[string]() for _, loadBalancerBackendAddress := range *backendPool.LoadBalancerBackendAddresses { if loadBalancerBackendAddress.LoadBalancerBackendAddressPropertiesFormat != nil && loadBalancerBackendAddress.IPAddress != nil { - klog.V(4).Infof("bi.EnsureHostsInPool: found existing IP %s in the backend pool %s", to.String(loadBalancerBackendAddress.IPAddress), lbBackendPoolName) - existingIPs.Insert(to.String(loadBalancerBackendAddress.IPAddress)) + klog.V(4).Infof("bi.EnsureHostsInPool: found existing IP %s in the backend pool %s", pointer.StringDeref(loadBalancerBackendAddress.IPAddress, ""), lbBackendPoolName) + existingIPs.Insert(pointer.StringDeref(loadBalancerBackendAddress.IPAddress, "")) } } @@ -358,19 +464,18 @@ func (bi *backendPoolTypeNodeIP) EnsureHostsInPool(service *v1.Service, nodes [] continue } - privateIP := getNodePrivateIPAddress(service, node) + privateIP := getNodePrivateIPAddress(node, isIPv6) if !existingIPs.Has(privateIP) { name := node.Name if utilnet.IsIPv6String(privateIP) { - name = fmt.Sprintf("%s-ipv6", name) + name = fmt.Sprintf("%s-%s", name, v6Suffix) } klog.V(6).Infof("bi.EnsureHostsInPool: adding %s with ip address %s", name, privateIP) *backendPool.LoadBalancerBackendAddresses = append(*backendPool.LoadBalancerBackendAddresses, network.LoadBalancerBackendAddress{ - Name: to.StringPtr(name), + Name: pointer.String(name), LoadBalancerBackendAddressPropertiesFormat: &network.LoadBalancerBackendAddressPropertiesFormat{ - IPAddress: to.StringPtr(privateIP), - VirtualNetwork: &network.SubResource{ID: to.StringPtr(vnetID)}, + IPAddress: pointer.String(privateIP), }, }) numOfAdd++ @@ -389,17 +494,21 @@ func (bi *backendPoolTypeNodeIP) EnsureHostsInPool(service *v1.Service, nodes [] } func (bi *backendPoolTypeNodeIP) CleanupVMSetFromBackendPoolByCondition(slb *network.LoadBalancer, service *v1.Service, nodes []*v1.Node, clusterName string, shouldRemoveVMSetFromSLB func(string) bool) (*network.LoadBalancer, error) { - lbBackendPoolName := getBackendPoolName(clusterName, service) + lbBackendPoolNames := map[bool]string{ + false: getBackendPoolName(clusterName, false), + true: getBackendPoolName(clusterName, true), + } newBackendPools := make([]network.BackendAddressPool, 0) if slb.LoadBalancerPropertiesFormat != nil && slb.BackendAddressPools != nil { newBackendPools = *slb.BackendAddressPools } - var updatedPrivateIPs bool + updatedPrivateIPs := map[bool]bool{} for j, bp := range newBackendPools { - if strings.EqualFold(to.String(bp.Name), lbBackendPoolName) { - klog.V(2).Infof("bi.CleanupVMSetFromBackendPoolByCondition: checking the backend pool %s from standard load balancer %s", to.String(bp.Name), to.String(slb.Name)) - vmIPsToBeDeleted := sets.NewString() + found, isIPv6 := isLBBackendPoolsExisting(lbBackendPoolNames, bp.Name) + if found { + klog.V(2).Infof("bi.CleanupVMSetFromBackendPoolByCondition: checking the backend pool %s from standard load balancer %s", pointer.StringDeref(bp.Name, ""), pointer.StringDeref(slb.Name, "")) + vmIPsToBeDeleted := sets.New[string]() for _, node := range nodes { vmSetName, err := bi.VMSet.GetNodeVMSetName(node) if err != nil { @@ -407,8 +516,8 @@ func (bi *backendPoolTypeNodeIP) CleanupVMSetFromBackendPoolByCondition(slb *net } if shouldRemoveVMSetFromSLB(vmSetName) { - privateIP := getNodePrivateIPAddress(service, node) - klog.V(4).Infof("bi.CleanupVMSetFromBackendPoolByCondition: removing ip %s from the backend pool %s", privateIP, lbBackendPoolName) + privateIP := getNodePrivateIPAddress(node, isIPv6) + klog.V(4).Infof("bi.CleanupVMSetFromBackendPoolByCondition: removing ip %s from the backend pool %s", privateIP, lbBackendPoolNames[isIPv6]) vmIPsToBeDeleted.Insert(privateIP) } } @@ -416,25 +525,28 @@ func (bi *backendPoolTypeNodeIP) CleanupVMSetFromBackendPoolByCondition(slb *net if bp.BackendAddressPoolPropertiesFormat != nil && bp.LoadBalancerBackendAddresses != nil { for i := len(*bp.LoadBalancerBackendAddresses) - 1; i >= 0; i-- { if (*bp.LoadBalancerBackendAddresses)[i].LoadBalancerBackendAddressPropertiesFormat != nil && - vmIPsToBeDeleted.Has(to.String((*bp.LoadBalancerBackendAddresses)[i].IPAddress)) { + vmIPsToBeDeleted.Has(pointer.StringDeref((*bp.LoadBalancerBackendAddresses)[i].IPAddress, "")) { *bp.LoadBalancerBackendAddresses = append((*bp.LoadBalancerBackendAddresses)[:i], (*bp.LoadBalancerBackendAddresses)[i+1:]...) - updatedPrivateIPs = true + updatedPrivateIPs[isIPv6] = true } } } newBackendPools[j] = bp - break + } else { + klog.V(10).Infof("bi.CleanupVMSetFromBackendPoolByCondition: found unmanaged backendpool %s from standard load balancer %q", pointer.StringDeref(bp.Name, ""), pointer.StringDeref(slb.Name, "")) } + } - if updatedPrivateIPs { - klog.V(2).Infof("bi.CleanupVMSetFromBackendPoolByCondition: updating lb %s since there are private IP updates", to.String(slb.Name)) + for isIPv6 := range updatedPrivateIPs { + klog.V(2).Infof("bi.CleanupVMSetFromBackendPoolByCondition: updating lb %s since there are private IP updates", pointer.StringDeref(slb.Name, "")) slb.BackendAddressPools = &newBackendPools for _, backendAddressPool := range *slb.BackendAddressPools { - if strings.EqualFold(lbBackendPoolName, to.String(backendAddressPool.Name)) { - if err := bi.CreateOrUpdateLBBackendPool(to.String(slb.Name), backendAddressPool); err != nil { - return nil, fmt.Errorf("bi.CleanupVMSetFromBackendPoolByCondition: failed to create or update backend pool %s: %w", lbBackendPoolName, err) + if strings.EqualFold(lbBackendPoolNames[isIPv6], pointer.StringDeref(backendAddressPool.Name, "")) { + if err := bi.CreateOrUpdateLBBackendPool(pointer.StringDeref(slb.Name, ""), backendAddressPool); err != nil { + return nil, fmt.Errorf("bi.CleanupVMSetFromBackendPoolByCondition: "+ + "failed to create or update backend pool %s: %w", lbBackendPoolNames[isIPv6], err) } } } @@ -443,44 +555,107 @@ func (bi *backendPoolTypeNodeIP) CleanupVMSetFromBackendPoolByCondition(slb *net return slb, nil } -func (bi *backendPoolTypeNodeIP) ReconcileBackendPools(clusterName string, service *v1.Service, lb *network.LoadBalancer) (bool, bool, error) { +func (bi *backendPoolTypeNodeIP) ReconcileBackendPools(clusterName string, service *v1.Service, lb *network.LoadBalancer) (bool, bool, bool, error) { var newBackendPools []network.BackendAddressPool if lb.BackendAddressPools != nil { newBackendPools = *lb.BackendAddressPools } - foundBackendPool := false - changed := false - shouldRefreshLB := false + var changed, shouldRefreshLB, isOperationSucceeded, isMigration, updated bool + foundBackendPools := map[bool]bool{} lbName := *lb.Name serviceName := getServiceName(service) - lbBackendPoolName := getBackendPoolName(clusterName, service) + lbBackendPoolNames := map[bool]string{ + false: getBackendPoolName(clusterName, false), + true: getBackendPoolName(clusterName, true), + } vmSetName := bi.mapLoadBalancerNameToVMSet(lbName, clusterName) - lbBackendPoolID := bi.getBackendPoolID(to.String(lb.Name), bi.getLoadBalancerResourceGroup(), getBackendPoolName(clusterName, service)) + lbBackendPoolIDs := map[bool]string{ + false: bi.getBackendPoolID(pointer.StringDeref(lb.Name, ""), bi.getLoadBalancerResourceGroup(), lbBackendPoolNames[false]), + true: bi.getBackendPoolID(pointer.StringDeref(lb.Name, ""), bi.getLoadBalancerResourceGroup(), lbBackendPoolNames[true]), + } isBackendPoolPreConfigured := bi.isBackendPoolPreConfigured(service) - var err error + mc := metrics.NewMetricContext("services", "migrate_to_ip_based_backend_pool", bi.ResourceGroup, bi.getNetworkResourceSubscriptionID(), serviceName) + + var ( + err error + bpIdxes []int + lbBackendPoolIDsSlice []string + ) + nicsCountMap := make(map[string]int) for i := len(newBackendPools) - 1; i >= 0; i-- { bp := newBackendPools[i] - if strings.EqualFold(*bp.Name, lbBackendPoolName) { - klog.V(10).Infof("bi.ReconcileBackendPools for service (%s): found wanted backendpool. not adding anything", serviceName) - foundBackendPool = true + found, isIPv6 := isLBBackendPoolsExisting(lbBackendPoolNames, bp.Name) + if found { + bpIdxes = append(bpIdxes, i) + klog.V(10).Infof("bi.ReconcileBackendPools for service (%s): found wanted backendpool. Not adding anything", serviceName) + foundBackendPools[isIPv6] = true + lbBackendPoolIDsSlice = append(lbBackendPoolIDsSlice, lbBackendPoolIDs[isIPv6]) + + if nicsCount := countNICsOnBackendPool(bp); nicsCount > 0 { + nicsCountMap[pointer.StringDeref(bp.Name, "")] = nicsCount + klog.V(4).Infof( + "bi.ReconcileBackendPools for service(%s): found NIC-based backendpool %s with %d NICs, will migrate to IP-based", + serviceName, + pointer.StringDeref(bp.Name, ""), + nicsCount, + ) + isMigration = true + } + } else { + klog.V(10).Infof("bi.ReconcileBackendPools for service (%s): found unmanaged backendpool %s", serviceName, *bp.Name) + } + } - // Don't bother to remove unused nodeIP if backend pool is pre configured - if isBackendPoolPreConfigured { - break + // Don't bother to remove unused nodeIP if backend pool is pre configured + if !isBackendPoolPreConfigured { + // If the LB backend pool type is configured from nodeIPConfiguration + // to nodeIP, we need to decouple the VM NICs from the LB + // before attaching nodeIPs/podIPs to the LB backend pool. + // If the migration API is enabled, we use the migration API to decouple + // the VM NICs from the LB. Then we manually decouple the VMSS + // and its VMs from the LB by EnsureBackendPoolDeleted. These manual operations + // cannot be omitted because we use the VMSS manual upgrade policy. + // If the migration API is not enabled, we manually decouple the VM NICs and + // the VMSS from the LB by EnsureBackendPoolDeleted. If no NIC-based backend + // pool is found (it is not a migration scenario), EnsureBackendPoolDeleted would be a no-op. + if isMigration && bi.EnableMigrateToIPBasedBackendPoolAPI { + var backendPoolNames []string + for _, id := range lbBackendPoolIDsSlice { + name, err := getLBNameFromBackendPoolID(id) + if err != nil { + klog.Errorf("bi.ReconcileBackendPools for service (%s): failed to get LB name from backend pool ID: %s", serviceName, err.Error()) + return false, false, false, err + } + backendPoolNames = append(backendPoolNames, name) } - // If the LB backend pool type is configured from nodeIPConfiguration - // to nodeIP, we need to decouple the VM NICs from the LB - // before attaching nodeIPs/podIPs to the LB backend pool. - klog.V(2).Infof("bi.ReconcileBackendPools for service (%s) and vmSet (%s): ensuring the LB is decoupled from the VMSet", serviceName, vmSetName) - shouldRefreshLB, err = bi.VMSet.EnsureBackendPoolDeleted(service, lbBackendPoolID, vmSetName, lb.BackendAddressPools, true) - if err != nil { - klog.Errorf("bi.ReconcileBackendPools for service (%s): failed to EnsureBackendPoolDeleted: %s", serviceName, err.Error()) - return false, false, err + if err := bi.MigrateToIPBasedBackendPoolAndWaitForCompletion(lbName, backendPoolNames, nicsCountMap); err != nil { + backendPoolNamesStr := strings.Join(backendPoolNames, ",") + klog.Errorf("Failed to migrate to IP based backend pool for lb %s, backend pool %s: %s", lbName, backendPoolNamesStr, err.Error()) + return false, false, false, err } + } + + // EnsureBackendPoolDeleted is useful in the following scenarios: + // 1. Migrate from NIC-based to IP-based backend pool if the migration + // API is not enabled. + // 2. Migrate from NIC-based to IP-based backend pool when the migration + // API is enabled. This is needed because since we use the manual upgrade + // policy on VMSS so the migration API will not change the VMSS and VMSS + // VMs during the migration. + // 3. Decouple vmss from the lb if the backend pool is empty when using + // ip-based LB. Ref: https://github.com/kubernetes-sigs/cloud-provider-azure/pull/2829. + klog.V(2).Infof("bi.ReconcileBackendPools for service (%s) and vmSet (%s): ensuring the LB is decoupled from the VMSet", serviceName, vmSetName) + shouldRefreshLB, err = bi.VMSet.EnsureBackendPoolDeleted(service, lbBackendPoolIDsSlice, vmSetName, lb.BackendAddressPools, true) + if err != nil { + klog.Errorf("bi.ReconcileBackendPools for service (%s): failed to EnsureBackendPoolDeleted: %s", serviceName, err.Error()) + return false, false, false, err + } + for _, i := range bpIdxes { + bp := newBackendPools[i] var nodeIPAddressesToBeDeleted []string for nodeName := range bi.excludeLoadBalancerNodes { for ip := range bi.nodePrivateIPs[nodeName] { @@ -489,47 +664,82 @@ func (bi *backendPoolTypeNodeIP) ReconcileBackendPools(clusterName string, servi } } if len(nodeIPAddressesToBeDeleted) > 0 { - updated := removeNodeIPAddressesFromBackendPool(bp, nodeIPAddressesToBeDeleted, false) - if updated { - (*lb.BackendAddressPools)[i] = bp - if err := bi.CreateOrUpdateLBBackendPool(lbName, bp); err != nil { - return false, false, fmt.Errorf("bi.ReconcileBackendPools for service (%s): lb backendpool - failed to update backend pool %s for load balancer %s: %w", serviceName, lbBackendPoolName, lbName, err) + if removeNodeIPAddressesFromBackendPool(bp, nodeIPAddressesToBeDeleted, false) { + updated = true + } + } + // delete the vnet in LoadBalancerBackendAddresses and ensure it is in the backend pool level + var vnet string + if bp.BackendAddressPoolPropertiesFormat != nil { + if bp.VirtualNetwork == nil || + pointer.StringDeref(bp.VirtualNetwork.ID, "") == "" { + if bp.LoadBalancerBackendAddresses != nil { + for _, a := range *bp.LoadBalancerBackendAddresses { + if a.LoadBalancerBackendAddressPropertiesFormat != nil && + a.VirtualNetwork != nil { + if vnet == "" { + vnet = pointer.StringDeref(a.VirtualNetwork.ID, "") + } + a.VirtualNetwork = nil + } + } + } + if vnet != "" { + bp.VirtualNetwork = &network.SubResource{ + ID: pointer.String(vnet), + } + updated = true } - shouldRefreshLB = true } } - break - } else { - klog.V(10).Infof("bi.ReconcileBackendPools for service (%s): found unmanaged backendpool %s", serviceName, *bp.Name) + + if updated { + (*lb.BackendAddressPools)[i] = bp + if err := bi.CreateOrUpdateLBBackendPool(lbName, bp); err != nil { + return false, false, false, fmt.Errorf("bi.ReconcileBackendPools for service (%s): lb backendpool - failed to update backend pool %s for load balancer %s: %w", serviceName, pointer.StringDeref(bp.Name, ""), lbName, err) + } + shouldRefreshLB = true + } } } - if shouldRefreshLB { - lb, _, err = bi.getAzureLoadBalancer(lbName, cache.CacheReadTypeForceRefresh) - if err != nil { - return false, false, fmt.Errorf("bi.ReconcileBackendPools for service (%s): failed to get load balancer %s: %w", serviceName, lbName, err) + shouldRefreshLB = shouldRefreshLB || isMigration + + for _, ipFamily := range service.Spec.IPFamilies { + if foundBackendPools[ipFamily == v1.IPv6Protocol] { + continue } + isBackendPoolPreConfigured = newBackendPool(lb, isBackendPoolPreConfigured, + bi.PreConfiguredBackendPoolLoadBalancerTypes, serviceName, + lbBackendPoolNames[ipFamily == v1.IPv6Protocol]) + changed = true } - if !foundBackendPool { - isBackendPoolPreConfigured = newBackendPool(lb, isBackendPoolPreConfigured, bi.PreConfiguredBackendPoolLoadBalancerTypes, getServiceName(service), getBackendPoolName(clusterName, service)) - changed = true + if isMigration { + defer func() { + mc.ObserveOperationWithResult(isOperationSucceeded) + }() } - return isBackendPoolPreConfigured, changed, nil + isOperationSucceeded = true + return isBackendPoolPreConfigured, changed, shouldRefreshLB, nil } func (bi *backendPoolTypeNodeIP) GetBackendPrivateIPs(clusterName string, service *v1.Service, lb *network.LoadBalancer) ([]string, []string) { serviceName := getServiceName(service) - lbBackendPoolName := getBackendPoolName(clusterName, service) + lbBackendPoolNames := map[bool]string{ + false: getBackendPoolName(clusterName, false), + true: getBackendPoolName(clusterName, true), + } if lb.LoadBalancerPropertiesFormat == nil || lb.LoadBalancerPropertiesFormat.BackendAddressPools == nil { return nil, nil } - backendPrivateIPv4s, backendPrivateIPv6s := sets.NewString(), sets.NewString() + backendPrivateIPv4s, backendPrivateIPv6s := sets.New[string](), sets.New[string]() for _, bp := range *lb.BackendAddressPools { - if strings.EqualFold(to.String(bp.Name), lbBackendPoolName) { - klog.V(10).Infof("bi.GetBackendPrivateIPs for service (%s): found wanted backendpool %s", serviceName, to.String(bp.Name)) + found, _ := isLBBackendPoolsExisting(lbBackendPoolNames, bp.Name) + if found { + klog.V(10).Infof("bi.GetBackendPrivateIPs for service (%s): found wanted backendpool %s", serviceName, pointer.StringDeref(bp.Name, "")) if bp.BackendAddressPoolPropertiesFormat != nil && bp.LoadBalancerBackendAddresses != nil { for _, backendAddress := range *bp.LoadBalancerBackendAddresses { ipAddress := backendAddress.IPAddress @@ -537,7 +747,7 @@ func (bi *backendPoolTypeNodeIP) GetBackendPrivateIPs(clusterName string, servic klog.V(2).Infof("bi.GetBackendPrivateIPs for service (%s): lb backendpool - found private IP %q", serviceName, *ipAddress) if utilnet.IsIPv4String(*ipAddress) { backendPrivateIPv4s.Insert(*ipAddress) - } else { + } else if utilnet.IsIPv6String(*ipAddress) { backendPrivateIPv6s.Insert(*ipAddress) } } else { @@ -546,17 +756,18 @@ func (bi *backendPoolTypeNodeIP) GetBackendPrivateIPs(clusterName string, servic } } } else { - klog.V(10).Infof("bi.GetBackendPrivateIPs for service (%s): found unmanaged backendpool %s", serviceName, to.String(bp.Name)) + klog.V(10).Infof("bi.GetBackendPrivateIPs for service (%s): found unmanaged backendpool %s", serviceName, pointer.StringDeref(bp.Name, "")) } } - return backendPrivateIPv4s.List(), backendPrivateIPv6s.List() + return backendPrivateIPv4s.UnsortedList(), backendPrivateIPv6s.UnsortedList() } func newBackendPool(lb *network.LoadBalancer, isBackendPoolPreConfigured bool, preConfiguredBackendPoolLoadBalancerTypes, serviceName, lbBackendPoolName string) bool { if isBackendPoolPreConfigured { - klog.V(2).Infof("newBackendPool for service (%s)(true): lb backendpool - PreConfiguredBackendPoolLoadBalancerTypes %s has been set but can not find corresponding backend pool, ignoring it", + klog.V(2).Infof("newBackendPool for service (%s)(true): lb backendpool - PreConfiguredBackendPoolLoadBalancerTypes %s has been set but can not find corresponding backend pool %q, ignoring it", serviceName, - preConfiguredBackendPoolLoadBalancerTypes) + preConfiguredBackendPoolLoadBalancerTypes, + lbBackendPoolName) isBackendPoolPreConfigured = false } @@ -564,7 +775,7 @@ func newBackendPool(lb *network.LoadBalancer, isBackendPoolPreConfigured bool, p lb.BackendAddressPools = &[]network.BackendAddressPool{} } *lb.BackendAddressPools = append(*lb.BackendAddressPools, network.BackendAddressPool{ - Name: to.StringPtr(lbBackendPoolName), + Name: pointer.String(lbBackendPoolName), BackendAddressPoolPropertiesFormat: &network.BackendAddressPoolPropertiesFormat{}, }) @@ -573,24 +784,40 @@ func newBackendPool(lb *network.LoadBalancer, isBackendPoolPreConfigured bool, p func removeNodeIPAddressesFromBackendPool(backendPool network.BackendAddressPool, nodeIPAddresses []string, removeAll bool) bool { changed := false - nodeIPsSet := sets.NewString(nodeIPAddresses...) - if backendPool.BackendAddressPoolPropertiesFormat != nil && - backendPool.LoadBalancerBackendAddresses != nil { - for i := len(*backendPool.LoadBalancerBackendAddresses) - 1; i >= 0; i-- { - if (*backendPool.LoadBalancerBackendAddresses)[i].LoadBalancerBackendAddressPropertiesFormat != nil { - ipAddress := to.String((*backendPool.LoadBalancerBackendAddresses)[i].IPAddress) - if ipAddress == "" { - klog.V(4).Infof("removeNodeIPAddressFromBackendPool: LoadBalancerBackendAddress %s is not IP-based, skipping", to.String((*backendPool.LoadBalancerBackendAddresses)[i].Name)) - continue - } - if removeAll || nodeIPsSet.Has(ipAddress) { - klog.V(4).Infof("removeNodeIPAddressFromBackendPool: removing %s from the backend pool %s", ipAddress, to.String(backendPool.Name)) - *backendPool.LoadBalancerBackendAddresses = append((*backendPool.LoadBalancerBackendAddresses)[:i], (*backendPool.LoadBalancerBackendAddresses)[i+1:]...) - changed = true - } + nodeIPsSet := sets.New(nodeIPAddresses...) + + if backendPool.BackendAddressPoolPropertiesFormat == nil || + backendPool.LoadBalancerBackendAddresses == nil { + return false + } + + addresses := *backendPool.LoadBalancerBackendAddresses + for i := len(addresses) - 1; i >= 0; i-- { + if addresses[i].LoadBalancerBackendAddressPropertiesFormat != nil { + ipAddress := pointer.StringDeref((*backendPool.LoadBalancerBackendAddresses)[i].IPAddress, "") + if ipAddress == "" { + klog.V(4).Infof("removeNodeIPAddressFromBackendPool: LoadBalancerBackendAddress %s is not IP-based, skipping", pointer.StringDeref(addresses[i].Name, "")) + continue + } + if removeAll || nodeIPsSet.Has(ipAddress) { + klog.V(4).Infof("removeNodeIPAddressFromBackendPool: removing %s from the backend pool %s", ipAddress, pointer.StringDeref(backendPool.Name, "")) + addresses = append(addresses[:i], addresses[i+1:]...) + changed = true } } } + if removeAll { + backendPool.LoadBalancerBackendAddresses = &addresses + return changed + } + + if len(addresses) == 0 { + klog.V(2).Info("removeNodeIPAddressFromBackendPool: the pool is empty or will be empty after removing the unwanted IP addresses, skipping the removal") + changed = false + } else if changed { + backendPool.LoadBalancerBackendAddresses = &addresses + } + return changed } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_managedDiskController.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_managedDiskController.go index 538ed8d8470a..5e3a057e7e38 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_managedDiskController.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_managedDiskController.go @@ -25,7 +25,6 @@ import ( "strings" "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" - "github.com/Azure/go-autorest/autorest/to" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" @@ -33,6 +32,7 @@ import ( cloudvolume "k8s.io/cloud-provider/volume" volumehelpers "k8s.io/cloud-provider/volume/helpers" "k8s.io/klog/v2" + "k8s.io/utils/pointer" "sigs.k8s.io/cloud-provider-azure/pkg/consts" ) @@ -117,14 +117,14 @@ func (c *ManagedDiskController) CreateManagedDisk(ctx context.Context, options * diskSizeGB := int32(options.SizeGB) diskSku := options.StorageAccountType - rg := c.common.resourceGroup + rg := c.common.cloud.ResourceGroup if options.ResourceGroup != "" { rg = options.ResourceGroup } - if options.SubscriptionID != "" && !strings.EqualFold(options.SubscriptionID, c.common.subscriptionID) && options.ResourceGroup == "" { + if options.SubscriptionID != "" && !strings.EqualFold(options.SubscriptionID, c.common.cloud.SubscriptionID) && options.ResourceGroup == "" { return "", fmt.Errorf("resourceGroup must be specified when subscriptionID(%s) is not empty", options.SubscriptionID) } - subsID := c.common.subscriptionID + subsID := c.common.cloud.SubscriptionID if options.SubscriptionID != "" { subsID = options.SubscriptionID } @@ -157,7 +157,7 @@ func (c *ManagedDiskController) CreateManagedDisk(ctx context.Context, options * if options.DiskIOPSReadWrite == "" { if diskSku == compute.UltraSSDLRS { diskIOPSReadWrite := int64(consts.DefaultDiskIOPSReadWrite) - diskProperties.DiskIOPSReadWrite = to.Int64Ptr(diskIOPSReadWrite) + diskProperties.DiskIOPSReadWrite = pointer.Int64(diskIOPSReadWrite) } } else { v, err := strconv.Atoi(options.DiskIOPSReadWrite) @@ -165,13 +165,13 @@ func (c *ManagedDiskController) CreateManagedDisk(ctx context.Context, options * return "", fmt.Errorf("AzureDisk - failed to parse DiskIOPSReadWrite: %w", err) } diskIOPSReadWrite := int64(v) - diskProperties.DiskIOPSReadWrite = to.Int64Ptr(diskIOPSReadWrite) + diskProperties.DiskIOPSReadWrite = pointer.Int64(diskIOPSReadWrite) } if options.DiskMBpsReadWrite == "" { if diskSku == compute.UltraSSDLRS { diskMBpsReadWrite := int64(consts.DefaultDiskMBpsReadWrite) - diskProperties.DiskMBpsReadWrite = to.Int64Ptr(diskMBpsReadWrite) + diskProperties.DiskMBpsReadWrite = pointer.Int64(diskMBpsReadWrite) } } else { v, err := strconv.Atoi(options.DiskMBpsReadWrite) @@ -179,12 +179,12 @@ func (c *ManagedDiskController) CreateManagedDisk(ctx context.Context, options * return "", fmt.Errorf("AzureDisk - failed to parse DiskMBpsReadWrite: %w", err) } diskMBpsReadWrite := int64(v) - diskProperties.DiskMBpsReadWrite = to.Int64Ptr(diskMBpsReadWrite) + diskProperties.DiskMBpsReadWrite = pointer.Int64(diskMBpsReadWrite) } if options.LogicalSectorSize != 0 { klog.V(2).Infof("AzureDisk - requested LogicalSectorSize: %v", options.LogicalSectorSize) - diskProperties.CreationData.LogicalSectorSize = to.Int32Ptr(options.LogicalSectorSize) + diskProperties.CreationData.LogicalSectorSize = pointer.Int32(options.LogicalSectorSize) } } else { if options.DiskIOPSReadWrite != "" { @@ -221,7 +221,7 @@ func (c *ManagedDiskController) CreateManagedDisk(ctx context.Context, options * diskProperties.MaxShares = &options.MaxShares } - location := c.common.location + location := c.common.cloud.Location if options.Location != "" { location = options.Location } @@ -234,10 +234,10 @@ func (c *ManagedDiskController) CreateManagedDisk(ctx context.Context, options * DiskProperties: &diskProperties, } - if el := c.common.extendedLocation; el != nil { + if c.common.cloud.HasExtendedLocation() { model.ExtendedLocation = &compute.ExtendedLocation{ - Name: to.StringPtr(el.Name), - Type: compute.ExtendedLocationTypes(el.Type), + Name: pointer.String(c.common.cloud.ExtendedLocationName), + Type: compute.ExtendedLocationTypes(c.common.cloud.ExtendedLocationType), } } @@ -254,7 +254,7 @@ func (c *ManagedDiskController) CreateManagedDisk(ctx context.Context, options * if options.SkipGetDiskOperation { klog.Warningf("azureDisk - GetDisk(%s, StorageAccountType:%s) is throttled, unable to confirm provisioningState in poll process", options.DiskName, options.StorageAccountType) } else { - err = kwait.ExponentialBackoff(defaultBackOff, func() (bool, error) { + err = kwait.ExponentialBackoffWithContext(ctx, defaultBackOff, func(ctx context.Context) (bool, error) { provisionState, id, err := c.GetDisk(ctx, subsID, rg, options.DiskName) if err == nil { if id != "" { @@ -288,8 +288,8 @@ func (c *ManagedDiskController) DeleteManagedDisk(ctx context.Context, diskURI s return err } - if _, ok := c.common.diskStateMap.Load(strings.ToLower(diskURI)); ok { - return fmt.Errorf("failed to delete disk(%s) since it's in attaching or detaching state", diskURI) + if state, ok := c.common.diskStateMap.Load(strings.ToLower(diskURI)); ok { + return fmt.Errorf("failed to delete disk(%s) since it's in %s state", diskURI, state.(string)) } diskName := path.Base(diskURI) @@ -364,7 +364,7 @@ func (c *ManagedDiskController) ResizeDisk(ctx context.Context, diskURI string, } if !supportOnlineResize && result.DiskProperties.DiskState != compute.Unattached { - return oldSize, fmt.Errorf("azureDisk - disk resize is only supported on Unattached disk, current disk state: %s, already attached to %s", result.DiskProperties.DiskState, to.String(result.ManagedBy)) + return oldSize, fmt.Errorf("azureDisk - disk resize is only supported on Unattached disk, current disk state: %s, already attached to %s", result.DiskProperties.DiskState, pointer.StringDeref(result.ManagedBy, "")) } diskParameter := compute.DiskUpdate{ diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_mock_loadbalancer_backendpool.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_mock_loadbalancer_backendpool.go index 9b446ae0b0fd..9d1911995dc4 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_mock_loadbalancer_backendpool.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_mock_loadbalancer_backendpool.go @@ -19,50 +19,35 @@ package provider import ( reflect "reflect" - network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" gomock "github.com/golang/mock/gomock" - v1 "k8s.io/api/core/v1" ) -// MockBackendPool is a mock of BackendPool interface +// MockBackendPool is a mock of BackendPool interface. type MockBackendPool struct { ctrl *gomock.Controller recorder *MockBackendPoolMockRecorder } -// MockBackendPoolMockRecorder is the mock recorder for MockBackendPool +// MockBackendPoolMockRecorder is the mock recorder for MockBackendPool. type MockBackendPoolMockRecorder struct { mock *MockBackendPool } -// NewMockBackendPool creates a new mock instance +// NewMockBackendPool creates a new mock instance. func NewMockBackendPool(ctrl *gomock.Controller) *MockBackendPool { mock := &MockBackendPool{ctrl: ctrl} mock.recorder = &MockBackendPoolMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockBackendPool) EXPECT() *MockBackendPoolMockRecorder { return m.recorder } -// EnsureHostsInPool mocks base method -func (m *MockBackendPool) EnsureHostsInPool(service *v1.Service, nodes []*v1.Node, backendPoolID, vmSetName, clusterName, lbName string, backendPool network.BackendAddressPool) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "EnsureHostsInPool", service, nodes, backendPoolID, vmSetName, clusterName, lbName, backendPool) - ret0, _ := ret[0].(error) - return ret0 -} - -// EnsureHostsInPool indicates an expected call of EnsureHostsInPool -func (mr *MockBackendPoolMockRecorder) EnsureHostsInPool(service, nodes, backendPoolID, vmSetName, clusterName, lbName, backendPool interface{}) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnsureHostsInPool", reflect.TypeOf((*MockBackendPool)(nil).EnsureHostsInPool), service, nodes, backendPoolID, vmSetName, clusterName, lbName, backendPool) -} - -// CleanupVMSetFromBackendPoolByCondition mocks base method +// CleanupVMSetFromBackendPoolByCondition mocks base method. func (m *MockBackendPool) CleanupVMSetFromBackendPoolByCondition(slb *network.LoadBalancer, service *v1.Service, nodes []*v1.Node, clusterName string, shouldRemoveVMSetFromSLB func(string) bool) (*network.LoadBalancer, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CleanupVMSetFromBackendPoolByCondition", slb, service, nodes, clusterName, shouldRemoveVMSetFromSLB) @@ -71,29 +56,27 @@ func (m *MockBackendPool) CleanupVMSetFromBackendPoolByCondition(slb *network.Lo return ret0, ret1 } -// CleanupVMSetFromBackendPoolByCondition indicates an expected call of CleanupVMSetFromBackendPoolByCondition +// CleanupVMSetFromBackendPoolByCondition indicates an expected call of CleanupVMSetFromBackendPoolByCondition. func (mr *MockBackendPoolMockRecorder) CleanupVMSetFromBackendPoolByCondition(slb, service, nodes, clusterName, shouldRemoveVMSetFromSLB interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CleanupVMSetFromBackendPoolByCondition", reflect.TypeOf((*MockBackendPool)(nil).CleanupVMSetFromBackendPoolByCondition), slb, service, nodes, clusterName, shouldRemoveVMSetFromSLB) } -// ReconcileBackendPools mocks base method -func (m *MockBackendPool) ReconcileBackendPools(clusterName string, service *v1.Service, lb *network.LoadBalancer) (bool, bool, error) { +// EnsureHostsInPool mocks base method. +func (m *MockBackendPool) EnsureHostsInPool(service *v1.Service, nodes []*v1.Node, backendPoolID, vmSetName, clusterName, lbName string, backendPool network.BackendAddressPool) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ReconcileBackendPools", clusterName, service, lb) - ret0, _ := ret[0].(bool) - ret1, _ := ret[1].(bool) - ret2, _ := ret[2].(error) - return ret0, ret1, ret2 + ret := m.ctrl.Call(m, "EnsureHostsInPool", service, nodes, backendPoolID, vmSetName, clusterName, lbName, backendPool) + ret0, _ := ret[0].(error) + return ret0 } -// ReconcileBackendPools indicates an expected call of ReconcileBackendPools -func (mr *MockBackendPoolMockRecorder) ReconcileBackendPools(clusterName, service, lb interface{}) *gomock.Call { +// EnsureHostsInPool indicates an expected call of EnsureHostsInPool. +func (mr *MockBackendPoolMockRecorder) EnsureHostsInPool(service, nodes, backendPoolID, vmSetName, clusterName, lbName, backendPool interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileBackendPools", reflect.TypeOf((*MockBackendPool)(nil).ReconcileBackendPools), clusterName, service, lb) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnsureHostsInPool", reflect.TypeOf((*MockBackendPool)(nil).EnsureHostsInPool), service, nodes, backendPoolID, vmSetName, clusterName, lbName, backendPool) } -// GetBackendPrivateIPs mocks base method +// GetBackendPrivateIPs mocks base method. func (m *MockBackendPool) GetBackendPrivateIPs(clusterName string, service *v1.Service, lb *network.LoadBalancer) ([]string, []string) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetBackendPrivateIPs", clusterName, service, lb) @@ -102,8 +85,25 @@ func (m *MockBackendPool) GetBackendPrivateIPs(clusterName string, service *v1.S return ret0, ret1 } -// GetBackendPrivateIPs indicates an expected call of GetBackendPrivateIPs +// GetBackendPrivateIPs indicates an expected call of GetBackendPrivateIPs. func (mr *MockBackendPoolMockRecorder) GetBackendPrivateIPs(clusterName, service, lb interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBackendPrivateIPs", reflect.TypeOf((*MockBackendPool)(nil).GetBackendPrivateIPs), clusterName, service, lb) } + +// ReconcileBackendPools mocks base method. +func (m *MockBackendPool) ReconcileBackendPools(clusterName string, service *v1.Service, lb *network.LoadBalancer) (bool, bool, bool, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ReconcileBackendPools", clusterName, service, lb) + ret0, _ := ret[0].(bool) + ret1, _ := ret[1].(bool) + ret2, _ := ret[2].(bool) + ret3, _ := ret[3].(error) + return ret0, ret1, ret2, ret3 +} + +// ReconcileBackendPools indicates an expected call of ReconcileBackendPools. +func (mr *MockBackendPoolMockRecorder) ReconcileBackendPools(clusterName, service, lb interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ReconcileBackendPools", reflect.TypeOf((*MockBackendPool)(nil).ReconcileBackendPools), clusterName, service, lb) +} diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_mock_vmsets.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_mock_vmsets.go index be51095b08d7..6a64e259fa44 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_mock_vmsets.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_mock_vmsets.go @@ -21,9 +21,10 @@ import ( reflect "reflect" compute "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" - network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + network "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" azure "github.com/Azure/go-autorest/autorest/azure" gomock "github.com/golang/mock/gomock" + v1 "k8s.io/api/core/v1" types "k8s.io/apimachinery/pkg/types" cloud_provider "k8s.io/cloud-provider" @@ -98,32 +99,32 @@ func (mr *MockVMSetMockRecorder) DetachDisk(ctx, nodeName, diskMap interface{}) } // EnsureBackendPoolDeleted mocks base method. -func (m *MockVMSet) EnsureBackendPoolDeleted(service *v1.Service, backendPoolID, vmSetName string, backendAddressPools *[]network.BackendAddressPool, deleteFromVMSet bool) (bool, error) { +func (m *MockVMSet) EnsureBackendPoolDeleted(service *v1.Service, backendPoolIDs []string, vmSetName string, backendAddressPools *[]network.BackendAddressPool, deleteFromVMSet bool) (bool, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "EnsureBackendPoolDeleted", service, backendPoolID, vmSetName, backendAddressPools, deleteFromVMSet) + ret := m.ctrl.Call(m, "EnsureBackendPoolDeleted", service, backendPoolIDs, vmSetName, backendAddressPools, deleteFromVMSet) ret0, _ := ret[0].(bool) ret1, _ := ret[1].(error) return ret0, ret1 } // EnsureBackendPoolDeleted indicates an expected call of EnsureBackendPoolDeleted. -func (mr *MockVMSetMockRecorder) EnsureBackendPoolDeleted(service, backendPoolID, vmSetName, backendAddressPools, deleteFromVMSet interface{}) *gomock.Call { +func (mr *MockVMSetMockRecorder) EnsureBackendPoolDeleted(service, backendPoolIDs, vmSetName, backendAddressPools, deleteFromVMSet interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnsureBackendPoolDeleted", reflect.TypeOf((*MockVMSet)(nil).EnsureBackendPoolDeleted), service, backendPoolID, vmSetName, backendAddressPools, deleteFromVMSet) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnsureBackendPoolDeleted", reflect.TypeOf((*MockVMSet)(nil).EnsureBackendPoolDeleted), service, backendPoolIDs, vmSetName, backendAddressPools, deleteFromVMSet) } // EnsureBackendPoolDeletedFromVMSets mocks base method. -func (m *MockVMSet) EnsureBackendPoolDeletedFromVMSets(vmSetNamesMap map[string]bool, backendPoolID string) error { +func (m *MockVMSet) EnsureBackendPoolDeletedFromVMSets(vmSetNamesMap map[string]bool, backendPoolIDs []string) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "EnsureBackendPoolDeletedFromVMSets", vmSetNamesMap, backendPoolID) + ret := m.ctrl.Call(m, "EnsureBackendPoolDeletedFromVMSets", vmSetNamesMap, backendPoolIDs) ret0, _ := ret[0].(error) return ret0 } // EnsureBackendPoolDeletedFromVMSets indicates an expected call of EnsureBackendPoolDeletedFromVMSets. -func (mr *MockVMSetMockRecorder) EnsureBackendPoolDeletedFromVMSets(vmSetNamesMap, backendPoolID interface{}) *gomock.Call { +func (mr *MockVMSetMockRecorder) EnsureBackendPoolDeletedFromVMSets(vmSetNamesMap, backendPoolIDs interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnsureBackendPoolDeletedFromVMSets", reflect.TypeOf((*MockVMSet)(nil).EnsureBackendPoolDeletedFromVMSets), vmSetNamesMap, backendPoolID) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnsureBackendPoolDeletedFromVMSets", reflect.TypeOf((*MockVMSet)(nil).EnsureBackendPoolDeletedFromVMSets), vmSetNamesMap, backendPoolIDs) } // EnsureHostInPool mocks base method. @@ -415,10 +416,25 @@ func (mr *MockVMSetMockRecorder) UpdateVM(ctx, nodeName interface{}) *gomock.Cal return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateVM", reflect.TypeOf((*MockVMSet)(nil).UpdateVM), ctx, nodeName) } +// UpdateVMAsync mocks base method. +func (m *MockVMSet) UpdateVMAsync(ctx context.Context, nodeName types.NodeName) (*azure.Future, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateVMAsync", ctx, nodeName) + ret0, _ := ret[0].(*azure.Future) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateVMAsync indicates an expected call of UpdateVMAsync. +func (mr *MockVMSetMockRecorder) UpdateVMAsync(ctx, nodeName interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateVMAsync", reflect.TypeOf((*MockVMSet)(nil).UpdateVMAsync), ctx, nodeName) +} + // WaitForUpdateResult mocks base method. func (m *MockVMSet) WaitForUpdateResult(ctx context.Context, future *azure.Future, nodeName types.NodeName, source string) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "WaitForUpdateResult", ctx, future, source) + ret := m.ctrl.Call(m, "WaitForUpdateResult", ctx, future, nodeName, source) ret0, _ := ret[0].(error) return ret0 } @@ -426,5 +442,5 @@ func (m *MockVMSet) WaitForUpdateResult(ctx context.Context, future *azure.Futur // WaitForUpdateResult indicates an expected call of WaitForUpdateResult. func (mr *MockVMSetMockRecorder) WaitForUpdateResult(ctx, future, nodeName, source interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WaitForUpdateResult", reflect.TypeOf((*MockVMSet)(nil).WaitForUpdateResult), ctx, future, source) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "WaitForUpdateResult", reflect.TypeOf((*MockVMSet)(nil).WaitForUpdateResult), ctx, future, nodeName, source) } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_privatelinkservice.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_privatelinkservice.go index 43c356a6f8ae..bdd96d3f5554 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_privatelinkservice.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_privatelinkservice.go @@ -21,14 +21,15 @@ import ( "net" "strings" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" - "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" v1 "k8s.io/api/core/v1" "k8s.io/klog/v2" + "k8s.io/utils/pointer" azcache "sigs.k8s.io/cloud-provider-azure/pkg/cache" "sigs.k8s.io/cloud-provider-azure/pkg/consts" + "sigs.k8s.io/cloud-provider-azure/pkg/metrics" "sigs.k8s.io/cloud-provider-azure/pkg/retry" ) @@ -43,7 +44,18 @@ func (az *Cloud) reconcilePrivateLinkService( createPLS := wantPLS && serviceRequiresPLS(service) serviceName := getServiceName(service) fipConfigID := fipConfig.ID - klog.V(2).Infof("reconcilePrivateLinkService for service(%s) - LB fipConfigID(%s) - wantPLS(%t) - createPLS(%t)", serviceName, to.String(fipConfig.Name), wantPLS, createPLS) + klog.V(2).Infof("reconcilePrivateLinkService for service(%s) - LB fipConfigID(%s) - wantPLS(%t) - createPLS(%t)", serviceName, pointer.StringDeref(fipConfig.Name, ""), wantPLS, createPLS) + + request := "ensure_privatelinkservice" + if !wantPLS { + request = "ensure_privatelinkservice_deleted" + } + mc := metrics.NewMetricContext("services", request, az.ResourceGroup, az.getNetworkResourceSubscriptionID(), serviceName) + + isOperationSucceeded := false + defer func() { + mc.ObserveOperationWithResult(isOperationSucceeded) + }() if createPLS { // Firstly, make sure it's internal service @@ -54,19 +66,19 @@ func (az *Cloud) reconcilePrivateLinkService( // Secondly, check if there is a private link service already created existingPLS, err := az.getPrivateLinkService(fipConfigID, azcache.CacheReadTypeDefault) if err != nil { - klog.Errorf("reconcilePrivateLinkService for service(%s): getPrivateLinkService(%s) failed: %v", serviceName, to.String(fipConfigID), err) + klog.Errorf("reconcilePrivateLinkService for service(%s): getPrivateLinkService(%s) failed: %v", serviceName, pointer.StringDeref(fipConfigID, ""), err) return err } - exists := !strings.EqualFold(to.String(existingPLS.ID), consts.PrivateLinkServiceNotExistID) + exists := !strings.EqualFold(pointer.StringDeref(existingPLS.ID, ""), consts.PrivateLinkServiceNotExistID) if exists { - klog.V(4).Infof("reconcilePrivateLinkService for service(%s): found existing private link service attached(%s)", serviceName, to.String(existingPLS.Name)) + klog.V(4).Infof("reconcilePrivateLinkService for service(%s): found existing private link service attached(%s)", serviceName, pointer.StringDeref(existingPLS.Name, "")) if !isManagedPrivateLinkSerivce(&existingPLS, clusterName) { return fmt.Errorf( "reconcilePrivateLinkService for service(%s) failed: LB frontend(%s) already has unmanaged private link service(%s)", serviceName, - to.String(fipConfigID), - to.String(existingPLS.ID), + pointer.StringDeref(fipConfigID, ""), + pointer.StringDeref(existingPLS.ID, ""), ) } // If there is an existing private link service, only owner service can update its properties @@ -76,15 +88,15 @@ func (az *Cloud) reconcilePrivateLinkService( return fmt.Errorf( "reconcilePrivateLinkService for service(%s) failed: LB frontend(%s) already has existing private link service(%s) owned by service(%s)", serviceName, - to.String(fipConfigID), - to.String(existingPLS.Name), + pointer.StringDeref(fipConfigID, ""), + pointer.StringDeref(existingPLS.Name, ""), ownerService, ) } klog.V(2).Infof( "reconcilePrivateLinkService for service(%s): automatically share private link service(%s) owned by service(%s)", serviceName, - to.String(existingPLS.Name), + pointer.StringDeref(existingPLS.Name, ""), ownerService, ) return nil @@ -118,7 +130,7 @@ func (az *Cloud) reconcilePrivateLinkService( klog.Errorf("reconcilePrivateLinkService for service(%s) disable PLS network policy failed for pls(%s): %v", serviceName, plsName, err.Error()) return err } - existingPLS.Etag = to.StringPtr("") + existingPLS.Etag = pointer.String("") err = az.CreateOrUpdatePLS(service, existingPLS) if err != nil { klog.Errorf("reconcilePrivateLinkService for service(%s) abort backoff: pls(%s) - updating: %s", serviceName, plsName, err.Error()) @@ -128,20 +140,21 @@ func (az *Cloud) reconcilePrivateLinkService( } else if !wantPLS { existingPLS, err := az.getPrivateLinkService(fipConfigID, azcache.CacheReadTypeDefault) if err != nil { - klog.Errorf("reconcilePrivateLinkService for service(%s): getPrivateLinkService(%s) failed: %v", serviceName, to.String(fipConfigID), err) + klog.Errorf("reconcilePrivateLinkService for service(%s): getPrivateLinkService(%s) failed: %v", serviceName, pointer.StringDeref(fipConfigID, ""), err) return err } - exists := !strings.EqualFold(to.String(existingPLS.ID), consts.PrivateLinkServiceNotExistID) + exists := !strings.EqualFold(pointer.StringDeref(existingPLS.ID, ""), consts.PrivateLinkServiceNotExistID) if exists { deleteErr := az.safeDeletePLS(&existingPLS, service) if deleteErr != nil { - klog.Errorf("reconcilePrivateLinkService for service(%s): deletePLS for frontEnd(%s) failed: %v", serviceName, to.String(fipConfigID), err) + klog.Errorf("reconcilePrivateLinkService for service(%s): deletePLS for frontEnd(%s) failed: %v", serviceName, pointer.StringDeref(fipConfigID, ""), err) return deleteErr.Error() } } } + isOperationSucceeded = true klog.V(2).Infof("reconcilePrivateLinkService for service(%s) finished", serviceName) return nil } @@ -182,19 +195,19 @@ func (az *Cloud) safeDeletePLS(pls *network.PrivateLinkService, service *v1.Serv peConns := pls.PrivateEndpointConnections if peConns != nil { for _, peConn := range *peConns { - klog.V(2).Infof("deletePLS: deleting PEConnection %s", to.String(peConn.Name)) - rerr := az.DeletePEConn(service, to.String(pls.Name), to.String(peConn.Name)) + klog.V(2).Infof("deletePLS: deleting PEConnection %s", pointer.StringDeref(peConn.Name, "")) + rerr := az.DeletePEConn(service, pointer.StringDeref(pls.Name, ""), pointer.StringDeref(peConn.Name, "")) if rerr != nil { return rerr } } } - rerr := az.DeletePLS(service, to.String(pls.Name), to.String((*pls.LoadBalancerFrontendIPConfigurations)[0].ID)) + rerr := az.DeletePLS(service, pointer.StringDeref(pls.Name, ""), pointer.StringDeref((*pls.LoadBalancerFrontendIPConfigurations)[0].ID, "")) if rerr != nil { return rerr } - klog.V(2).Infof("safeDeletePLS(%s) finished", to.String(pls.Name)) + klog.V(2).Infof("safeDeletePLS(%s) finished", pointer.StringDeref(pls.Name, "")) return nil } @@ -209,11 +222,11 @@ func (az *Cloud) getPrivateLinkServiceName( if nameFromService, found := service.Annotations[consts.ServiceAnnotationPLSName]; found { nameFromService = strings.TrimSpace(nameFromService) - if existingName != nil && !strings.EqualFold(to.String(existingName), nameFromService) { + if existingName != nil && !strings.EqualFold(pointer.StringDeref(existingName, ""), nameFromService) { return "", fmt.Errorf( "getPrivateLinkServiceName(%s) failed: cannot change existing private link service name (%s) to (%s)", serviceName, - to.String(existingName), + pointer.StringDeref(existingName, ""), nameFromService, ) } @@ -221,7 +234,7 @@ func (az *Cloud) getPrivateLinkServiceName( } if existingName != nil { - return to.String(existingName), nil + return pointer.StringDeref(existingName, ""), nil } // default PLS name: pls- @@ -339,19 +352,19 @@ func (az *Cloud) reconcilePLSIpConfigs( existingStaticIps := make([]string, 0) for _, ipConfig := range *existingPLS.IPConfigurations { - if !strings.EqualFold(to.String(subnet.ID), to.String(ipConfig.Subnet.ID)) { + if !strings.EqualFold(pointer.StringDeref(subnet.ID, ""), pointer.StringDeref(ipConfig.Subnet.ID, "")) { changed = true } - if strings.EqualFold(string(ipConfig.PrivateIPAllocationMethod), string(network.IPAllocationMethodStatic)) { - klog.V(10).Infof("Found static IP: %s", to.String(ipConfig.PrivateIPAddress)) - if _, found := staticIps[to.String(ipConfig.PrivateIPAddress)]; !found { + if strings.EqualFold(string(ipConfig.PrivateIPAllocationMethod), string(network.Static)) { + klog.V(10).Infof("Found static IP: %s", pointer.StringDeref(ipConfig.PrivateIPAddress, "")) + if _, found := staticIps[pointer.StringDeref(ipConfig.PrivateIPAddress, "")]; !found { changed = true } - existingStaticIps = append(existingStaticIps, to.String(ipConfig.PrivateIPAddress)) + existingStaticIps = append(existingStaticIps, pointer.StringDeref(ipConfig.PrivateIPAddress, "")) } if *ipConfig.Primary { - if strings.EqualFold(string(ipConfig.PrivateIPAllocationMethod), string(network.IPAllocationMethodStatic)) { - if !strings.EqualFold(primaryIP, to.String(ipConfig.PrivateIPAddress)) { + if strings.EqualFold(string(ipConfig.PrivateIPAllocationMethod), string(network.Static)) { + if !strings.EqualFold(primaryIP, pointer.StringDeref(ipConfig.PrivateIPAddress, "")) { changed = true } } else { @@ -371,32 +384,32 @@ func (az *Cloud) reconcilePLSIpConfigs( for k := range staticIps { ip := k isPrimary := strings.EqualFold(ip, primaryIP) - configName := fmt.Sprintf("%s-%s-static-%s", to.String(subnet.Name), to.String(existingPLS.Name), ip) + configName := fmt.Sprintf("%s-%s-static-%s", pointer.StringDeref(subnet.Name, ""), pointer.StringDeref(existingPLS.Name, ""), ip) ipConfigs = append(ipConfigs, network.PrivateLinkServiceIPConfiguration{ Name: &configName, PrivateLinkServiceIPConfigurationProperties: &network.PrivateLinkServiceIPConfigurationProperties{ PrivateIPAddress: &ip, - PrivateIPAllocationMethod: network.IPAllocationMethodStatic, + PrivateIPAllocationMethod: network.Static, Subnet: &network.Subnet{ ID: subnet.ID, }, Primary: &isPrimary, - PrivateIPAddressVersion: network.IPVersionIPv4, + PrivateIPAddressVersion: network.IPv4, }, }) } for i := 0; i < int(ipConfigCount)-len(staticIps); i++ { isPrimary := primaryIP == "" && i == 0 - configName := fmt.Sprintf("%s-%s-dynamic-%d", to.String(subnet.Name), to.String(existingPLS.Name), i) + configName := fmt.Sprintf("%s-%s-dynamic-%d", pointer.StringDeref(subnet.Name, ""), pointer.StringDeref(existingPLS.Name, ""), i) ipConfigs = append(ipConfigs, network.PrivateLinkServiceIPConfiguration{ Name: &configName, PrivateLinkServiceIPConfigurationProperties: &network.PrivateLinkServiceIPConfigurationProperties{ - PrivateIPAllocationMethod: network.IPAllocationMethodDynamic, + PrivateIPAllocationMethod: network.Dynamic, Subnet: &network.Subnet{ ID: subnet.ID, }, Primary: &isPrimary, - PrivateIPAddressVersion: network.IPVersionIPv4, + PrivateIPAddressVersion: network.IPv4, }, }) } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_routes.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_routes.go index 63e924616bd6..966bbceff751 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_routes.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_routes.go @@ -23,14 +23,14 @@ import ( "sync" "time" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" - "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/wait" cloudprovider "k8s.io/cloud-provider" "k8s.io/klog/v2" utilnet "k8s.io/utils/net" + "k8s.io/utils/pointer" azcache "sigs.k8s.io/cloud-provider-azure/pkg/cache" "sigs.k8s.io/cloud-provider-azure/pkg/consts" @@ -168,13 +168,13 @@ func (d *delayedRouteUpdater) updateRoutes() { routeMatch := false onlyUpdateTags = false for i, existingRoute := range routes { - if strings.EqualFold(to.String(existingRoute.Name), to.String(rt.route.Name)) { + if strings.EqualFold(pointer.StringDeref(existingRoute.Name, ""), pointer.StringDeref(rt.route.Name, "")) { // delete the name-matched routes here (missing routes would be added later if the operation is add). routes = append(routes[:i], routes[i+1:]...) if existingRoute.RoutePropertiesFormat != nil && rt.route.RoutePropertiesFormat != nil && - strings.EqualFold(to.String(existingRoute.AddressPrefix), to.String(rt.route.AddressPrefix)) && - strings.EqualFold(to.String(existingRoute.NextHopIPAddress), to.String(rt.route.NextHopIPAddress)) { + strings.EqualFold(pointer.StringDeref(existingRoute.AddressPrefix, ""), pointer.StringDeref(rt.route.AddressPrefix, "")) && + strings.EqualFold(pointer.StringDeref(existingRoute.NextHopIPAddress, ""), pointer.StringDeref(rt.route.NextHopIPAddress, "")) { routeMatch = true } if rt.operation == routeOperationDelete { @@ -184,7 +184,7 @@ func (d *delayedRouteUpdater) updateRoutes() { } } if rt.operation == routeOperationDelete && !dirty { - klog.Warningf("updateRoutes: route to be deleted %s does not match any of the existing route", to.String(rt.route.Name)) + klog.Warningf("updateRoutes: route to be deleted %s does not match any of the existing route", pointer.StringDeref(rt.route.Name, "")) } // Add missing routes if the operation is add. @@ -217,7 +217,7 @@ func (d *delayedRouteUpdater) updateRoutes() { // and deletes all dualstack routes when dualstack is not enabled. func (d *delayedRouteUpdater) cleanupOutdatedRoutes(existingRoutes []network.Route) (routes []network.Route, changed bool) { for i := len(existingRoutes) - 1; i >= 0; i-- { - existingRouteName := to.String(existingRoutes[i].Name) + existingRouteName := pointer.StringDeref(existingRoutes[i].Name, "") split := strings.Split(existingRouteName, consts.RouteNameSeparator) klog.V(4).Infof("cleanupOutdatedRoutes: checking route %s", existingRouteName) @@ -287,7 +287,7 @@ func (az *Cloud) ListRoutes(ctx context.Context, clusterName string) ([]*cloudpr } az.routeCIDRsLock.Lock() defer az.routeCIDRsLock.Unlock() - for _, nodeName := range unmanagedNodes.List() { + for _, nodeName := range unmanagedNodes.UnsortedList() { if cidr, ok := az.routeCIDRs[nodeName]; ok { routes = append(routes, &cloudprovider.Route{ Name: nodeName, @@ -300,7 +300,7 @@ func (az *Cloud) ListRoutes(ctx context.Context, clusterName string) ([]*cloudpr // ensure the route table is tagged as configured tags, changed := az.ensureRouteTableTagged(&routeTable) if changed { - klog.V(2).Infof("ListRoutes: updating tags on route table %s", to.String(routeTable.Name)) + klog.V(2).Infof("ListRoutes: updating tags on route table %s", pointer.StringDeref(routeTable.Name, "")) op, err := az.routeUpdater.addUpdateRouteTableTagsOperation(routeTableOperationUpdateTags, tags) if err != nil { klog.Errorf("ListRoutes: failed to add route table operation with error: %v", err) @@ -349,8 +349,8 @@ func processRoutes(ipv6DualStackEnabled bool, routeTable network.RouteTable, exi func (az *Cloud) createRouteTable() error { routeTable := network.RouteTable{ - Name: to.StringPtr(az.RouteTableName), - Location: to.StringPtr(az.Location), + Name: pointer.String(az.RouteTableName), + Location: pointer.String(az.Location), RouteTablePropertiesFormat: &network.RouteTablePropertiesFormat{}, } @@ -417,11 +417,11 @@ func (az *Cloud) CreateRoute(ctx context.Context, clusterName string, nameHint s } routeName := mapNodeNameToRouteName(az.ipv6DualStackEnabled, kubeRoute.TargetNode, kubeRoute.DestinationCIDR) route := network.Route{ - Name: to.StringPtr(routeName), + Name: pointer.String(routeName), RoutePropertiesFormat: &network.RoutePropertiesFormat{ - AddressPrefix: to.StringPtr(kubeRoute.DestinationCIDR), + AddressPrefix: pointer.String(kubeRoute.DestinationCIDR), NextHopType: network.RouteNextHopTypeVirtualAppliance, - NextHopIPAddress: to.StringPtr(targetIP), + NextHopIPAddress: pointer.String(targetIP), }, } @@ -471,7 +471,7 @@ func (az *Cloud) DeleteRoute(ctx context.Context, clusterName string, kubeRoute routeName := mapNodeNameToRouteName(az.ipv6DualStackEnabled, kubeRoute.TargetNode, kubeRoute.DestinationCIDR) klog.V(2).Infof("DeleteRoute: deleting route. clusterName=%q instance=%q cidr=%q routeName=%q", clusterName, kubeRoute.TargetNode, kubeRoute.DestinationCIDR, routeName) route := network.Route{ - Name: to.StringPtr(routeName), + Name: pointer.String(routeName), RoutePropertiesFormat: &network.RoutePropertiesFormat{}, } op, err := az.routeUpdater.addRouteOperation(routeOperationDelete, route) @@ -492,7 +492,7 @@ func (az *Cloud) DeleteRoute(ctx context.Context, clusterName string, kubeRoute routeNameWithoutIPV6Suffix := strings.Split(routeName, consts.RouteNameSeparator)[0] klog.V(2).Infof("DeleteRoute: deleting route. clusterName=%q instance=%q cidr=%q routeName=%q", clusterName, kubeRoute.TargetNode, kubeRoute.DestinationCIDR, routeNameWithoutIPV6Suffix) route := network.Route{ - Name: to.StringPtr(routeNameWithoutIPV6Suffix), + Name: pointer.String(routeNameWithoutIPV6Suffix), RoutePropertiesFormat: &network.RoutePropertiesFormat{}, } op, err := az.routeUpdater.addRouteOperation(routeOperationDelete, route) diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_standard.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_standard.go index 53cd282fbf39..446ef7cd1955 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_standard.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_standard.go @@ -31,8 +31,7 @@ import ( "sigs.k8s.io/cloud-provider-azure/pkg/consts" "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" - "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" @@ -40,7 +39,7 @@ import ( "k8s.io/apimachinery/pkg/util/uuid" cloudprovider "k8s.io/cloud-provider" "k8s.io/klog/v2" - utilnet "k8s.io/utils/net" + "k8s.io/utils/pointer" azcache "sigs.k8s.io/cloud-provider-azure/pkg/cache" "sigs.k8s.io/cloud-provider-azure/pkg/metrics" @@ -56,6 +55,14 @@ var ( vmasIDRE = regexp.MustCompile(`/subscriptions/(?:.*)/resourceGroups/(?:.*)/providers/Microsoft.Compute/availabilitySets/(.+)`) ) +const ( + v6Suffix = "IPv6" +) + +var ( + v6SuffixLower = strings.ToLower(v6Suffix) +) + // returns the full identifier of an availabilitySet func (az *Cloud) getAvailabilitySetID(resourceGroup, availabilitySetName string) string { return fmt.Sprintf( @@ -201,7 +208,7 @@ func getPrimaryInterfaceID(machine compute.VirtualMachine) (string, error) { } for _, ref := range *machine.NetworkProfile.NetworkInterfaces { - if to.Bool(ref.Primary) { + if pointer.BoolDeref(ref.Primary, false) { return *ref.ID, nil } } @@ -219,6 +226,7 @@ func getPrimaryIPConfig(nic network.Interface) (*network.InterfaceIPConfiguratio } for _, ref := range *nic.IPConfigurations { + ref := ref if *ref.Primary { return &ref, nil } @@ -235,16 +243,17 @@ func getIPConfigByIPFamily(nic network.Interface, IPv6 bool) (*network.Interface var ipVersion network.IPVersion if IPv6 { - ipVersion = network.IPVersionIPv6 + ipVersion = network.IPv6 } else { - ipVersion = network.IPVersionIPv4 + ipVersion = network.IPv4 } for _, ref := range *nic.IPConfigurations { + ref := ref if ref.PrivateIPAddress != nil && ref.PrivateIPAddressVersion == ipVersion { return &ref, nil } } - return nil, fmt.Errorf("failed to determine the ipconfig(IPv6=%v). nicname=%q", IPv6, to.String(nic.Name)) + return nil, fmt.Errorf("failed to determine the ipconfig(IPv6=%v). nicname=%q", IPv6, pointer.StringDeref(nic.Name, "")) } func isInternalLoadBalancer(lb *network.LoadBalancer) bool { @@ -261,44 +270,53 @@ func isInternalLoadBalancer(lb *network.LoadBalancer) bool { // This means: // clusters moving from IPv4 to dualstack will require no changes // clusters moving from IPv6 to dualstack will require no changes as the IPv4 backend pool will created with -func getBackendPoolName(clusterName string, service *v1.Service) string { - IPv6 := utilnet.IsIPv6String(service.Spec.ClusterIP) - if IPv6 { - return fmt.Sprintf("%v-IPv6", clusterName) +func getBackendPoolName(clusterName string, isIPv6 bool) string { + if isIPv6 { + return fmt.Sprintf("%s-%s", clusterName, v6Suffix) } return clusterName } -func (az *Cloud) getLoadBalancerRuleName(service *v1.Service, protocol v1.Protocol, port int32) string { +// ifBackendPoolIPv6 checks if a backend pool is of IPv6 according to name/ID. +func isBackendPoolIPv6(name string) bool { + return strings.HasSuffix(strings.ToLower(name), fmt.Sprintf("-%s", v6SuffixLower)) +} + +func (az *Cloud) getLoadBalancerRuleName(service *v1.Service, protocol v1.Protocol, port int32, isIPv6 bool) string { prefix := az.getRulePrefix(service) ruleName := fmt.Sprintf("%s-%s-%d", prefix, protocol, port) subnet := subnet(service) if subnet == nil { + // TODO: Use getResourceByIPFamily() return ruleName } // Load balancer rule name must be less or equal to 80 characters, so excluding the hyphen two segments cannot exceed 79 subnetSegment := *subnet - if len(ruleName)+len(subnetSegment)+1 > consts.LoadBalancerRuleNameMaxLength { - subnetSegment = subnetSegment[:consts.LoadBalancerRuleNameMaxLength-len(ruleName)-1] + maxLength := consts.LoadBalancerRuleNameMaxLength - consts.IPFamilySuffixLength + if len(ruleName)+len(subnetSegment)+1 > maxLength { + subnetSegment = subnetSegment[:maxLength-len(ruleName)-1] } + // TODO: Use getResourceByIPFamily() return fmt.Sprintf("%s-%s-%s-%d", prefix, subnetSegment, protocol, port) } -func (az *Cloud) getloadbalancerHAmodeRuleName(service *v1.Service) string { - return az.getLoadBalancerRuleName(service, service.Spec.Ports[0].Protocol, service.Spec.Ports[0].Port) +func (az *Cloud) getloadbalancerHAmodeRuleName(service *v1.Service, isIPv6 bool) string { + return az.getLoadBalancerRuleName(service, service.Spec.Ports[0].Protocol, service.Spec.Ports[0].Port, isIPv6) } -func (az *Cloud) getSecurityRuleName(service *v1.Service, port v1.ServicePort, sourceAddrPrefix string) string { +func (az *Cloud) getSecurityRuleName(service *v1.Service, port v1.ServicePort, sourceAddrPrefix string, isIPv6 bool) string { + safePrefix := strings.Replace(sourceAddrPrefix, "/", "_", -1) + safePrefix = strings.Replace(safePrefix, ":", ".", -1) // Consider IPv6 address if useSharedSecurityRule(service) { - safePrefix := strings.Replace(sourceAddrPrefix, "/", "_", -1) return fmt.Sprintf("shared-%s-%d-%s", port.Protocol, port.Port, safePrefix) } - safePrefix := strings.Replace(sourceAddrPrefix, "/", "_", -1) rulePrefix := az.getRulePrefix(service) - return fmt.Sprintf("%s-%s-%d-%s", rulePrefix, port.Protocol, port.Port, safePrefix) + name := fmt.Sprintf("%s-%s-%d-%s", rulePrefix, port.Protocol, port.Port, safePrefix) + // TODO: Use getResourceByIPFamily + return name } // This returns a human-readable version of the Service used to tag some resources. @@ -312,18 +330,19 @@ func (az *Cloud) getRulePrefix(service *v1.Service) string { return az.GetLoadBalancerName(context.TODO(), "", service) } -func (az *Cloud) getPublicIPName(clusterName string, service *v1.Service) string { +func (az *Cloud) getPublicIPName(clusterName string, service *v1.Service, isIPv6 bool) (string, error) { + isDualStack := isServiceDualStack(service) pipName := fmt.Sprintf("%s-%s", clusterName, az.GetLoadBalancerName(context.TODO(), clusterName, service)) - if prefixID, ok := service.Annotations[consts.ServiceAnnotationPIPPrefixID]; ok && prefixID != "" { - prefixName, err := getLastSegment(prefixID, "/") - if err != nil { - return pipName + if id := getServicePIPPrefixID(service, isIPv6); id != "" { + id, err := getLastSegment(id, "/") + if err == nil { + pipName = fmt.Sprintf("%s-%s", pipName, id) } - pipName = fmt.Sprintf("%s-%s", pipName, prefixName) } - return pipName + return getResourceByIPFamily(pipName, isDualStack, isIPv6), nil } +// TODO: UT func (az *Cloud) serviceOwnsRule(service *v1.Service, rule string) bool { prefix := az.getRulePrefix(service) return strings.HasPrefix(strings.ToUpper(rule), strings.ToUpper(prefix)) @@ -334,17 +353,17 @@ func (az *Cloud) serviceOwnsRule(service *v1.Service, rule string) bool { // This means the name of the config can be tracked by the service UID. // 2. The secondary services must have their loadBalancer IP set if they want to share the same config as the primary // service. Hence, it can be tracked by the loadBalancer IP. -func (az *Cloud) serviceOwnsFrontendIP(fip network.FrontendIPConfiguration, service *v1.Service, pips *[]network.PublicIPAddress) (bool, bool, error) { +func (az *Cloud) serviceOwnsFrontendIP(fip network.FrontendIPConfiguration, service *v1.Service) (bool, bool, error) { var isPrimaryService bool baseName := az.GetLoadBalancerName(context.TODO(), "", service) - if strings.HasPrefix(to.String(fip.Name), baseName) { + if strings.HasPrefix(pointer.StringDeref(fip.Name, ""), baseName) { klog.V(6).Infof("serviceOwnsFrontendIP: found primary service %s of the frontend IP config %s", service.Name, *fip.Name) isPrimaryService = true return true, isPrimaryService, nil } - loadBalancerIP := getServiceLoadBalancerIP(service) - if loadBalancerIP == "" { + loadBalancerIPs := getServiceLoadBalancerIPs(service) + if len(loadBalancerIPs) == 0 { // it is a must that the secondary services set the loadBalancer IP return false, isPrimaryService, nil } @@ -352,24 +371,26 @@ func (az *Cloud) serviceOwnsFrontendIP(fip network.FrontendIPConfiguration, serv // for external secondary service the public IP address should be checked if !requiresInternalLoadBalancer(service) { pipResourceGroup := az.getPublicIPAddressResourceGroup(service) - pip, err := az.findMatchedPIPByLoadBalancerIP(service, loadBalancerIP, pipResourceGroup, pips) - if err != nil { - klog.Warningf("serviceOwnsFrontendIP: unexpected error when finding match public IP of the service %s with loadBalancerLP %s: %v", service.Name, loadBalancerIP, err) - return false, isPrimaryService, nil - } - - if pip != nil && - pip.ID != nil && - pip.PublicIPAddressPropertiesFormat != nil && - pip.IPAddress != nil && - fip.FrontendIPConfigurationPropertiesFormat != nil && - fip.FrontendIPConfigurationPropertiesFormat.PublicIPAddress != nil { - if strings.EqualFold(to.String(pip.ID), to.String(fip.PublicIPAddress.ID)) { - klog.V(4).Infof("serviceOwnsFrontendIP: found secondary service %s of the frontend IP config %s", service.Name, *fip.Name) + for _, loadBalancerIP := range loadBalancerIPs { + pip, err := az.findMatchedPIPByLoadBalancerIP(service, loadBalancerIP, pipResourceGroup) + if err != nil { + klog.Warningf("serviceOwnsFrontendIP: unexpected error when finding match public IP of the service %s with loadBalancerIP %s: %v", service.Name, loadBalancerIP, err) + return false, isPrimaryService, nil + } - return true, isPrimaryService, nil + if pip != nil && + pip.ID != nil && + pip.PublicIPAddressPropertiesFormat != nil && + pip.PublicIPAddressPropertiesFormat.IPAddress != nil && + fip.FrontendIPConfigurationPropertiesFormat != nil && + fip.FrontendIPConfigurationPropertiesFormat.PublicIPAddress != nil { + if strings.EqualFold(pointer.StringDeref(pip.ID, ""), pointer.StringDeref(fip.PublicIPAddress.ID, "")) { + klog.Infof("serviceOwnsFrontendIP: found secondary service %s of the frontend IP config %s", service.Name, *fip.Name) + return true, isPrimaryService, nil + } } - klog.V(4).Infof("serviceOwnsFrontendIP: the public IP with ID %s is being referenced by other service with public IP address %s", *pip.ID, *pip.IPAddress) + klog.Infof("serviceOwnsFrontendIP: the public IP with ID %s is being referenced by other service with public IP address %s "+ + "OR it is of incorrect IP version", *pip.ID, *pip.IPAddress) } return false, isPrimaryService, nil @@ -380,7 +401,14 @@ func (az *Cloud) serviceOwnsFrontendIP(fip network.FrontendIPConfiguration, serv return false, isPrimaryService, nil } - return strings.EqualFold(*fip.PrivateIPAddress, loadBalancerIP), isPrimaryService, nil + privateIPEquals := false + for _, loadBalancerIP := range loadBalancerIPs { + if strings.EqualFold(*fip.PrivateIPAddress, loadBalancerIP) { + privateIPEquals = true + break + } + } + return privateIPEquals, isPrimaryService, nil } func (az *Cloud) getDefaultFrontendIPConfigName(service *v1.Service) string { @@ -390,8 +418,9 @@ func (az *Cloud) getDefaultFrontendIPConfigName(service *v1.Service) string { ipcName := fmt.Sprintf("%s-%s", baseName, *subnetName) // Azure lb front end configuration name must not exceed 80 characters - if len(ipcName) > consts.FrontendIPConfigNameMaxLength { - ipcName = ipcName[:consts.FrontendIPConfigNameMaxLength] + maxLength := consts.FrontendIPConfigNameMaxLength - consts.IPFamilySuffixLength + if len(ipcName) > maxLength { + ipcName = ipcName[:maxLength] // Cutting the string may result in char like "-" as the string end. // If the last char is not a letter or '_', replace it with "_". if !unicode.IsLetter(rune(ipcName[len(ipcName)-1:][0])) && ipcName[len(ipcName)-1:] != "_" { @@ -454,7 +483,7 @@ func (as *availabilitySet) newVMASCache() (*azcache.TimedCache, error) { return nil, err } - for _, resourceGroup := range allResourceGroups.List() { + for _, resourceGroup := range allResourceGroups.UnsortedList() { allAvailabilitySets, rerr := as.AvailabilitySetsClient.List(context.Background(), resourceGroup) if rerr != nil { klog.Errorf("AvailabilitySetsClient.List failed: %v", rerr) @@ -463,11 +492,11 @@ func (as *availabilitySet) newVMASCache() (*azcache.TimedCache, error) { for i := range allAvailabilitySets { vmas := allAvailabilitySets[i] - if strings.EqualFold(to.String(vmas.Name), "") { + if strings.EqualFold(pointer.StringDeref(vmas.Name, ""), "") { klog.Warning("failed to get the name of the VMAS") continue } - localCache.Store(to.String(vmas.Name), &AvailabilitySetEntry{ + localCache.Store(pointer.StringDeref(vmas.Name, ""), &AvailabilitySetEntry{ VMAS: &vmas, ResourceGroup: resourceGroup, }) @@ -543,7 +572,7 @@ func (as *availabilitySet) GetPowerStatusByNodeName(name string) (powerState str if vm.InstanceView != nil && vm.InstanceView.Statuses != nil { statuses := *vm.InstanceView.Statuses for _, status := range statuses { - state := to.String(status.Code) + state := pointer.StringDeref(status.Code, "") if strings.HasPrefix(state, vmPowerStatePrefix) { return strings.TrimPrefix(state, vmPowerStatePrefix), nil } @@ -566,7 +595,7 @@ func (as *availabilitySet) GetProvisioningStateByNodeName(name string) (provisio return provisioningState, nil } - return to.String(vm.VirtualMachineProperties.ProvisioningState), nil + return pointer.StringDeref(vm.VirtualMachineProperties.ProvisioningState, ""), nil } // GetNodeNameByProviderID gets the node name by provider ID. @@ -612,15 +641,15 @@ func (as *availabilitySet) GetZoneByNodeName(name string) (cloudprovider.Zone, e return cloudprovider.Zone{}, fmt.Errorf("failed to parse zone %q: %w", zones, err) } - failureDomain = as.makeZone(to.String(vm.Location), zoneID) + failureDomain = as.makeZone(pointer.StringDeref(vm.Location, ""), zoneID) } else { // Availability zone is not used for the node, falling back to fault domain. - failureDomain = strconv.Itoa(int(to.Int32(vm.VirtualMachineProperties.InstanceView.PlatformFaultDomain))) + failureDomain = strconv.Itoa(int(pointer.Int32Deref(vm.VirtualMachineProperties.InstanceView.PlatformFaultDomain, 0))) } zone := cloudprovider.Zone{ FailureDomain: strings.ToLower(failureDomain), - Region: strings.ToLower(to.String(vm.Location)), + Region: strings.ToLower(pointer.StringDeref(vm.Location, "")), } return zone, nil } @@ -795,13 +824,13 @@ func (as *availabilitySet) GetNodeVMSetName(node *v1.Node) (string, error) { var asName string for _, vm := range vms { - if strings.EqualFold(to.String(vm.Name), hostName) { - if vm.AvailabilitySet != nil && to.String(vm.AvailabilitySet.ID) != "" { + if strings.EqualFold(pointer.StringDeref(vm.Name, ""), hostName) { + if vm.AvailabilitySet != nil && pointer.StringDeref(vm.AvailabilitySet.ID, "") != "" { klog.V(4).Infof("as.GetNodeVMSetName: found vm %s", hostName) - asName, err = getLastSegment(to.String(vm.AvailabilitySet.ID), "/") + asName, err = getLastSegment(pointer.StringDeref(vm.AvailabilitySet.ID, ""), "/") if err != nil { - klog.Errorf("as.GetNodeVMSetName: failed to get last segment of ID %s: %s", to.String(vm.AvailabilitySet.ID), err) + klog.Errorf("as.GetNodeVMSetName: failed to get last segment of ID %s: %s", pointer.StringDeref(vm.AvailabilitySet.ID, ""), err) return "", err } } @@ -871,7 +900,7 @@ func (as *availabilitySet) getPrimaryInterfaceWithVMSet(nodeName, vmSetName stri // ensure the vm that is supposed to share the primary SLB in the backendpool of the primary SLB if machine.AvailabilitySet != nil { - vmasName, _ := getLastSegment(to.String(machine.AvailabilitySet.ID), "/") + vmasName, _ := getLastSegment(pointer.StringDeref(machine.AvailabilitySet.ID, ""), "/") if strings.EqualFold(as.GetPrimaryVMSetName(), vmSetName) && as.getVMSetNamesSharingPrimarySLB().Has(strings.ToLower(vmasName)) { klog.V(4).Infof("getPrimaryInterfaceWithVMSet: the vm %s in the vmSet %s is supposed to share the primary SLB", nodeName, vmasName) @@ -902,7 +931,7 @@ func (as *availabilitySet) getPrimaryInterfaceWithVMSet(nodeName, vmSetName stri var availabilitySetID string if machine.VirtualMachineProperties != nil && machine.AvailabilitySet != nil { - availabilitySetID = to.String(machine.AvailabilitySet.ID) + availabilitySetID = pointer.StringDeref(machine.AvailabilitySet.ID, "") } return nic, availabilitySetID, nil } @@ -929,7 +958,7 @@ func (as *availabilitySet) EnsureHostInPool(service *v1.Service, nodeName types. } var primaryIPConfig *network.InterfaceIPConfiguration - ipv6 := utilnet.IsIPv6String(service.Spec.ClusterIP) + ipv6 := isBackendPoolIPv6(backendPoolID) if !as.Cloud.ipv6DualStackEnabled && !ipv6 { primaryIPConfig, err = getPrimaryIPConfig(nic) if err != nil { @@ -977,7 +1006,7 @@ func (as *availabilitySet) EnsureHostInPool(service *v1.Service, nodeName types. newBackendPools = append(newBackendPools, network.BackendAddressPool{ - ID: to.StringPtr(backendPoolID), + ID: pointer.String(backendPoolID), }) primaryIPConfig.LoadBalancerBackendAddressPools = &newBackendPools @@ -1039,7 +1068,8 @@ func (as *availabilitySet) EnsureHostsInPool(service *v1.Service, nodes []*v1.No } // EnsureBackendPoolDeleted ensures the loadBalancer backendAddressPools deleted from the specified nodes. -func (as *availabilitySet) EnsureBackendPoolDeleted(service *v1.Service, backendPoolID, vmSetName string, backendAddressPools *[]network.BackendAddressPool, deleteFromVMSet bool) (bool, error) { +// backendPoolIDs are the IDs of the backendpools to be deleted. +func (as *availabilitySet) EnsureBackendPoolDeleted(service *v1.Service, backendPoolIDs []string, vmSetName string, backendAddressPools *[]network.BackendAddressPool, deleteFromVMSet bool) (bool, error) { // Returns nil if backend address pools already deleted. if backendAddressPools == nil { return false, nil @@ -1053,23 +1083,33 @@ func (as *availabilitySet) EnsureBackendPoolDeleted(service *v1.Service, backend ipConfigurationIDs := []string{} for _, backendPool := range *backendAddressPools { - if strings.EqualFold(to.String(backendPool.ID), backendPoolID) && - backendPool.BackendAddressPoolPropertiesFormat != nil && - backendPool.BackendIPConfigurations != nil { - for _, ipConf := range *backendPool.BackendIPConfigurations { - if ipConf.ID == nil { - continue - } + for _, backendPoolID := range backendPoolIDs { + if strings.EqualFold(pointer.StringDeref(backendPool.ID, ""), backendPoolID) { + if backendPool.BackendAddressPoolPropertiesFormat != nil && + backendPool.BackendIPConfigurations != nil { + for _, ipConf := range *backendPool.BackendIPConfigurations { + if ipConf.ID == nil { + continue + } - ipConfigurationIDs = append(ipConfigurationIDs, *ipConf.ID) + ipConfigurationIDs = append(ipConfigurationIDs, *ipConf.ID) + } + } } } + } nicUpdaters := make([]func() error, 0) allErrs := make([]error, 0) var nicUpdated bool + + ipconfigPrefixToNicMap := map[string]network.Interface{} // ipconfig prefix -> nic for i := range ipConfigurationIDs { ipConfigurationID := ipConfigurationIDs[i] + ipConfigIDPrefix := getResourceIDPrefix(ipConfigurationID) + if _, ok := ipconfigPrefixToNicMap[ipConfigIDPrefix]; ok { + continue + } nodeName, _, err := as.GetNodeNameByIPConfigurationID(ipConfigurationID) if err != nil && !errors.Is(err, cloudprovider.InstanceNotFound) { klog.Errorf("Failed to GetNodeNameByIPConfigurationID(%s): %v", ipConfigurationID, err) @@ -1107,38 +1147,44 @@ func (as *availabilitySet) EnsureBackendPoolDeleted(service *v1.Service, backend } if nic.InterfacePropertiesFormat != nil && nic.InterfacePropertiesFormat.IPConfigurations != nil { - newIPConfigs := *nic.IPConfigurations - for j, ipConf := range newIPConfigs { - if !to.Bool(ipConf.Primary) { - continue - } - // found primary ip configuration - if ipConf.LoadBalancerBackendAddressPools != nil { - newLBAddressPools := *ipConf.LoadBalancerBackendAddressPools - for k := len(newLBAddressPools) - 1; k >= 0; k-- { - pool := newLBAddressPools[k] - if strings.EqualFold(to.String(pool.ID), backendPoolID) { + ipconfigPrefixToNicMap[ipConfigIDPrefix] = nic + } + } + for k := range ipconfigPrefixToNicMap { + nic := ipconfigPrefixToNicMap[k] + newIPConfigs := *nic.IPConfigurations + for j, ipConf := range newIPConfigs { + if !pointer.BoolDeref(ipConf.Primary, false) { + continue + } + // found primary ip configuration + if ipConf.LoadBalancerBackendAddressPools != nil { + newLBAddressPools := *ipConf.LoadBalancerBackendAddressPools + for k := len(newLBAddressPools) - 1; k >= 0; k-- { + pool := newLBAddressPools[k] + for _, backendPoolID := range backendPoolIDs { + if strings.EqualFold(pointer.StringDeref(pool.ID, ""), backendPoolID) { newLBAddressPools = append(newLBAddressPools[:k], newLBAddressPools[k+1:]...) break } } - newIPConfigs[j].LoadBalancerBackendAddressPools = &newLBAddressPools } + newIPConfigs[j].LoadBalancerBackendAddressPools = &newLBAddressPools } - nic.IPConfigurations = &newIPConfigs - nicUpdaters = append(nicUpdaters, func() error { - ctx, cancel := getContextWithCancel() - defer cancel() - klog.V(2).Infof("EnsureBackendPoolDeleted begins to CreateOrUpdate for NIC(%s, %s) with backendPoolID %s", as.resourceGroup, to.String(nic.Name), backendPoolID) - rerr := as.InterfacesClient.CreateOrUpdate(ctx, as.ResourceGroup, to.String(nic.Name), nic) - if rerr != nil { - klog.Errorf("EnsureBackendPoolDeleted CreateOrUpdate for NIC(%s, %s) failed with error %v", as.resourceGroup, to.String(nic.Name), rerr.Error()) - return rerr.Error() - } - nicUpdated = true - return nil - }) } + nic.IPConfigurations = &newIPConfigs + nicUpdaters = append(nicUpdaters, func() error { + ctx, cancel := getContextWithCancel() + defer cancel() + klog.V(2).Infof("EnsureBackendPoolDeleted begins to CreateOrUpdate for NIC(%s, %s) with backendPoolIDs %q", as.ResourceGroup, pointer.StringDeref(nic.Name, ""), backendPoolIDs) + rerr := as.InterfacesClient.CreateOrUpdate(ctx, as.ResourceGroup, pointer.StringDeref(nic.Name, ""), nic) + if rerr != nil { + klog.Errorf("EnsureBackendPoolDeleted CreateOrUpdate for NIC(%s, %s) failed with error %v", as.ResourceGroup, pointer.StringDeref(nic.Name, ""), rerr.Error()) + return rerr.Error() + } + nicUpdated = true + return nil + }) } errs := utilerrors.AggregateGoroutines(nicUpdaters...) if errs != nil { @@ -1195,7 +1241,7 @@ func (as *availabilitySet) GetNodeNameByIPConfigurationID(ipConfigurationID stri } vmID := "" if nic.InterfacePropertiesFormat != nil && nic.VirtualMachine != nil { - vmID = to.String(nic.VirtualMachine.ID) + vmID = pointer.StringDeref(nic.VirtualMachine.ID, "") } if vmID == "" { klog.V(2).Infof("GetNodeNameByIPConfigurationID(%s): empty vmID", ipConfigurationID) @@ -1215,7 +1261,7 @@ func (as *availabilitySet) GetNodeNameByIPConfigurationID(ipConfigurationID stri } asID := "" if vm.VirtualMachineProperties != nil && vm.AvailabilitySet != nil { - asID = to.String(vm.AvailabilitySet.ID) + asID = pointer.StringDeref(vm.AvailabilitySet.ID, "") } if asID == "" { return vmName, "", nil @@ -1247,9 +1293,9 @@ func (as *availabilitySet) getAvailabilitySetByNodeName(nodeName string, crt azc if vmas != nil && vmas.AvailabilitySetProperties != nil && vmas.VirtualMachines != nil { for _, vmIDRef := range *vmas.VirtualMachines { if vmIDRef.ID != nil { - matches := vmIDRE.FindStringSubmatch(to.String(vmIDRef.ID)) + matches := vmIDRE.FindStringSubmatch(pointer.StringDeref(vmIDRef.ID, "")) if len(matches) != 2 { - err = fmt.Errorf("invalid vm ID %s", to.String(vmIDRef.ID)) + err = fmt.Errorf("invalid vm ID %s", pointer.StringDeref(vmIDRef.ID, "")) return false } @@ -1294,15 +1340,15 @@ func (as *availabilitySet) GetNodeCIDRMasksByProviderID(providerID string) (int, var ipv4Mask, ipv6Mask int if v4, ok := vmas.Tags[consts.VMSetCIDRIPV4TagKey]; ok && v4 != nil { - ipv4Mask, err = strconv.Atoi(to.String(v4)) + ipv4Mask, err = strconv.Atoi(pointer.StringDeref(v4, "")) if err != nil { - klog.Errorf("GetNodeCIDRMasksByProviderID: error when paring the value of the ipv4 mask size %s: %v", to.String(v4), err) + klog.Errorf("GetNodeCIDRMasksByProviderID: error when paring the value of the ipv4 mask size %s: %v", pointer.StringDeref(v4, ""), err) } } if v6, ok := vmas.Tags[consts.VMSetCIDRIPV6TagKey]; ok && v6 != nil { - ipv6Mask, err = strconv.Atoi(to.String(v6)) + ipv6Mask, err = strconv.Atoi(pointer.StringDeref(v6, "")) if err != nil { - klog.Errorf("GetNodeCIDRMasksByProviderID: error when paring the value of the ipv6 mask size%s: %v", to.String(v6), err) + klog.Errorf("GetNodeCIDRMasksByProviderID: error when paring the value of the ipv6 mask size%s: %v", pointer.StringDeref(v6, ""), err) } } @@ -1310,7 +1356,7 @@ func (as *availabilitySet) GetNodeCIDRMasksByProviderID(providerID string) (int, } // EnsureBackendPoolDeletedFromVMSets ensures the loadBalancer backendAddressPools deleted from the specified VMAS -func (as *availabilitySet) EnsureBackendPoolDeletedFromVMSets(vmasNamesMap map[string]bool, backendPoolID string) error { +func (as *availabilitySet) EnsureBackendPoolDeletedFromVMSets(vmasNamesMap map[string]bool, backendPoolIDs []string) error { return nil } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_storage.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_storage.go index 436cd9859d01..bde20fa51d22 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_storage.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_storage.go @@ -38,10 +38,10 @@ func (az *Cloud) CreateFileShare(ctx context.Context, accountOptions *AccountOpt return "", "", fmt.Errorf("share options is nil") } if accountOptions.ResourceGroup == "" { - accountOptions.ResourceGroup = az.resourceGroup + accountOptions.ResourceGroup = az.ResourceGroup } if accountOptions.SubscriptionID == "" { - accountOptions.SubscriptionID = az.subscriptionID + accountOptions.SubscriptionID = az.SubscriptionID } accountOptions.EnableHTTPSTrafficOnly = true diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_storageaccount.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_storageaccount.go index bbde88ad9c1a..1a0f6b717ac0 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_storageaccount.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_storageaccount.go @@ -21,13 +21,12 @@ import ( "fmt" "strings" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" "github.com/Azure/azure-sdk-for-go/services/privatedns/mgmt/2018-09-01/privatedns" "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2021-09-01/storage" - "github.com/Azure/go-autorest/autorest/to" "k8s.io/klog/v2" + "k8s.io/utils/pointer" "sigs.k8s.io/cloud-provider-azure/pkg/consts" "sigs.k8s.io/cloud-provider-azure/pkg/retry" @@ -36,8 +35,14 @@ import ( // SkipMatchingTag skip account matching tag const SkipMatchingTag = "skip-matching" const LocationGlobal = "global" -const GroupIDFile = "file" -const PrivateDNSZoneName = "privatelink.file.core.windows.net" +const privateDNSZoneNameFmt = "privatelink.%s.%s" + +type StorageType string + +const ( + StorageTypeBlob StorageType = "blob" + StorageTypeFile StorageType = "file" +) // AccountOptions contains the fields which are used to create storage account. type AccountOptions struct { @@ -46,9 +51,11 @@ type AccountOptions struct { EnableHTTPSTrafficOnly bool // indicate whether create new account when Name is empty or when account does not exists CreateAccount bool - EnableLargeFileShare bool CreatePrivateEndpoint bool - DisableFileServiceDeleteRetentionPolicy bool + StorageType StorageType + StorageEndpointSuffix string + DisableFileServiceDeleteRetentionPolicy *bool + EnableLargeFileShare *bool IsHnsEnabled *bool EnableNfsV3 *bool AllowBlobPublicAccess *bool @@ -65,6 +72,9 @@ type AccountOptions struct { SubnetName string AccessTier string MatchTags bool + EnableBlobVersioning *bool + SoftDeleteBlobs int32 + SoftDeleteContainers int32 } type accountWithLocation struct { @@ -93,9 +103,17 @@ func (az *Cloud) getStorageAccounts(ctx context.Context, accountOptions *Account isTaggedWithSkip(acct) && isHnsPropertyEqual(acct, accountOptions) && isEnableNfsV3PropertyEqual(acct, accountOptions) && + isAllowBlobPublicAccessEqual(acct, accountOptions) && + isRequireInfrastructureEncryptionEqual(acct, accountOptions) && + isAllowSharedKeyAccessEqual(acct, accountOptions) && + isAccessTierEqual(acct, accountOptions) && + az.isMultichannelEnabledEqual(ctx, acct, accountOptions) && + az.isDisableFileServiceDeleteRetentionPolicyEqual(ctx, acct, accountOptions) && + az.isEnableBlobDataProtectionEqual(ctx, acct, accountOptions) && isPrivateEndpointAsExpected(acct, accountOptions)) { continue } + accounts = append(accounts, accountWithLocation{Name: *acct.Name, StorageType: string((*acct.Sku).Name), Location: *acct.Location}) } } @@ -160,6 +178,23 @@ func (az *Cloud) EnsureStorageAccount(ctx context.Context, accountOptions *Accou subsID = accountOptions.SubscriptionID } + if location == "" { + location = az.Location + } + + var privateDNSZoneName string + if accountOptions.CreatePrivateEndpoint { + if accountOptions.StorageType == "" { + klog.V(2).Info("set StorageType as file when not specified") + accountOptions.StorageType = StorageTypeFile + } + + if len(accountOptions.StorageEndpointSuffix) == 0 { + accountOptions.StorageEndpointSuffix = az.cloud.Environment.StorageEndpointSuffix + } + privateDNSZoneName = fmt.Sprintf(privateDNSZoneNameFmt, accountOptions.StorageType, accountOptions.StorageEndpointSuffix) + } + if len(accountOptions.Tags) == 0 { accountOptions.Tags = make(map[string]string) } @@ -205,20 +240,20 @@ func (az *Cloud) EnsureStorageAccount(ctx context.Context, accountOptions *Accou } if accountOptions.CreatePrivateEndpoint { - if _, err := az.privatednsclient.Get(ctx, vnetResourceGroup, PrivateDNSZoneName); err != nil { - klog.V(2).Infof("get private dns zone %s returned with %v", PrivateDNSZoneName, err.Error()) + if _, err := az.privatednsclient.Get(ctx, vnetResourceGroup, privateDNSZoneName); err != nil { + klog.V(2).Infof("get private dns zone %s returned with %v", privateDNSZoneName, err.Error()) // Create DNS zone first, this could make sure driver has write permission on vnetResourceGroup - if err := az.createPrivateDNSZone(ctx, vnetResourceGroup); err != nil { - return "", "", fmt.Errorf("create private DNS zone(%s) in resourceGroup(%s): %w", PrivateDNSZoneName, vnetResourceGroup, err) + if err := az.createPrivateDNSZone(ctx, vnetResourceGroup, privateDNSZoneName); err != nil { + return "", "", fmt.Errorf("create private DNS zone(%s) in resourceGroup(%s): %w", privateDNSZoneName, vnetResourceGroup, err) } } // Create virtual link to the private DNS zone - vNetLinkName := accountName + "-vnetlink" - if _, err := az.virtualNetworkLinksClient.Get(ctx, vnetResourceGroup, PrivateDNSZoneName, vNetLinkName); err != nil { - klog.V(2).Infof("get virtual link for vnet(%s) and DNS Zone(%s) returned with %v", vnetName, PrivateDNSZoneName, err.Error()) - if err := az.createVNetLink(ctx, vNetLinkName, vnetResourceGroup, vnetName); err != nil { - return "", "", fmt.Errorf("create virtual link for vnet(%s) and DNS Zone(%s) in resourceGroup(%s): %w", vnetName, PrivateDNSZoneName, vnetResourceGroup, err) + vNetLinkName := vnetName + "-vnetlink" + if _, err := az.virtualNetworkLinksClient.Get(ctx, vnetResourceGroup, privateDNSZoneName, vNetLinkName); err != nil { + klog.V(2).Infof("get virtual link for vnet(%s) and DNS Zone(%s) returned with %v", vnetName, privateDNSZoneName, err.Error()) + if err := az.createVNetLink(ctx, vNetLinkName, vnetResourceGroup, vnetName, privateDNSZoneName); err != nil { + return "", "", fmt.Errorf("create virtual link for vnet(%s) and DNS Zone(%s) in resourceGroup(%s): %w", vnetName, privateDNSZoneName, vnetResourceGroup, err) } } } @@ -248,9 +283,6 @@ func (az *Cloud) EnsureStorageAccount(ctx context.Context, accountOptions *Accou } } - if location == "" { - location = az.Location - } if accountType == "" { accountType = consts.DefaultStorageAccountType } @@ -278,9 +310,13 @@ func (az *Cloud) EnsureStorageAccount(ctx context.Context, accountOptions *Accou Tags: tags, Location: &location} - if accountOptions.EnableLargeFileShare { - klog.V(2).Infof("Enabling LargeFileShare for storage account(%s)", accountName) - cp.AccountPropertiesCreateParameters.LargeFileSharesState = storage.LargeFileSharesStateEnabled + if accountOptions.EnableLargeFileShare != nil { + state := storage.LargeFileSharesStateDisabled + if *accountOptions.EnableLargeFileShare { + state = storage.LargeFileSharesStateEnabled + } + klog.V(2).Infof("enable LargeFileShare(%s) for storage account(%s)", state, accountName) + cp.AccountPropertiesCreateParameters.LargeFileSharesState = state } if accountOptions.AllowBlobPublicAccess != nil { klog.V(2).Infof("set AllowBlobPublicAccess(%v) for storage account(%s)", *accountOptions.AllowBlobPublicAccess, accountName) @@ -292,8 +328,8 @@ func (az *Cloud) EnsureStorageAccount(ctx context.Context, accountOptions *Accou RequireInfrastructureEncryption: accountOptions.RequireInfrastructureEncryption, KeySource: storage.KeySourceMicrosoftStorage, Services: &storage.EncryptionServices{ - File: &storage.EncryptionService{Enabled: to.BoolPtr(true)}, - Blob: &storage.EncryptionService{Enabled: to.BoolPtr(true)}, + File: &storage.EncryptionService{Enabled: pointer.Bool(true)}, + Blob: &storage.EncryptionService{Enabled: pointer.Bool(true)}, }, } } @@ -311,8 +347,8 @@ func (az *Cloud) EnsureStorageAccount(ctx context.Context, accountOptions *Accou }, KeySource: storage.KeySourceMicrosoftKeyvault, Services: &storage.EncryptionServices{ - File: &storage.EncryptionService{Enabled: to.BoolPtr(true)}, - Blob: &storage.EncryptionService{Enabled: to.BoolPtr(true)}, + File: &storage.EncryptionService{Enabled: pointer.Bool(true)}, + Blob: &storage.EncryptionService{Enabled: pointer.Bool(true)}, }, } } @@ -324,7 +360,43 @@ func (az *Cloud) EnsureStorageAccount(ctx context.Context, accountOptions *Accou return "", "", fmt.Errorf("failed to create storage account %s, error: %v", accountName, rerr) } - if accountOptions.DisableFileServiceDeleteRetentionPolicy || to.Bool(accountOptions.IsMultichannelEnabled) { + if pointer.BoolDeref(accountOptions.EnableBlobVersioning, false) || + accountOptions.SoftDeleteBlobs > 0 || + accountOptions.SoftDeleteContainers > 0 { + var blobPolicy, containerPolicy *storage.DeleteRetentionPolicy + var enableBlobVersioning *bool + + if accountOptions.SoftDeleteContainers > 0 { + containerPolicy = &storage.DeleteRetentionPolicy{ + Enabled: pointer.Bool(accountOptions.SoftDeleteContainers > 0), + Days: pointer.Int32(accountOptions.SoftDeleteContainers), + } + } + if accountOptions.SoftDeleteBlobs > 0 { + blobPolicy = &storage.DeleteRetentionPolicy{ + Enabled: pointer.Bool(accountOptions.SoftDeleteBlobs > 0), + Days: pointer.Int32(accountOptions.SoftDeleteBlobs), + } + } + + if accountOptions.EnableBlobVersioning != nil { + enableBlobVersioning = pointer.Bool(*accountOptions.EnableBlobVersioning) + } + + property := storage.BlobServiceProperties{ + BlobServicePropertiesProperties: &storage.BlobServicePropertiesProperties{ + IsVersioningEnabled: enableBlobVersioning, + ContainerDeleteRetentionPolicy: containerPolicy, + DeleteRetentionPolicy: blobPolicy, + }, + } + + if _, err := az.BlobClient.SetServiceProperties(ctx, subsID, resourceGroup, accountName, property); err != nil { + return "", "", fmt.Errorf("failed to set blob service properties for storage account %s, error: %w", accountName, err) + } + } + + if accountOptions.DisableFileServiceDeleteRetentionPolicy != nil || accountOptions.IsMultichannelEnabled != nil { prop, err := az.FileClient.WithSubscriptionID(subsID).GetServiceProperties(ctx, resourceGroup, accountName) if err != nil { return "", "", err @@ -334,13 +406,16 @@ func (az *Cloud) EnsureStorageAccount(ctx context.Context, accountOptions *Accou } prop.FileServicePropertiesProperties.ProtocolSettings = nil prop.FileServicePropertiesProperties.Cors = nil - if accountOptions.DisableFileServiceDeleteRetentionPolicy { - klog.V(2).Infof("disable FileServiceDeleteRetentionPolicy on account(%s), subscription(%s), resource group(%s)", accountName, subsID, resourceGroup) - prop.FileServicePropertiesProperties.ShareDeleteRetentionPolicy = &storage.DeleteRetentionPolicy{Enabled: to.BoolPtr(false)} + if accountOptions.DisableFileServiceDeleteRetentionPolicy != nil { + enable := !*accountOptions.DisableFileServiceDeleteRetentionPolicy + klog.V(2).Infof("set ShareDeleteRetentionPolicy(%v) on account(%s), subscription(%s), resource group(%s)", + enable, accountName, subsID, resourceGroup) + prop.FileServicePropertiesProperties.ShareDeleteRetentionPolicy = &storage.DeleteRetentionPolicy{Enabled: &enable} } - if to.Bool(accountOptions.IsMultichannelEnabled) { + if accountOptions.IsMultichannelEnabled != nil { klog.V(2).Infof("enable SMB Multichannel setting on account(%s), subscription(%s), resource group(%s)", accountName, subsID, resourceGroup) - prop.FileServicePropertiesProperties.ProtocolSettings = &storage.ProtocolSettings{Smb: &storage.SmbSetting{Multichannel: &storage.Multichannel{Enabled: to.BoolPtr(true)}}} + enabled := *accountOptions.IsMultichannelEnabled + prop.FileServicePropertiesProperties.ProtocolSettings = &storage.ProtocolSettings{Smb: &storage.SmbSetting{Multichannel: &storage.Multichannel{Enabled: &enabled}}} } if _, err := az.FileClient.WithSubscriptionID(subsID).SetServiceProperties(ctx, resourceGroup, accountName, prop); err != nil { return "", "", err @@ -351,25 +426,31 @@ func (az *Cloud) EnsureStorageAccount(ctx context.Context, accountOptions *Accou klog.V(2).Infof("set AccessTier(%s) on account(%s), subscription(%s), resource group(%s)", accountOptions.AccessTier, accountName, subsID, resourceGroup) cp.AccountPropertiesCreateParameters.AccessTier = storage.AccessTier(accountOptions.AccessTier) } + } - if accountOptions.CreatePrivateEndpoint { - // Get properties of the storageAccount - storageAccount, err := az.StorageAccountClient.GetProperties(ctx, subsID, resourceGroup, accountName) - if err != nil { - return "", "", fmt.Errorf("Failed to get the properties of storage account(%s), resourceGroup(%s), error: %v", accountName, resourceGroup, err) - } + if accountOptions.CreatePrivateEndpoint { + // Get properties of the storageAccount + storageAccount, err := az.StorageAccountClient.GetProperties(ctx, subsID, resourceGroup, accountName) + if err != nil { + return "", "", fmt.Errorf("failed to get the properties of storage account(%s), resourceGroup(%s), error: %v", accountName, resourceGroup, err) + } - // Create private endpoint - privateEndpointName := accountName + "-pvtendpoint" - if err := az.createPrivateEndpoint(ctx, accountName, storageAccount.ID, privateEndpointName, vnetResourceGroup, vnetName, subnetName, location); err != nil { - return "", "", fmt.Errorf("create private endpoint for storage account(%s), resourceGroup(%s): %w", accountName, vnetResourceGroup, err) - } + // Create private endpoint + privateEndpointName := accountName + "-pvtendpoint" + if accountOptions.StorageType == StorageTypeBlob { + privateEndpointName = privateEndpointName + "-blob" + } + if err := az.createPrivateEndpoint(ctx, accountName, storageAccount.ID, privateEndpointName, vnetResourceGroup, vnetName, subnetName, location, accountOptions.StorageType); err != nil { + return "", "", fmt.Errorf("create private endpoint for storage account(%s), resourceGroup(%s): %w", accountName, vnetResourceGroup, err) + } - // Create dns zone group - dnsZoneGroupName := accountName + "-dnszonegroup" - if err := az.createPrivateDNSZoneGroup(ctx, dnsZoneGroupName, privateEndpointName, vnetResourceGroup, vnetName); err != nil { - return "", "", fmt.Errorf("create private DNS zone group - privateEndpoint(%s), vNetName(%s), resourceGroup(%s): %w", privateEndpointName, vnetName, vnetResourceGroup, err) - } + // Create dns zone group + dnsZoneGroupName := accountName + "-dnszonegroup" + if accountOptions.StorageType == StorageTypeBlob { + dnsZoneGroupName = dnsZoneGroupName + "-blob" + } + if err := az.createPrivateDNSZoneGroup(ctx, dnsZoneGroupName, privateEndpointName, vnetResourceGroup, vnetName, privateDNSZoneName); err != nil { + return "", "", fmt.Errorf("create private DNS zone group - privateEndpoint(%s), vNetName(%s), resourceGroup(%s): %w", privateEndpointName, vnetName, vnetResourceGroup, err) } } @@ -382,7 +463,7 @@ func (az *Cloud) EnsureStorageAccount(ctx context.Context, accountOptions *Accou return accountName, accountKey, nil } -func (az *Cloud) createPrivateEndpoint(ctx context.Context, accountName string, accountID *string, privateEndpointName, vnetResourceGroup, vnetName, subnetName, location string) error { +func (az *Cloud) createPrivateEndpoint(ctx context.Context, accountName string, accountID *string, privateEndpointName, vnetResourceGroup, vnetName, subnetName, location string, storageType StorageType) error { klog.V(2).Infof("Creating private endpoint(%s) for account (%s)", privateEndpointName, accountName) subnet, _, err := az.getSubnet(vnetName, subnetName) @@ -401,10 +482,13 @@ func (az *Cloud) createPrivateEndpoint(ctx context.Context, accountName string, //Create private endpoint privateLinkServiceConnectionName := accountName + "-pvtsvcconn" + if storageType == StorageTypeBlob { + privateLinkServiceConnectionName = privateLinkServiceConnectionName + "-blob" + } privateLinkServiceConnection := network.PrivateLinkServiceConnection{ Name: &privateLinkServiceConnectionName, PrivateLinkServiceConnectionProperties: &network.PrivateLinkServiceConnectionProperties{ - GroupIds: &[]string{GroupIDFile}, + GroupIds: &[]string{string(storageType)}, PrivateLinkServiceID: accountID, }, } @@ -417,13 +501,13 @@ func (az *Cloud) createPrivateEndpoint(ctx context.Context, accountName string, return az.privateendpointclient.CreateOrUpdate(ctx, vnetResourceGroup, privateEndpointName, privateEndpoint, "", true).Error() } -func (az *Cloud) createPrivateDNSZone(ctx context.Context, vnetResourceGroup string) error { - klog.V(2).Infof("Creating private dns zone(%s) in resourceGroup (%s)", PrivateDNSZoneName, vnetResourceGroup) +func (az *Cloud) createPrivateDNSZone(ctx context.Context, vnetResourceGroup, privateDNSZoneName string) error { + klog.V(2).Infof("Creating private dns zone(%s) in resourceGroup (%s)", privateDNSZoneName, vnetResourceGroup) location := LocationGlobal privateDNSZone := privatedns.PrivateZone{Location: &location} - if err := az.privatednsclient.CreateOrUpdate(ctx, vnetResourceGroup, PrivateDNSZoneName, privateDNSZone, "", true); err != nil { + if err := az.privatednsclient.CreateOrUpdate(ctx, vnetResourceGroup, privateDNSZoneName, privateDNSZone, "", true); err != nil { if strings.Contains(err.Error().Error(), "exists already") { - klog.V(2).Infof("private dns zone(%s) in resourceGroup (%s) already exists", PrivateDNSZoneName, vnetResourceGroup) + klog.V(2).Infof("private dns zone(%s) in resourceGroup (%s) already exists", privateDNSZoneName, vnetResourceGroup) return nil } return err.Error() @@ -431,25 +515,24 @@ func (az *Cloud) createPrivateDNSZone(ctx context.Context, vnetResourceGroup str return nil } -func (az *Cloud) createVNetLink(ctx context.Context, vNetLinkName, vnetResourceGroup, vnetName string) error { - klog.V(2).Infof("Creating virtual link for vnet(%s) and DNS Zone(%s) in resourceGroup(%s)", vNetLinkName, PrivateDNSZoneName, vnetResourceGroup) +func (az *Cloud) createVNetLink(ctx context.Context, vNetLinkName, vnetResourceGroup, vnetName, privateDNSZoneName string) error { + klog.V(2).Infof("Creating virtual link for vnet(%s) and DNS Zone(%s) in resourceGroup(%s)", vNetLinkName, privateDNSZoneName, vnetResourceGroup) location := LocationGlobal vnetID := fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualNetworks/%s", az.SubscriptionID, vnetResourceGroup, vnetName) parameters := privatedns.VirtualNetworkLink{ Location: &location, VirtualNetworkLinkProperties: &privatedns.VirtualNetworkLinkProperties{ VirtualNetwork: &privatedns.SubResource{ID: &vnetID}, - RegistrationEnabled: to.BoolPtr(true)}, + RegistrationEnabled: pointer.Bool(false)}, } - return az.virtualNetworkLinksClient.CreateOrUpdate(ctx, vnetResourceGroup, PrivateDNSZoneName, vNetLinkName, parameters, "", false).Error() + return az.virtualNetworkLinksClient.CreateOrUpdate(ctx, vnetResourceGroup, privateDNSZoneName, vNetLinkName, parameters, "", false).Error() } -func (az *Cloud) createPrivateDNSZoneGroup(ctx context.Context, dnsZoneGroupName, privateEndpointName, vnetResourceGroup, vnetName string) error { +func (az *Cloud) createPrivateDNSZoneGroup(ctx context.Context, dnsZoneGroupName, privateEndpointName, vnetResourceGroup, vnetName, privateDNSZoneName string) error { klog.V(2).Infof("Creating private DNS zone group(%s) with privateEndpoint(%s), vNetName(%s), resourceGroup(%s)", dnsZoneGroupName, privateEndpointName, vnetName, vnetResourceGroup) - privateDNSZoneID := fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/privateDnsZones/%s", az.SubscriptionID, vnetResourceGroup, PrivateDNSZoneName) - dnsZoneName := PrivateDNSZoneName + privateDNSZoneID := fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/privateDnsZones/%s", az.SubscriptionID, vnetResourceGroup, privateDNSZoneName) privateDNSZoneConfig := network.PrivateDNSZoneConfig{ - Name: &dnsZoneName, + Name: &privateDNSZoneName, PrivateDNSZonePropertiesFormat: &network.PrivateDNSZonePropertiesFormat{ PrivateDNSZoneID: &privateDNSZoneID}, } @@ -540,7 +623,7 @@ func AreVNetRulesEqual(account storage.Account, accountOptions *AccountOptions) found := false for _, subnetID := range accountOptions.VirtualNetworkResourceIDs { for _, rule := range *account.AccountProperties.NetworkRuleSet.VirtualNetworkRules { - if strings.EqualFold(to.String(rule.VirtualNetworkResourceID), subnetID) && rule.Action == storage.ActionAllow { + if strings.EqualFold(pointer.StringDeref(rule.VirtualNetworkResourceID, ""), subnetID) && rule.Action == storage.ActionAllow { found = true break } @@ -554,10 +637,13 @@ func AreVNetRulesEqual(account storage.Account, accountOptions *AccountOptions) } func isLargeFileSharesPropertyEqual(account storage.Account, accountOptions *AccountOptions) bool { - if account.Sku.Tier != storage.SkuTier(compute.StorageAccountTypesPremiumLRS) && accountOptions.EnableLargeFileShare && (len(account.LargeFileSharesState) == 0 || account.LargeFileSharesState == storage.LargeFileSharesStateDisabled) { - return false + if accountOptions.EnableLargeFileShare == nil { + return true } - return true + if *accountOptions.EnableLargeFileShare { + return account.LargeFileSharesState == storage.LargeFileSharesStateEnabled + } + return account.LargeFileSharesState == "" || account.LargeFileSharesState == storage.LargeFileSharesStateDisabled } func isTaggedWithSkip(account storage.Account) bool { @@ -597,11 +683,11 @@ func isTagsEqual(account storage.Account, accountOptions *AccountOptions) bool { } func isHnsPropertyEqual(account storage.Account, accountOptions *AccountOptions) bool { - return to.Bool(account.IsHnsEnabled) == to.Bool(accountOptions.IsHnsEnabled) + return pointer.BoolDeref(accountOptions.IsHnsEnabled, false) == pointer.BoolDeref(account.IsHnsEnabled, false) } func isEnableNfsV3PropertyEqual(account storage.Account, accountOptions *AccountOptions) bool { - return to.Bool(account.EnableNfsV3) == to.Bool(accountOptions.EnableNfsV3) + return pointer.BoolDeref(accountOptions.EnableNfsV3, false) == pointer.BoolDeref(account.EnableNfsV3, false) } func isPrivateEndpointAsExpected(account storage.Account, accountOptions *AccountOptions) bool { @@ -613,3 +699,128 @@ func isPrivateEndpointAsExpected(account storage.Account, accountOptions *Accoun } return false } + +func isAllowBlobPublicAccessEqual(account storage.Account, accountOptions *AccountOptions) bool { + return pointer.BoolDeref(accountOptions.AllowBlobPublicAccess, false) == pointer.BoolDeref(account.AllowBlobPublicAccess, false) +} + +func isRequireInfrastructureEncryptionEqual(account storage.Account, accountOptions *AccountOptions) bool { + requireInfraEncryption := pointer.BoolDeref(accountOptions.RequireInfrastructureEncryption, false) + if account.Encryption == nil { + return !requireInfraEncryption + } + return requireInfraEncryption == pointer.BoolDeref(account.Encryption.RequireInfrastructureEncryption, false) +} + +func isAllowSharedKeyAccessEqual(account storage.Account, accountOptions *AccountOptions) bool { + return pointer.BoolDeref(accountOptions.AllowSharedKeyAccess, false) == pointer.BoolDeref(account.AllowSharedKeyAccess, false) +} + +func isAccessTierEqual(account storage.Account, accountOptions *AccountOptions) bool { + if accountOptions.AccessTier == "" { + return true + } + return accountOptions.AccessTier == string(account.AccessTier) +} + +func (az *Cloud) isMultichannelEnabledEqual(ctx context.Context, account storage.Account, accountOptions *AccountOptions) bool { + if accountOptions.IsMultichannelEnabled == nil { + return true + } + + if account.Name == nil { + klog.Warningf("account.Name under resource group(%s) is nil", accountOptions.ResourceGroup) + return false + } + + prop, err := az.FileClient.WithSubscriptionID(accountOptions.SubscriptionID).GetServiceProperties(ctx, accountOptions.ResourceGroup, *account.Name) + if err != nil { + klog.Warningf("GetServiceProperties(%s) under resource group(%s) failed with %v", *account.Name, accountOptions.ResourceGroup, err) + return false + } + + if prop.FileServicePropertiesProperties == nil || + prop.FileServicePropertiesProperties.ProtocolSettings == nil || + prop.FileServicePropertiesProperties.ProtocolSettings.Smb == nil || + prop.FileServicePropertiesProperties.ProtocolSettings.Smb.Multichannel == nil { + return !*accountOptions.IsMultichannelEnabled + } + + return *accountOptions.IsMultichannelEnabled == pointer.BoolDeref(prop.FileServicePropertiesProperties.ProtocolSettings.Smb.Multichannel.Enabled, false) +} + +func (az *Cloud) isDisableFileServiceDeleteRetentionPolicyEqual(ctx context.Context, account storage.Account, accountOptions *AccountOptions) bool { + if accountOptions.DisableFileServiceDeleteRetentionPolicy == nil { + return true + } + + if account.Name == nil { + klog.Warningf("account.Name under resource group(%s) is nil", accountOptions.ResourceGroup) + return false + } + + prop, err := az.FileClient.WithSubscriptionID(accountOptions.SubscriptionID).GetServiceProperties(ctx, accountOptions.ResourceGroup, *account.Name) + if err != nil { + klog.Warningf("GetServiceProperties(%s) under resource group(%s) failed with %v", *account.Name, accountOptions.ResourceGroup, err) + return false + } + + if prop.FileServicePropertiesProperties == nil || + prop.FileServicePropertiesProperties.ShareDeleteRetentionPolicy == nil || + prop.FileServicePropertiesProperties.ShareDeleteRetentionPolicy.Enabled == nil { + // by default, ShareDeleteRetentionPolicy.Enabled is true if it's nil + return !*accountOptions.DisableFileServiceDeleteRetentionPolicy + } + + return *accountOptions.DisableFileServiceDeleteRetentionPolicy != *prop.FileServicePropertiesProperties.ShareDeleteRetentionPolicy.Enabled +} + +func (az *Cloud) isEnableBlobDataProtectionEqual(ctx context.Context, account storage.Account, accountOptions *AccountOptions) bool { + if accountOptions.SoftDeleteBlobs == 0 && + accountOptions.SoftDeleteContainers == 0 && + accountOptions.EnableBlobVersioning == nil { + return true + } + + property, err := az.BlobClient.GetServiceProperties(ctx, accountOptions.SubscriptionID, accountOptions.ResourceGroup, *account.Name) + if err != nil { + klog.Warningf("GetServiceProperties failed for account %s, err: %v", *account.Name, err) + return false + } + + return isSoftDeleteBlobsEqual(property, accountOptions) && + isSoftDeleteContainersEqual(property, accountOptions) && + isEnableBlobVersioningEqual(property, accountOptions) +} + +func isSoftDeleteBlobsEqual(property storage.BlobServiceProperties, accountOptions *AccountOptions) bool { + wantEnable := accountOptions.SoftDeleteBlobs > 0 + actualEnable := property.DeleteRetentionPolicy != nil && + pointer.BoolDeref(property.DeleteRetentionPolicy.Enabled, false) + if wantEnable != actualEnable { + return false + } + if !actualEnable { + return true + } + + return accountOptions.SoftDeleteBlobs == pointer.Int32Deref(property.DeleteRetentionPolicy.Days, 0) +} + +func isSoftDeleteContainersEqual(property storage.BlobServiceProperties, accountOptions *AccountOptions) bool { + wantEnable := accountOptions.SoftDeleteContainers > 0 + actualEnable := property.ContainerDeleteRetentionPolicy != nil && + pointer.BoolDeref(property.ContainerDeleteRetentionPolicy.Enabled, false) + if wantEnable != actualEnable { + return false + } + if !actualEnable { + return true + } + + return accountOptions.SoftDeleteContainers == pointer.Int32Deref(property.ContainerDeleteRetentionPolicy.Days, 0) +} + +func isEnableBlobVersioningEqual(property storage.BlobServiceProperties, accountOptions *AccountOptions) bool { + return pointer.BoolDeref(accountOptions.EnableBlobVersioning, false) == pointer.BoolDeref(property.IsVersioningEnabled, false) +} diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_utils.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_utils.go index e3542f35c914..3922659bf680 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_utils.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_utils.go @@ -23,20 +23,20 @@ import ( "strings" "sync" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" - "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/klog/v2" utilnet "k8s.io/utils/net" + "k8s.io/utils/pointer" azcache "sigs.k8s.io/cloud-provider-azure/pkg/cache" "sigs.k8s.io/cloud-provider-azure/pkg/consts" ) var strToExtendedLocationType = map[string]network.ExtendedLocationTypes{ - "edgezone": network.ExtendedLocationTypesEdgeZone, + "edgezone": network.EdgeZone, } // lockMap used to lock on entries @@ -56,12 +56,13 @@ func newLockMap() *lockMap { func (lm *lockMap) LockEntry(entry string) { lm.Lock() // check if entry does not exists, then add entry - if _, exists := lm.mutexMap[entry]; !exists { - lm.addEntry(entry) + mutex, exists := lm.mutexMap[entry] + if !exists { + mutex = &sync.Mutex{} + lm.mutexMap[entry] = mutex } - lm.Unlock() - lm.lockEntry(entry) + mutex.Lock() } // UnlockEntry release the lock associated with the specific entry @@ -69,22 +70,11 @@ func (lm *lockMap) UnlockEntry(entry string) { lm.Lock() defer lm.Unlock() - if _, exists := lm.mutexMap[entry]; !exists { + mutex, exists := lm.mutexMap[entry] + if !exists { return } - lm.unlockEntry(entry) -} - -func (lm *lockMap) addEntry(entry string) { - lm.mutexMap[entry] = &sync.Mutex{} -} - -func (lm *lockMap) lockEntry(entry string) { - lm.mutexMap[entry].Lock() -} - -func (lm *lockMap) unlockEntry(entry string) { - lm.mutexMap[entry].Unlock() + mutex.Unlock() } func getContextWithCancel() (context.Context, context.CancelFunc) { @@ -116,7 +106,7 @@ func parseTags(tags string, tagsMap map[string]string) map[string]*string { klog.Warning("parseTags: empty key, ignoring this key-value pair") continue } - formatted[k] = to.StringPtr(v) + formatted[k] = pointer.String(v) } } @@ -132,7 +122,7 @@ func parseTags(tags string, tagsMap map[string]string) map[string]*string { klog.V(4).Infof("parseTags: found identical keys: %s from tags and %s from tagsMap (case-insensitive), %s will replace %s", k, key, key, k) delete(formatted, k) } - formatted[key] = to.StringPtr(value) + formatted[key] = pointer.String(value) } } @@ -160,7 +150,7 @@ func (az *Cloud) reconcileTags(currentTagsOnResource, newTags map[string]*string } for _, systemTag := range systemTags { - systemTagsMap[systemTag] = to.StringPtr("") + systemTagsMap[systemTag] = pointer.String("") } } @@ -171,7 +161,7 @@ func (az *Cloud) reconcileTags(currentTagsOnResource, newTags map[string]*string if !found { currentTagsOnResource[k] = v changed = true - } else if !strings.EqualFold(to.String(v), to.String(currentTagsOnResource[key])) { + } else if !strings.EqualFold(pointer.StringDeref(v, ""), pointer.StringDeref(currentTagsOnResource[key], "")) { currentTagsOnResource[key] = v changed = true } @@ -182,6 +172,7 @@ func (az *Cloud) reconcileTags(currentTagsOnResource, newTags map[string]*string for k := range currentTagsOnResource { if _, ok := newTags[k]; !ok { if found, _ := findKeyInMapCaseInsensitive(systemTagsMap, k); !found { + klog.V(2).Infof("reconcileTags: delete tag %s: %s", k, pointer.StringDeref(currentTagsOnResource[k], "")) delete(currentTagsOnResource, k) changed = true } @@ -192,7 +183,7 @@ func (az *Cloud) reconcileTags(currentTagsOnResource, newTags map[string]*string return currentTagsOnResource, changed } -func (az *Cloud) getVMSetNamesSharingPrimarySLB() sets.String { +func (az *Cloud) getVMSetNamesSharingPrimarySLB() sets.Set[string] { vmSetNames := make([]string, 0) if az.NodePoolsWithoutDedicatedSLB != "" { vmSetNames = strings.Split(az.Config.NodePoolsWithoutDedicatedSLB, consts.VMSetNamesSharingPrimarySLBDelimiter) @@ -201,7 +192,7 @@ func (az *Cloud) getVMSetNamesSharingPrimarySLB() sets.String { } } - return sets.NewString(vmSetNames...) + return sets.New(vmSetNames...) } func getExtendedLocationTypeFromString(extendedLocationType string) network.ExtendedLocationTypes { @@ -209,7 +200,7 @@ func getExtendedLocationTypeFromString(extendedLocationType string) network.Exte if val, ok := strToExtendedLocationType[extendedLocationType]; ok { return val } - return network.ExtendedLocationTypesEdgeZone + return network.EdgeZone } func getServiceAdditionalPublicIPs(service *v1.Service) ([]string, error) { @@ -237,11 +228,10 @@ func getServiceAdditionalPublicIPs(service *v1.Service) ([]string, error) { return result, nil } -func getNodePrivateIPAddress(service *v1.Service, node *v1.Node) string { - isIPV6SVC := utilnet.IsIPv6String(service.Spec.ClusterIP) +func getNodePrivateIPAddress(node *v1.Node, isIPv6 bool) string { for _, nodeAddress := range node.Status.Addresses { if strings.EqualFold(string(nodeAddress.Type), string(v1.NodeInternalIP)) && - utilnet.IsIPv6String(nodeAddress.Address) == isIPV6SVC { + utilnet.IsIPv6String(nodeAddress.Address) == isIPv6 { klog.V(6).Infof("getNodePrivateIPAddress: node %s, ip %s", node.Name, nodeAddress.Address) return nodeAddress.Address } @@ -289,11 +279,11 @@ func sameContentInSlices(s1 []string, s2 []string) bool { func removeDuplicatedSecurityRules(rules []network.SecurityRule) []network.SecurityRule { ruleNames := make(map[string]bool) for i := len(rules) - 1; i >= 0; i-- { - if _, ok := ruleNames[to.String(rules[i].Name)]; ok { - klog.Warningf("Found duplicated rule %s, will be removed.", to.String(rules[i].Name)) + if _, ok := ruleNames[pointer.StringDeref(rules[i].Name, "")]; ok { + klog.Warningf("Found duplicated rule %s, will be removed.", pointer.StringDeref(rules[i].Name, "")) rules = append(rules[:i], rules[i+1:]...) } - ruleNames[to.String(rules[i].Name)] = true + ruleNames[pointer.StringDeref(rules[i].Name, "")] = true } return rules } @@ -338,3 +328,205 @@ func isNodeInVMSSVMCache(nodeName string, vmssVMCache *azcache.TimedCache) bool return isInCache } + +func extractVmssVMName(name string) (string, string, error) { + split := strings.SplitAfter(name, consts.VMSSNameSeparator) + if len(split) < 2 { + klog.V(3).Infof("Failed to extract vmssVMName %q", name) + return "", "", ErrorNotVmssInstance + } + + ssName := strings.Join(split[0:len(split)-1], "") + // removing the trailing `vmssNameSeparator` since we used SplitAfter + ssName = ssName[:len(ssName)-1] + instanceID := split[len(split)-1] + return ssName, instanceID, nil +} + +// isServiceDualStack checks if a Service is dual-stack or not. +func isServiceDualStack(svc *v1.Service) bool { + return len(svc.Spec.IPFamilies) == 2 +} + +// getIPFamiliesEnabled checks if IPv4, IPv6 are enabled according to svc.Spec.IPFamilies. +func getIPFamiliesEnabled(svc *v1.Service) (v4Enabled bool, v6Enabled bool) { + for _, ipFamily := range svc.Spec.IPFamilies { + if ipFamily == v1.IPv4Protocol { + v4Enabled = true + } else if ipFamily == v1.IPv6Protocol { + v6Enabled = true + } + } + return +} + +// getServiceLoadBalancerIP retrieves LB IP from IPv4 annotation, then IPv6 annotation, then service.Spec.LoadBalancerIP. +func getServiceLoadBalancerIP(service *v1.Service, isIPv6 bool) string { + if service == nil { + return "" + } + + if ip, ok := service.Annotations[consts.ServiceAnnotationLoadBalancerIPDualStack[isIPv6]]; ok && ip != "" { + return ip + } + + // Retrieve LB IP from service.Spec.LoadBalancerIP (will be deprecated) + svcLBIP := service.Spec.LoadBalancerIP + if (net.ParseIP(svcLBIP).To4() != nil && !isIPv6) || + (net.ParseIP(svcLBIP).To4() == nil && isIPv6) { + return svcLBIP + } + return "" +} + +func getServiceLoadBalancerIPs(service *v1.Service) []string { + if service == nil { + return []string{} + } + + ips := []string{} + if ip, ok := service.Annotations[consts.ServiceAnnotationLoadBalancerIPDualStack[false]]; ok && ip != "" { + ips = append(ips, ip) + } + if ip, ok := service.Annotations[consts.ServiceAnnotationLoadBalancerIPDualStack[true]]; ok && ip != "" { + ips = append(ips, ip) + } + if len(ips) != 0 { + return ips + } + + lbIP := service.Spec.LoadBalancerIP + if lbIP != "" { + ips = append(ips, lbIP) + } + + return ips +} + +// setServiceLoadBalancerIP sets LB IP to a Service +func setServiceLoadBalancerIP(service *v1.Service, ip string) { + if service.Annotations == nil { + service.Annotations = map[string]string{} + } + isIPv6 := net.ParseIP(ip).To4() == nil + service.Annotations[consts.ServiceAnnotationLoadBalancerIPDualStack[isIPv6]] = ip +} + +func getServicePIPName(service *v1.Service, isIPv6 bool) string { + if service == nil { + return "" + } + + if !isServiceDualStack(service) { + return service.Annotations[consts.ServiceAnnotationPIPNameDualStack[false]] + } + + return service.Annotations[consts.ServiceAnnotationPIPNameDualStack[isIPv6]] +} + +func getServicePIPPrefixID(service *v1.Service, isIPv6 bool) string { + if service == nil { + return "" + } + + if !isServiceDualStack(service) { + return service.Annotations[consts.ServiceAnnotationPIPPrefixIDDualStack[false]] + } + + return service.Annotations[consts.ServiceAnnotationPIPPrefixIDDualStack[isIPv6]] +} + +// getResourceByIPFamily returns the resource name of with IPv6 suffix when +// it is a dual-stack Service and the resource is of IPv6. +// NOTICE: For PIPs of IPv6 Services created with CCM v1.27.1, after the CCM is upgraded, +// the old PIPs will be recreated. +func getResourceByIPFamily(resource string, isDualStack, isIPv6 bool) string { + if isDualStack && isIPv6 { + return fmt.Sprintf("%s-%s", resource, v6Suffix) + } + return resource +} + +// isFIPIPv6 checks if the frontend IP configuration is of IPv6. +func (az *Cloud) isFIPIPv6(fip *network.FrontendIPConfiguration, pipResourceGroup string, isInternal bool) (isIPv6 bool, err error) { + pips, err := az.listPIP(pipResourceGroup, azcache.CacheReadTypeDefault) + if err != nil { + return false, fmt.Errorf("isFIPIPv6: failed to list pip: %w", err) + } + if isInternal { + if fip.FrontendIPConfigurationPropertiesFormat != nil { + if fip.FrontendIPConfigurationPropertiesFormat.PrivateIPAddressVersion != "" { + return fip.FrontendIPConfigurationPropertiesFormat.PrivateIPAddressVersion == network.IPv6, nil + } + return net.ParseIP(pointer.StringDeref(fip.FrontendIPConfigurationPropertiesFormat.PrivateIPAddress, "")).To4() == nil, nil + } + klog.Errorf("Checking IP Family of frontend IP configuration %q of internal Service but its"+ + " FrontendIPConfigurationPropertiesFormat is nil. It's considered to be IPv4", + pointer.StringDeref(fip.Name, "")) + return + } + var fipPIPID string + if fip.FrontendIPConfigurationPropertiesFormat != nil && fip.FrontendIPConfigurationPropertiesFormat.PublicIPAddress != nil { + fipPIPID = pointer.StringDeref(fip.FrontendIPConfigurationPropertiesFormat.PublicIPAddress.ID, "") + } + for _, pip := range pips { + id := pointer.StringDeref(pip.ID, "") + if !strings.EqualFold(fipPIPID, id) { + continue + } + if pip.PublicIPAddressPropertiesFormat != nil { + // First check PublicIPAddressVersion, then IPAddress + if pip.PublicIPAddressPropertiesFormat.PublicIPAddressVersion == network.IPv6 || + net.ParseIP(pointer.StringDeref(pip.PublicIPAddressPropertiesFormat.IPAddress, "")).To4() == nil { + isIPv6 = true + break + } + } + break + } + return isIPv6, nil +} + +// getResourceIDPrefix returns a substring from the provided one between beginning and the last "/". +func getResourceIDPrefix(id string) string { + idx := strings.LastIndexByte(id, '/') + if idx == -1 { + return id // Should not happen + } + return id[:idx] +} + +func getLBNameFromBackendPoolID(backendPoolID string) (string, error) { + matches := backendPoolIDRE.FindStringSubmatch(backendPoolID) + if len(matches) != 2 { + return "", fmt.Errorf("backendPoolID %q is in wrong format", backendPoolID) + } + + return matches[1], nil +} + +func countNICsOnBackendPool(backendPool network.BackendAddressPool) int { + if backendPool.BackendAddressPoolPropertiesFormat == nil || + backendPool.BackendIPConfigurations == nil { + return 0 + } + + return len(*backendPool.BackendIPConfigurations) +} + +func countIPsOnBackendPool(backendPool network.BackendAddressPool) int { + if backendPool.BackendAddressPoolPropertiesFormat == nil || + backendPool.LoadBalancerBackendAddresses == nil { + return 0 + } + + var ipsCount int + for _, loadBalancerBackendAddress := range *backendPool.LoadBalancerBackendAddresses { + if loadBalancerBackendAddress.LoadBalancerBackendAddressPropertiesFormat != nil && + pointer.StringDeref(loadBalancerBackendAddress.IPAddress, "") != "" { + ipsCount++ + } + } + + return ipsCount +} diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmsets.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmsets.go index d829587960b6..f5a883f20456 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmsets.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmsets.go @@ -20,7 +20,7 @@ import ( "context" "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" "github.com/Azure/go-autorest/autorest/azure" v1 "k8s.io/api/core/v1" @@ -71,9 +71,9 @@ type VMSet interface { // participating in the specified LoadBalancer Backend Pool. EnsureHostInPool(service *v1.Service, nodeName types.NodeName, backendPoolID string, vmSetName string) (string, string, string, *compute.VirtualMachineScaleSetVM, error) // EnsureBackendPoolDeleted ensures the loadBalancer backendAddressPools deleted from the specified nodes. - EnsureBackendPoolDeleted(service *v1.Service, backendPoolID, vmSetName string, backendAddressPools *[]network.BackendAddressPool, deleteFromVMSet bool) (bool, error) + EnsureBackendPoolDeleted(service *v1.Service, backendPoolIDs []string, vmSetName string, backendAddressPools *[]network.BackendAddressPool, deleteFromVMSet bool) (bool, error) //EnsureBackendPoolDeletedFromVMSets ensures the loadBalancer backendAddressPools deleted from the specified VMSS/VMAS - EnsureBackendPoolDeletedFromVMSets(vmSetNamesMap map[string]bool, backendPoolID string) error + EnsureBackendPoolDeletedFromVMSets(vmSetNamesMap map[string]bool, backendPoolIDs []string) error // AttachDisk attaches a disk to vm AttachDisk(ctx context.Context, nodeName types.NodeName, diskMap map[string]*AttachDiskOptions) (*azure.Future, error) @@ -88,6 +88,9 @@ type VMSet interface { // UpdateVM updates a vm UpdateVM(ctx context.Context, nodeName types.NodeName) error + // UpdateVMAsync updates a vm asynchronously + UpdateVMAsync(ctx context.Context, nodeName types.NodeName) (*azure.Future, error) + // GetPowerStatusByNodeName returns the powerState for the specified node. GetPowerStatusByNodeName(name string) (string, error) diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmss.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmss.go index 94b2201577af..6dd2e48e972c 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmss.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmss.go @@ -26,15 +26,14 @@ import ( "sync" "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" - "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" utilerrors "k8s.io/apimachinery/pkg/util/errors" cloudprovider "k8s.io/cloud-provider" "k8s.io/klog/v2" - utilnet "k8s.io/utils/net" + "k8s.io/utils/pointer" azcache "sigs.k8s.io/cloud-provider-azure/pkg/cache" "sigs.k8s.io/cloud-provider-azure/pkg/consts" @@ -284,7 +283,7 @@ func (ss *ScaleSet) GetPowerStatusByNodeName(name string) (powerState string, er if v.InstanceView != nil && v.InstanceView.Statuses != nil { statuses := *v.InstanceView.Statuses for _, status := range statuses { - state := to.String(status.Code) + state := pointer.StringDeref(status.Code, "") if strings.HasPrefix(state, vmPowerStatePrefix) { return strings.TrimPrefix(state, vmPowerStatePrefix), nil } @@ -323,7 +322,7 @@ func (ss *ScaleSet) GetProvisioningStateByNodeName(name string) (provisioningSta return provisioningState, nil } - return to.String(vm.VirtualMachineScaleSetVMProperties.ProvisioningState), nil + return pointer.StringDeref(vm.VirtualMachineScaleSetVMProperties.ProvisioningState, ""), nil } // getCachedVirtualMachineByInstanceID gets scaleSetVMInfo from cache. @@ -373,6 +372,9 @@ func (ss *ScaleSet) getVmssVMByInstanceID(resourceGroup, scaleSetName, instanceI } } if !found || vm == nil { + // There is a corner case that the VM is deleted but the ip configuration is not deleted from the load balancer. + // In this case the cloud provider will keep refreshing the cache to search the VM, and will introduce + // a lot of unnecessary requests to ARM. return nil, cloudprovider.InstanceNotFound } @@ -687,7 +689,7 @@ func (ss *ScaleSet) GetPrivateIPsByNodeName(nodeName string) ([]string, error) { func (ss *ScaleSet) getPrimaryInterfaceID(vm *virtualmachine.VirtualMachine) (string, error) { machine := vm.AsVirtualMachineScaleSetVM() if machine.NetworkProfile == nil || machine.NetworkProfile.NetworkInterfaces == nil { - return "", fmt.Errorf("failed to find the network interfaces for vm %s", to.String(machine.Name)) + return "", fmt.Errorf("failed to find the network interfaces for vm %s", pointer.StringDeref(machine.Name, "")) } if len(*machine.NetworkProfile.NetworkInterfaces) == 1 { @@ -695,12 +697,12 @@ func (ss *ScaleSet) getPrimaryInterfaceID(vm *virtualmachine.VirtualMachine) (st } for _, ref := range *machine.NetworkProfile.NetworkInterfaces { - if to.Bool(ref.Primary) { + if pointer.BoolDeref(ref.Primary, false) { return *ref.ID, nil } } - return "", fmt.Errorf("failed to find a primary nic for the vm. vmname=%q", to.String(machine.Name)) + return "", fmt.Errorf("failed to find a primary nic for the vm. vmname=%q", pointer.StringDeref(machine.Name, "")) } // getVmssMachineID returns the full identifier of a vmss virtual machine. @@ -764,7 +766,7 @@ func (ss *ScaleSet) listScaleSets(resourceGroup string) ([]string, error) { ssNames := make([]string, 0) for _, vmss := range allScaleSets { name := *vmss.Name - if vmss.Sku != nil && to.Int64(vmss.Sku.Capacity) == 0 { + if vmss.Sku != nil && pointer.Int64Deref(vmss.Sku.Capacity, 0) == 0 { klog.V(3).Infof("Capacity of VMSS %q is 0, skipping", name) continue } @@ -1016,8 +1018,8 @@ func (ss *ScaleSet) GetPrimaryInterface(nodeName string) (network.Interface, err return nic, nil } -// getPrimaryNetworkInterfaceConfiguration gets primary network interface configuration for scale set virtual machine. -func (ss *ScaleSet) getPrimaryNetworkInterfaceConfiguration(networkConfigurations []compute.VirtualMachineScaleSetNetworkConfiguration, nodeName string) (*compute.VirtualMachineScaleSetNetworkConfiguration, error) { +// getPrimaryNetworkInterfaceConfiguration gets primary network interface configuration for VMSS VM or VMSS. +func getPrimaryNetworkInterfaceConfiguration(networkConfigurations []compute.VirtualMachineScaleSetNetworkConfiguration, resource string) (*compute.VirtualMachineScaleSetNetworkConfiguration, error) { if len(networkConfigurations) == 1 { return &networkConfigurations[0], nil } @@ -1029,58 +1031,38 @@ func (ss *ScaleSet) getPrimaryNetworkInterfaceConfiguration(networkConfiguration } } - return nil, fmt.Errorf("failed to find a primary network configuration for the scale set VM %q", nodeName) + return nil, fmt.Errorf("failed to find a primary network configuration for the VMSS VM or VMSS %q", resource) } -// getPrimaryNetworkInterfaceConfigurationForScaleSet gets primary network interface configuration for scale set. -func getPrimaryNetworkInterfaceConfigurationForScaleSet(networkConfigurations []compute.VirtualMachineScaleSetNetworkConfiguration, vmssName string) (*compute.VirtualMachineScaleSetNetworkConfiguration, error) { - if len(networkConfigurations) == 1 { - return &networkConfigurations[0], nil - } - - for idx := range networkConfigurations { - networkConfig := &networkConfigurations[idx] - if networkConfig.Primary != nil && *networkConfig.Primary { - return networkConfig, nil - } - } - - return nil, fmt.Errorf("failed to find a primary network configuration for the scale set %q", vmssName) -} - -func getPrimaryIPConfigFromVMSSNetworkConfig(config *compute.VirtualMachineScaleSetNetworkConfiguration) (*compute.VirtualMachineScaleSetIPConfiguration, error) { +func getPrimaryIPConfigFromVMSSNetworkConfig(config *compute.VirtualMachineScaleSetNetworkConfiguration, backendPoolID, resource string) (*compute.VirtualMachineScaleSetIPConfiguration, error) { ipConfigurations := *config.IPConfigurations - if len(ipConfigurations) == 1 { - return &ipConfigurations[0], nil - } - - for idx := range ipConfigurations { - ipConfig := &ipConfigurations[idx] - if ipConfig.Primary != nil && *ipConfig.Primary { - return ipConfig, nil + isIPv6 := isBackendPoolIPv6(backendPoolID) + + if !isIPv6 { + // There should be exactly one primary IP config. + // https://learn.microsoft.com/en-us/azure/virtual-network/ip-services/virtual-network-network-interface-addresses?tabs=nic-address-portal#ip-configurations + if len(ipConfigurations) == 1 { + return &ipConfigurations[0], nil + } + for idx := range ipConfigurations { + ipConfig := &ipConfigurations[idx] + if ipConfig.Primary != nil && *ipConfig.Primary { + return ipConfig, nil + } } - } - - return nil, fmt.Errorf("failed to find a primary IP configuration") -} - -func getConfigForScaleSetByIPFamily(config *compute.VirtualMachineScaleSetNetworkConfiguration, nodeName string, IPv6 bool) (*compute.VirtualMachineScaleSetIPConfiguration, error) { - ipConfigurations := *config.IPConfigurations - - var ipVersion compute.IPVersion - if IPv6 { - ipVersion = compute.IPv6 } else { - ipVersion = compute.IPv4 - } - for idx := range ipConfigurations { - ipConfig := &ipConfigurations[idx] - if ipConfig.PrivateIPAddressVersion == ipVersion { - return ipConfig, nil + // For IPv6 or dualstack service, we need to pick the right IP configuration based on the cluster ip family + // IPv6 configuration is only supported as non-primary, so we need to fetch the ip configuration where the + // privateIPAddressVersion matches the clusterIP family + for idx := range ipConfigurations { + ipConfig := &ipConfigurations[idx] + if ipConfig.PrivateIPAddressVersion == compute.IPv6 { + return ipConfig, nil + } } } - return nil, fmt.Errorf("failed to find a IPconfiguration(IPv6=%v) for the scale set VM %q", IPv6, nodeName) + return nil, fmt.Errorf("failed to find a primary IP configuration (IPv6=%t) for the VMSS VM or VMSS %q", isIPv6, resource) } // EnsureHostInPool ensures the given VM's Primary NIC's Primary IP Configuration is @@ -1137,28 +1119,15 @@ func (ss *ScaleSet) EnsureHostInPool(service *v1.Service, nodeName types.NodeNam } networkInterfaceConfigurations := *vm.VirtualMachineScaleSetVMProperties.NetworkProfileConfiguration.NetworkInterfaceConfigurations - primaryNetworkInterfaceConfiguration, err := ss.getPrimaryNetworkInterfaceConfiguration(networkInterfaceConfigurations, vmName) + primaryNetworkInterfaceConfiguration, err := getPrimaryNetworkInterfaceConfiguration(networkInterfaceConfigurations, vmName) if err != nil { return "", "", "", nil, err } - var primaryIPConfiguration *compute.VirtualMachineScaleSetIPConfiguration - ipv6 := utilnet.IsIPv6String(service.Spec.ClusterIP) // Find primary network interface configuration. - if !ss.Cloud.ipv6DualStackEnabled && !ipv6 { - // Find primary IP configuration. - primaryIPConfiguration, err = getPrimaryIPConfigFromVMSSNetworkConfig(primaryNetworkInterfaceConfiguration) - if err != nil { - return "", "", "", nil, err - } - } else { - // For IPv6 or dualstack service, we need to pick the right IP configuration based on the cluster ip family - // IPv6 configuration is only supported as non-primary, so we need to fetch the ip configuration where the - // privateIPAddressVersion matches the clusterIP family - primaryIPConfiguration, err = getConfigForScaleSetByIPFamily(primaryNetworkInterfaceConfiguration, vmName, ipv6) - if err != nil { - return "", "", "", nil, err - } + primaryIPConfiguration, err := getPrimaryIPConfigFromVMSSNetworkConfig(primaryNetworkInterfaceConfiguration, backendPoolID, vmName) + if err != nil { + return "", "", "", nil, err } // Update primary IP configuration's LoadBalancerBackendAddressPools. @@ -1203,7 +1172,7 @@ func (ss *ScaleSet) EnsureHostInPool(service *v1.Service, nodeName types.NodeNam // Compose a new vmssVM with added backendPoolID. newBackendPools = append(newBackendPools, compute.SubResource{ - ID: to.StringPtr(backendPoolID), + ID: pointer.String(backendPoolID), }) primaryIPConfiguration.LoadBalancerBackendAddressPools = &newBackendPools newVM := &compute.VirtualMachineScaleSetVM{ @@ -1312,24 +1281,14 @@ func (ss *ScaleSet) ensureVMSSInPool(service *v1.Service, nodes []*v1.Node, back continue } vmssNIC := *vmss.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations - primaryNIC, err := getPrimaryNetworkInterfaceConfigurationForScaleSet(vmssNIC, vmssName) + primaryNIC, err := getPrimaryNetworkInterfaceConfiguration(vmssNIC, vmssName) if err != nil { return err } - var primaryIPConfig *compute.VirtualMachineScaleSetIPConfiguration - ipv6 := utilnet.IsIPv6String(service.Spec.ClusterIP) // Find primary network interface configuration. - if !ss.Cloud.ipv6DualStackEnabled && !ipv6 { - // Find primary IP configuration. - primaryIPConfig, err = getPrimaryIPConfigFromVMSSNetworkConfig(primaryNIC) - if err != nil { - return err - } - } else { - primaryIPConfig, err = getConfigForScaleSetByIPFamily(primaryNIC, "", ipv6) - if err != nil { - return err - } + primaryIPConfig, err := getPrimaryIPConfigFromVMSSNetworkConfig(primaryNIC, backendPoolID, vmssName) + if err != nil { + return err } loadBalancerBackendAddressPools := []compute.SubResource{} @@ -1372,7 +1331,7 @@ func (ss *ScaleSet) ensureVMSSInPool(service *v1.Service, nodes []*v1.Node, back // Compose a new vmss with added backendPoolID. loadBalancerBackendAddressPools = append(loadBalancerBackendAddressPools, compute.SubResource{ - ID: to.StringPtr(backendPoolID), + ID: pointer.String(backendPoolID), }) primaryIPConfig.LoadBalancerBackendAddressPools = &loadBalancerBackendAddressPools newVMSS := compute.VirtualMachineScaleSet{ @@ -1583,7 +1542,7 @@ func (ss *ScaleSet) EnsureHostsInPool(service *v1.Service, nodes []*v1.Node, bac // ensureBackendPoolDeletedFromNode ensures the loadBalancer backendAddressPools deleted // from the specified node, which returns (resourceGroup, vmasName, instanceID, vmssVM, error). -func (ss *ScaleSet) ensureBackendPoolDeletedFromNode(nodeName, backendPoolID string) (string, string, string, *compute.VirtualMachineScaleSetVM, error) { +func (ss *ScaleSet) ensureBackendPoolDeletedFromNode(nodeName string, backendPoolIDs []string) (string, string, string, *compute.VirtualMachineScaleSetVM, error) { vm, err := ss.getVmssVM(nodeName, azcache.CacheReadTypeDefault) if err != nil { if errors.Is(err, cloudprovider.InstanceNotFound) { @@ -1596,45 +1555,31 @@ func (ss *ScaleSet) ensureBackendPoolDeletedFromNode(nodeName, backendPoolID str // Find primary network interface configuration. if vm.VirtualMachineScaleSetVMProperties.NetworkProfileConfiguration.NetworkInterfaceConfigurations == nil { - klog.V(4).Infof("EnsureHostInPool: cannot obtain the primary network interface configuration, of vm %s, "+ + klog.V(4).Infof("ensureBackendPoolDeletedFromNode: cannot obtain the primary network interface configuration, of vm %s, "+ "probably because the vm's being deleted", nodeName) return "", "", "", nil, nil } networkInterfaceConfigurations := *vm.VirtualMachineScaleSetVMProperties.NetworkProfileConfiguration.NetworkInterfaceConfigurations - primaryNetworkInterfaceConfiguration, err := ss.getPrimaryNetworkInterfaceConfiguration(networkInterfaceConfigurations, nodeName) - if err != nil { - return "", "", "", nil, err - } - - // Find primary IP configuration. - primaryIPConfiguration, err := getPrimaryIPConfigFromVMSSNetworkConfig(primaryNetworkInterfaceConfiguration) + primaryNetworkInterfaceConfiguration, err := getPrimaryNetworkInterfaceConfiguration(networkInterfaceConfigurations, nodeName) if err != nil { return "", "", "", nil, err } - if primaryIPConfiguration.LoadBalancerBackendAddressPools == nil || len(*primaryIPConfiguration.LoadBalancerBackendAddressPools) == 0 { - return "", "", "", nil, nil - } - // Construct new loadBalancerBackendAddressPools and remove backendAddressPools from primary IP configuration. - existingBackendPools := *primaryIPConfiguration.LoadBalancerBackendAddressPools - newBackendPools := []compute.SubResource{} - foundPool := false - for i := len(existingBackendPools) - 1; i >= 0; i-- { - curPool := existingBackendPools[i] - if strings.EqualFold(backendPoolID, *curPool.ID) { - klog.V(10).Infof("ensureBackendPoolDeletedFromNode gets unwanted backend pool %q for node %s", backendPoolID, nodeName) - foundPool = true - newBackendPools = append(existingBackendPools[:i], existingBackendPools[i+1:]...) + foundTotal := false + for _, backendPoolID := range backendPoolIDs { + found, err := deleteBackendPoolFromIPConfig("ensureBackendPoolDeletedFromNode", backendPoolID, nodeName, primaryNetworkInterfaceConfiguration) + if err != nil { + return "", "", "", nil, err + } + if found { + foundTotal = true } } - - // Pool not found, assume it has been already removed. - if !foundPool { + if !foundTotal { return "", "", "", nil, nil } // Compose a new vmssVM with added backendPoolID. - primaryIPConfiguration.LoadBalancerBackendAddressPools = &newBackendPools newVM := &compute.VirtualMachineScaleSetVM{ Location: &vm.Location, VirtualMachineScaleSetVMProperties: &compute.VirtualMachineScaleSetVMProperties{ @@ -1704,7 +1649,7 @@ func getScaleSetAndResourceGroupNameByIPConfigurationID(ipConfigurationID string return scaleSetName, resourceGroup, nil } -func (ss *ScaleSet) ensureBackendPoolDeletedFromVMSS(backendPoolID, vmSetName string) error { +func (ss *ScaleSet) ensureBackendPoolDeletedFromVMSS(backendPoolIDs []string, vmSetName string) error { if !ss.useStandardLoadBalancer() { found := false @@ -1717,14 +1662,14 @@ func (ss *ScaleSet) ensureBackendPoolDeletedFromVMSS(backendPoolID, vmSetName st vmssUniformMap.Range(func(key, value interface{}) bool { vmssEntry := value.(*VMSSEntry) - if to.String(vmssEntry.VMSS.Name) == vmSetName { + if pointer.StringDeref(vmssEntry.VMSS.Name, "") == vmSetName { found = true return false } return true }) if found { - return ss.ensureBackendPoolDeletedFromVmssUniform(backendPoolID, vmSetName) + return ss.ensureBackendPoolDeletedFromVmssUniform(backendPoolIDs, vmSetName) } flexScaleSet := ss.flexScaleSet.(*FlexScaleSet) @@ -1736,7 +1681,7 @@ func (ss *ScaleSet) ensureBackendPoolDeletedFromVMSS(backendPoolID, vmSetName st vmssFlexMap := cachedFlex.(*sync.Map) vmssFlexMap.Range(func(key, value interface{}) bool { vmssFlex := value.(*compute.VirtualMachineScaleSet) - if to.String(vmssFlex.Name) == vmSetName { + if pointer.StringDeref(vmssFlex.Name, "") == vmSetName { found = true return false } @@ -1744,26 +1689,25 @@ func (ss *ScaleSet) ensureBackendPoolDeletedFromVMSS(backendPoolID, vmSetName st }) if found { - return flexScaleSet.ensureBackendPoolDeletedFromVmssFlex(backendPoolID, vmSetName) + return flexScaleSet.ensureBackendPoolDeletedFromVmssFlex(backendPoolIDs, vmSetName) } return cloudprovider.InstanceNotFound - } - err := ss.ensureBackendPoolDeletedFromVmssUniform(backendPoolID, vmSetName) + err := ss.ensureBackendPoolDeletedFromVmssUniform(backendPoolIDs, vmSetName) if err != nil { return err } if ss.EnableVmssFlexNodes { flexScaleSet := ss.flexScaleSet.(*FlexScaleSet) - err = flexScaleSet.ensureBackendPoolDeletedFromVmssFlex(backendPoolID, vmSetName) + err = flexScaleSet.ensureBackendPoolDeletedFromVmssFlex(backendPoolIDs, vmSetName) } return err } -func (ss *ScaleSet) ensureBackendPoolDeletedFromVmssUniform(backendPoolID, vmSetName string) error { - klog.V(2).Infof("ensureBackendPoolDeletedFromVmssUniform: vmSetName (%s), backendPoolID (%s)", vmSetName, backendPoolID) +func (ss *ScaleSet) ensureBackendPoolDeletedFromVmssUniform(backendPoolIDs []string, vmSetName string) error { + klog.V(2).Infof("ensureBackendPoolDeletedFromVmssUniform: vmSetName (%s), backendPoolIDs (%q)", vmSetName, backendPoolIDs) vmssNamesMap := make(map[string]bool) // the standard load balancer supports multiple vmss in its backend while the basic sku doesn't @@ -1783,44 +1727,53 @@ func (ss *ScaleSet) ensureBackendPoolDeletedFromVmssUniform(backendPoolID, vmSet } else if v, ok := value.(*compute.VirtualMachineScaleSet); ok { vmss = v } - klog.V(2).Infof("ensureBackendPoolDeletedFromVmssUniform: vmss (%s)", to.String(vmss.Name)) + klog.V(2).Infof("ensureBackendPoolDeletedFromVmssUniform: vmss (%s)", pointer.StringDeref(vmss.Name, "")) // When vmss is being deleted, CreateOrUpdate API would report "the vmss is being deleted" error. // Since it is being deleted, we shouldn't send more CreateOrUpdate requests for it. if vmss.ProvisioningState != nil && strings.EqualFold(*vmss.ProvisioningState, consts.VirtualMachineScaleSetsDeallocating) { - klog.V(3).Infof("ensureBackendPoolDeletedFromVMSS: found vmss %s being deleted, skipping", to.String(vmss.Name)) + klog.V(3).Infof("ensureBackendPoolDeletedFromVMSS: found vmss %s being deleted, skipping", pointer.StringDeref(vmss.Name, "")) return true } if vmss.VirtualMachineProfile == nil { - klog.V(4).Infof("ensureBackendPoolDeletedFromVMSS: vmss %s has no VirtualMachineProfile, skipping", to.String(vmss.Name)) + klog.V(4).Infof("ensureBackendPoolDeletedFromVMSS: vmss %s has no VirtualMachineProfile, skipping", pointer.StringDeref(vmss.Name, "")) return true } if vmss.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations == nil { - klog.V(4).Infof("ensureBackendPoolDeletedFromVMSS: cannot obtain the primary network interface configuration, of vmss %s", to.String(vmss.Name)) + klog.V(4).Infof("ensureBackendPoolDeletedFromVMSS: cannot obtain the primary network interface configuration, of vmss %s", pointer.StringDeref(vmss.Name, "")) return true } vmssNIC := *vmss.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations - primaryNIC, err := getPrimaryNetworkInterfaceConfigurationForScaleSet(vmssNIC, to.String(vmss.Name)) + primaryNIC, err := getPrimaryNetworkInterfaceConfiguration(vmssNIC, pointer.StringDeref(vmss.Name, "")) if err != nil { - klog.Errorf("ensureBackendPoolDeletedFromVMSS: failed to get the primary network interface config of the VMSS %s: %v", to.String(vmss.Name), err) + klog.Errorf("ensureBackendPoolDeletedFromVMSS: failed to get the primary network interface config of the VMSS %s: %v", pointer.StringDeref(vmss.Name, ""), err) errorList = append(errorList, err) return true } - primaryIPConfig, err := getPrimaryIPConfigFromVMSSNetworkConfig(primaryNIC) - if err != nil { - klog.Errorf("ensureBackendPoolDeletedFromVMSS: failed to the primary IP config from the VMSS %s's network config : %v", to.String(vmss.Name), err) - errorList = append(errorList, err) + + handleBackendPool := func(backendPoolID string) bool { + primaryIPConfig, err := getPrimaryIPConfigFromVMSSNetworkConfig(primaryNIC, backendPoolID, pointer.StringDeref(vmss.Name, "")) + if err != nil { + klog.Errorf("ensureBackendPoolDeletedFromVMSS: failed to find the primary IP config from the VMSS %s's network config : %v", pointer.StringDeref(vmss.Name, ""), err) + errorList = append(errorList, err) + return true + } + loadBalancerBackendAddressPools := make([]compute.SubResource, 0) + if primaryIPConfig.LoadBalancerBackendAddressPools != nil { + loadBalancerBackendAddressPools = *primaryIPConfig.LoadBalancerBackendAddressPools + } + for _, loadBalancerBackendAddressPool := range loadBalancerBackendAddressPools { + klog.V(4).Infof("ensureBackendPoolDeletedFromVMSS: loadBalancerBackendAddressPool (%s) on vmss (%s)", pointer.StringDeref(loadBalancerBackendAddressPool.ID, ""), pointer.StringDeref(vmss.Name, "")) + if strings.EqualFold(pointer.StringDeref(loadBalancerBackendAddressPool.ID, ""), backendPoolID) { + klog.V(4).Infof("ensureBackendPoolDeletedFromVMSS: found vmss %s with backend pool %s, removing it", pointer.StringDeref(vmss.Name, ""), backendPoolID) + vmssNamesMap[pointer.StringDeref(vmss.Name, "")] = true + } + } return true } - loadBalancerBackendAddressPools := make([]compute.SubResource, 0) - if primaryIPConfig.LoadBalancerBackendAddressPools != nil { - loadBalancerBackendAddressPools = *primaryIPConfig.LoadBalancerBackendAddressPools - } - for _, loadBalancerBackendAddressPool := range loadBalancerBackendAddressPools { - klog.V(4).Infof("ensureBackendPoolDeletedFromVMSS: loadBalancerBackendAddressPool (%s) on vmss (%s)", to.String(loadBalancerBackendAddressPool.ID), to.String(vmss.Name)) - if strings.EqualFold(to.String(loadBalancerBackendAddressPool.ID), backendPoolID) { - klog.V(4).Infof("ensureBackendPoolDeletedFromVMSS: found vmss %s with backend pool %s, removing it", to.String(vmss.Name), backendPoolID) - vmssNamesMap[to.String(vmss.Name)] = true + for _, backendPoolID := range backendPoolIDs { + if !handleBackendPool(backendPoolID) { + return false } } @@ -1836,11 +1789,11 @@ func (ss *ScaleSet) ensureBackendPoolDeletedFromVmssUniform(backendPoolID, vmSet vmssNamesMap[vmSetName] = true } - return ss.EnsureBackendPoolDeletedFromVMSets(vmssNamesMap, backendPoolID) + return ss.EnsureBackendPoolDeletedFromVMSets(vmssNamesMap, backendPoolIDs) } // ensureBackendPoolDeleted ensures the loadBalancer backendAddressPools deleted from the specified nodes. -func (ss *ScaleSet) ensureBackendPoolDeleted(service *v1.Service, backendPoolID, vmSetName string, backendAddressPools *[]network.BackendAddressPool) (bool, error) { +func (ss *ScaleSet) ensureBackendPoolDeleted(service *v1.Service, backendPoolIDs []string, vmSetName string, backendAddressPools *[]network.BackendAddressPool) (bool, error) { // Returns nil if backend address pools already deleted. if backendAddressPools == nil { return false, nil @@ -1854,13 +1807,15 @@ func (ss *ScaleSet) ensureBackendPoolDeleted(service *v1.Service, backendPoolID, ipConfigurationIDs := []string{} for _, backendPool := range *backendAddressPools { - if strings.EqualFold(*backendPool.ID, backendPoolID) && backendPool.BackendIPConfigurations != nil { - for _, ipConf := range *backendPool.BackendIPConfigurations { - if ipConf.ID == nil { - continue + for _, backendPoolID := range backendPoolIDs { + if strings.EqualFold(*backendPool.ID, backendPoolID) && backendPool.BackendIPConfigurations != nil { + for _, ipConf := range *backendPool.BackendIPConfigurations { + if ipConf.ID == nil { + continue + } + + ipConfigurationIDs = append(ipConfigurationIDs, *ipConf.ID) } - - ipConfigurationIDs = append(ipConfigurationIDs, *ipConf.ID) } } } @@ -1869,8 +1824,14 @@ func (ss *ScaleSet) ensureBackendPoolDeleted(service *v1.Service, backendPoolID, hostUpdates := make([]func() error, 0, len(ipConfigurationIDs)) nodeUpdates := make(map[vmssMetaInfo]map[string]compute.VirtualMachineScaleSetVM) allErrs := make([]error, 0) + visitedIPConfigIDPrefix := map[string]bool{} for i := range ipConfigurationIDs { ipConfigurationID := ipConfigurationIDs[i] + ipConfigurationIDPrefix := getResourceIDPrefix(ipConfigurationID) + if _, ok := visitedIPConfigIDPrefix[ipConfigurationIDPrefix]; ok { + continue + } + visitedIPConfigIDPrefix[ipConfigurationIDPrefix] = true var scaleSetName string var err error @@ -1898,10 +1859,10 @@ func (ss *ScaleSet) ensureBackendPoolDeleted(service *v1.Service, backendPoolID, continue } - nodeResourceGroup, nodeVMSS, nodeInstanceID, nodeVMSSVM, err := ss.ensureBackendPoolDeletedFromNode(nodeName, backendPoolID) + nodeResourceGroup, nodeVMSS, nodeInstanceID, nodeVMSSVM, err := ss.ensureBackendPoolDeletedFromNode(nodeName, backendPoolIDs) if err != nil { if !errors.Is(err, ErrorNotVmssInstance) { // Do nothing for the VMAS nodes. - klog.Errorf("ensureBackendPoolDeleted(%s): backendPoolID(%s) - failed with error %v", getServiceName(service), backendPoolID, err) + klog.Errorf("ensureBackendPoolDeleted(%s): backendPoolIDs(%q) - failed with error %v", getServiceName(service), backendPoolIDs, err) allErrs = append(allErrs, err) } continue @@ -1941,7 +1902,7 @@ func (ss *ScaleSet) ensureBackendPoolDeleted(service *v1.Service, backendPoolID, "operation", "EnsureBackendPoolDeleted UpdateVMSSVMs", "vmssName", meta.vmssName, "resourceGroup", meta.resourceGroup, - "backendPoolID", backendPoolID, + "backendPoolIDs", backendPoolIDs, } batchSize, err := ss.VMSSBatchSize(meta.vmssName) @@ -1976,37 +1937,39 @@ func (ss *ScaleSet) ensureBackendPoolDeleted(service *v1.Service, backendPoolID, } // EnsureBackendPoolDeleted ensures the loadBalancer backendAddressPools deleted from the specified nodes. -func (ss *ScaleSet) EnsureBackendPoolDeleted(service *v1.Service, backendPoolID, vmSetName string, backendAddressPools *[]network.BackendAddressPool, deleteFromVMSet bool) (bool, error) { +func (ss *ScaleSet) EnsureBackendPoolDeleted(service *v1.Service, backendPoolIDs []string, vmSetName string, backendAddressPools *[]network.BackendAddressPool, deleteFromVMSet bool) (bool, error) { if backendAddressPools == nil { return false, nil } - vmssUniformBackendIPConfigurations := []network.InterfaceIPConfiguration{} - vmssFlexBackendIPConfigurations := []network.InterfaceIPConfiguration{} - avSetBackendIPConfigurations := []network.InterfaceIPConfiguration{} + vmssUniformBackendIPConfigurationsMap := map[string][]network.InterfaceIPConfiguration{} + vmssFlexBackendIPConfigurationsMap := map[string][]network.InterfaceIPConfiguration{} + avSetBackendIPConfigurationsMap := map[string][]network.InterfaceIPConfiguration{} for _, backendPool := range *backendAddressPools { - if strings.EqualFold(*backendPool.ID, backendPoolID) && backendPool.BackendIPConfigurations != nil { - for _, ipConf := range *backendPool.BackendIPConfigurations { - if ipConf.ID == nil { - continue - } - - vmManagementType, err := ss.getVMManagementTypeByIPConfigurationID(*ipConf.ID, azcache.CacheReadTypeUnsafe) - if err != nil { - klog.Warningf("Failed to check VM management type by ipConfigurationID %s: %v, skip it", *ipConf.ID, err) - } - - if vmManagementType == ManagedByAvSet { - // vm is managed by availability set. - avSetBackendIPConfigurations = append(avSetBackendIPConfigurations, ipConf) - } - if vmManagementType == ManagedByVmssFlex { - // vm is managed by vmss flex. - vmssFlexBackendIPConfigurations = append(vmssFlexBackendIPConfigurations, ipConf) - } - if vmManagementType == ManagedByVmssUniform { - // vm is managed by vmss flex. - vmssUniformBackendIPConfigurations = append(vmssUniformBackendIPConfigurations, ipConf) + for _, backendPoolID := range backendPoolIDs { + if strings.EqualFold(*backendPool.ID, backendPoolID) && backendPool.BackendIPConfigurations != nil { + for _, ipConf := range *backendPool.BackendIPConfigurations { + if ipConf.ID == nil { + continue + } + + vmManagementType, err := ss.getVMManagementTypeByIPConfigurationID(*ipConf.ID, azcache.CacheReadTypeUnsafe) + if err != nil { + klog.Warningf("Failed to check VM management type by ipConfigurationID %s: %v, skip it", *ipConf.ID, err) + } + + if vmManagementType == ManagedByAvSet { + // vm is managed by availability set. + avSetBackendIPConfigurationsMap[backendPoolID] = append(avSetBackendIPConfigurationsMap[backendPoolID], ipConf) + } + if vmManagementType == ManagedByVmssFlex { + // vm is managed by vmss flex. + vmssFlexBackendIPConfigurationsMap[backendPoolID] = append(vmssFlexBackendIPConfigurationsMap[backendPoolID], ipConf) + } + if vmManagementType == ManagedByVmssUniform { + // vm is managed by vmss flex. + vmssUniformBackendIPConfigurationsMap[backendPoolID] = append(vmssUniformBackendIPConfigurationsMap[backendPoolID], ipConf) + } } } } @@ -2015,23 +1978,25 @@ func (ss *ScaleSet) EnsureBackendPoolDeleted(service *v1.Service, backendPoolID, // make sure all vmss including uniform and flex are decoupled from // the lb backend pool even if there is no ipConfigs in the backend pool. if deleteFromVMSet { - err := ss.ensureBackendPoolDeletedFromVMSS(backendPoolID, vmSetName) + err := ss.ensureBackendPoolDeletedFromVMSS(backendPoolIDs, vmSetName) if err != nil { return false, err } } var updated bool - if len(vmssUniformBackendIPConfigurations) > 0 { - vmssUniformBackendPools := &[]network.BackendAddressPool{ - { - ID: to.StringPtr(backendPoolID), - BackendAddressPoolPropertiesFormat: &network.BackendAddressPoolPropertiesFormat{ - BackendIPConfigurations: &vmssUniformBackendIPConfigurations, - }, + vmssUniformBackendPools := []network.BackendAddressPool{} + for backendPoolID, vmssUniformBackendIPConfigurations := range vmssUniformBackendIPConfigurationsMap { + vmssUniformBackendIPConfigurations := vmssUniformBackendIPConfigurations + vmssUniformBackendPools = append(vmssUniformBackendPools, network.BackendAddressPool{ + ID: pointer.String(backendPoolID), + BackendAddressPoolPropertiesFormat: &network.BackendAddressPoolPropertiesFormat{ + BackendIPConfigurations: &vmssUniformBackendIPConfigurations, }, - } - updatedVM, err := ss.ensureBackendPoolDeleted(service, backendPoolID, vmSetName, vmssUniformBackendPools) + }) + } + if len(vmssUniformBackendPools) > 0 { + updatedVM, err := ss.ensureBackendPoolDeleted(service, backendPoolIDs, vmSetName, &vmssUniformBackendPools) if err != nil { return false, err } @@ -2040,16 +2005,18 @@ func (ss *ScaleSet) EnsureBackendPoolDeleted(service *v1.Service, backendPoolID, } } - if len(vmssFlexBackendIPConfigurations) > 0 { - vmssFlexBackendPools := &[]network.BackendAddressPool{ - { - ID: to.StringPtr(backendPoolID), - BackendAddressPoolPropertiesFormat: &network.BackendAddressPoolPropertiesFormat{ - BackendIPConfigurations: &vmssFlexBackendIPConfigurations, - }, + vmssFlexBackendPools := []network.BackendAddressPool{} + for backendPoolID, vmssFlexBackendIPConfigurations := range vmssFlexBackendIPConfigurationsMap { + vmssFlexBackendIPConfigurations := vmssFlexBackendIPConfigurations + vmssFlexBackendPools = append(vmssFlexBackendPools, network.BackendAddressPool{ + ID: pointer.String(backendPoolID), + BackendAddressPoolPropertiesFormat: &network.BackendAddressPoolPropertiesFormat{ + BackendIPConfigurations: &vmssFlexBackendIPConfigurations, }, - } - updatedNIC, err := ss.flexScaleSet.EnsureBackendPoolDeleted(service, backendPoolID, vmSetName, vmssFlexBackendPools, false) + }) + } + if len(vmssFlexBackendPools) > 0 { + updatedNIC, err := ss.flexScaleSet.EnsureBackendPoolDeleted(service, backendPoolIDs, vmSetName, &vmssFlexBackendPools, false) if err != nil { return false, err } @@ -2058,16 +2025,18 @@ func (ss *ScaleSet) EnsureBackendPoolDeleted(service *v1.Service, backendPoolID, } } - if len(avSetBackendIPConfigurations) > 0 { - avSetBackendPools := &[]network.BackendAddressPool{ - { - ID: to.StringPtr(backendPoolID), - BackendAddressPoolPropertiesFormat: &network.BackendAddressPoolPropertiesFormat{ - BackendIPConfigurations: &avSetBackendIPConfigurations, - }, + avSetBackendPools := []network.BackendAddressPool{} + for backendPoolID, avSetBackendIPConfigurations := range avSetBackendIPConfigurationsMap { + avSetBackendIPConfigurations := avSetBackendIPConfigurations + avSetBackendPools = append(avSetBackendPools, network.BackendAddressPool{ + ID: pointer.String(backendPoolID), + BackendAddressPoolPropertiesFormat: &network.BackendAddressPoolPropertiesFormat{ + BackendIPConfigurations: &avSetBackendIPConfigurations, }, - } - updatedNIC, err := ss.availabilitySet.EnsureBackendPoolDeleted(service, backendPoolID, vmSetName, avSetBackendPools, false) + }) + } + if len(avSetBackendPools) > 0 { + updatedNIC, err := ss.availabilitySet.EnsureBackendPoolDeleted(service, backendPoolIDs, vmSetName, &avSetBackendPools, false) if err != nil { return false, err } @@ -2109,23 +2078,52 @@ func (ss *ScaleSet) GetNodeCIDRMasksByProviderID(providerID string) (int, int, e var ipv4Mask, ipv6Mask int if v4, ok := vmss.Tags[consts.VMSetCIDRIPV4TagKey]; ok && v4 != nil { - ipv4Mask, err = strconv.Atoi(to.String(v4)) + ipv4Mask, err = strconv.Atoi(pointer.StringDeref(v4, "")) if err != nil { - klog.Errorf("GetNodeCIDRMasksByProviderID: error when paring the value of the ipv4 mask size %s: %v", to.String(v4), err) + klog.Errorf("GetNodeCIDRMasksByProviderID: error when paring the value of the ipv4 mask size %s: %v", pointer.StringDeref(v4, ""), err) } } if v6, ok := vmss.Tags[consts.VMSetCIDRIPV6TagKey]; ok && v6 != nil { - ipv6Mask, err = strconv.Atoi(to.String(v6)) + ipv6Mask, err = strconv.Atoi(pointer.StringDeref(v6, "")) if err != nil { - klog.Errorf("GetNodeCIDRMasksByProviderID: error when paring the value of the ipv6 mask size%s: %v", to.String(v6), err) + klog.Errorf("GetNodeCIDRMasksByProviderID: error when paring the value of the ipv6 mask size%s: %v", pointer.StringDeref(v6, ""), err) } } return ipv4Mask, ipv6Mask, nil } +// deleteBackendPoolFromIPConfig deletes the backend pool from the IP config. +func deleteBackendPoolFromIPConfig(msg, backendPoolID, resource string, primaryNIC *compute.VirtualMachineScaleSetNetworkConfiguration) (bool, error) { + primaryIPConfig, err := getPrimaryIPConfigFromVMSSNetworkConfig(primaryNIC, backendPoolID, resource) + if err != nil { + klog.Errorf("%s: failed to get the primary IP config from the VMSS %q's network config: %v", msg, resource, err) + return false, err + } + loadBalancerBackendAddressPools := []compute.SubResource{} + if primaryIPConfig.LoadBalancerBackendAddressPools != nil { + loadBalancerBackendAddressPools = *primaryIPConfig.LoadBalancerBackendAddressPools + } + + var found bool + var newBackendPools []compute.SubResource + for i := len(loadBalancerBackendAddressPools) - 1; i >= 0; i-- { + curPool := loadBalancerBackendAddressPools[i] + if strings.EqualFold(backendPoolID, *curPool.ID) { + klog.V(10).Infof("%s gets unwanted backend pool %q for VMSS OR VMSS VM %q", msg, backendPoolID, resource) + found = true + newBackendPools = append(loadBalancerBackendAddressPools[:i], loadBalancerBackendAddressPools[i+1:]...) + } + } + if !found { + return false, nil + } + primaryIPConfig.LoadBalancerBackendAddressPools = &newBackendPools + return true, nil +} + // EnsureBackendPoolDeletedFromVMSets ensures the loadBalancer backendAddressPools deleted from the specified VMSS -func (ss *ScaleSet) EnsureBackendPoolDeletedFromVMSets(vmssNamesMap map[string]bool, backendPoolID string) error { +func (ss *ScaleSet) EnsureBackendPoolDeletedFromVMSets(vmssNamesMap map[string]bool, backendPoolIDs []string) error { vmssUpdaters := make([]func() error, 0, len(vmssNamesMap)) errors := make([]error, 0, len(vmssNamesMap)) for vmssName := range vmssNamesMap { @@ -2148,40 +2146,29 @@ func (ss *ScaleSet) EnsureBackendPoolDeletedFromVMSets(vmssNamesMap map[string]b continue } vmssNIC := *vmss.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations - primaryNIC, err := getPrimaryNetworkInterfaceConfigurationForScaleSet(vmssNIC, vmssName) + primaryNIC, err := getPrimaryNetworkInterfaceConfiguration(vmssNIC, vmssName) if err != nil { klog.Errorf("EnsureBackendPoolDeletedFromVMSets: failed to get the primary network interface config of the VMSS %s: %v", vmssName, err) errors = append(errors, err) continue } - primaryIPConfig, err := getPrimaryIPConfigFromVMSSNetworkConfig(primaryNIC) - if err != nil { - klog.Errorf("EnsureBackendPoolDeletedFromVMSets: failed to the primary IP config from the VMSS %s's network config : %v", vmssName, err) - errors = append(errors, err) - continue - } - loadBalancerBackendAddressPools := []compute.SubResource{} - if primaryIPConfig.LoadBalancerBackendAddressPools != nil { - loadBalancerBackendAddressPools = *primaryIPConfig.LoadBalancerBackendAddressPools - } - - var found bool - var newBackendPools []compute.SubResource - for i := len(loadBalancerBackendAddressPools) - 1; i >= 0; i-- { - curPool := loadBalancerBackendAddressPools[i] - if strings.EqualFold(backendPoolID, *curPool.ID) { - klog.V(10).Infof("EnsureBackendPoolDeletedFromVMSets gets unwanted backend pool %q for VMSS %s", backendPoolID, vmssName) - found = true - newBackendPools = append(loadBalancerBackendAddressPools[:i], loadBalancerBackendAddressPools[i+1:]...) + foundTotal := false + for _, backendPoolID := range backendPoolIDs { + found, err := deleteBackendPoolFromIPConfig("EnsureBackendPoolDeletedFromVMSets", backendPoolID, vmssName, primaryNIC) + if err != nil { + errors = append(errors, err) + continue + } + if found { + foundTotal = true } } - if !found { + if !foundTotal { continue } vmssUpdaters = append(vmssUpdaters, func() error { // Compose a new vmss with added backendPoolID. - primaryIPConfig.LoadBalancerBackendAddressPools = &newBackendPools newVMSS := compute.VirtualMachineScaleSet{ Location: vmss.Location, VirtualMachineScaleSetProperties: &compute.VirtualMachineScaleSetProperties{ @@ -2193,10 +2180,10 @@ func (ss *ScaleSet) EnsureBackendPoolDeletedFromVMSets(vmssNamesMap map[string]b }, } - klog.V(2).Infof("EnsureBackendPoolDeletedFromVMSets begins to update vmss(%s) with backendPoolID %s", vmssName, backendPoolID) + klog.V(2).Infof("EnsureBackendPoolDeletedFromVMSets begins to update vmss(%s) with backendPoolIDs %q", vmssName, backendPoolIDs) rerr := ss.CreateOrUpdateVMSS(ss.ResourceGroup, vmssName, newVMSS) if rerr != nil { - klog.Errorf("EnsureBackendPoolDeletedFromVMSets CreateOrUpdateVMSS(%s) with new backendPoolID %s, err: %v", vmssName, backendPoolID, rerr) + klog.Errorf("EnsureBackendPoolDeletedFromVMSets CreateOrUpdateVMSS(%s) with new backendPoolIDs %q, err: %v", vmssName, backendPoolIDs, rerr) return rerr.Error() } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmss_cache.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmss_cache.go index 47ff879cb783..80c403dbbd96 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmss_cache.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmss_cache.go @@ -24,10 +24,10 @@ import ( "time" "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" - "github.com/Azure/go-autorest/autorest/to" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/klog/v2" + "k8s.io/utils/pointer" azcache "sigs.k8s.io/cloud-provider-azure/pkg/cache" "sigs.k8s.io/cloud-provider-azure/pkg/consts" @@ -48,11 +48,11 @@ type VMSSEntry struct { } type NonVmssUniformNodesEntry struct { - VMSSFlexVMNodeNames sets.String - VMSSFlexVMProviderIDs sets.String - AvSetVMNodeNames sets.String - AvSetVMProviderIDs sets.String - ClusterNodeNames sets.String + VMSSFlexVMNodeNames sets.Set[string] + VMSSFlexVMProviderIDs sets.Set[string] + AvSetVMNodeNames sets.Set[string] + AvSetVMProviderIDs sets.Set[string] + ClusterNodeNames sets.Set[string] } type VMManagementType string @@ -74,7 +74,7 @@ func (ss *ScaleSet) newVMSSCache(ctx context.Context) (*azcache.TimedCache, erro } resourceGroupNotFound := false - for _, resourceGroup := range allResourceGroups.List() { + for _, resourceGroup := range allResourceGroups.UnsortedList() { allScaleSets, rerr := ss.VirtualMachineScaleSetsClient.List(ctx, resourceGroup) if rerr != nil { if rerr.IsNotFound() { @@ -122,20 +122,6 @@ func (ss *ScaleSet) newVMSSCache(ctx context.Context) (*azcache.TimedCache, erro return azcache.NewTimedcache(time.Duration(ss.Config.VmssCacheTTLInSeconds)*time.Second, getter) } -func extractVmssVMName(name string) (string, string, error) { - split := strings.SplitAfter(name, consts.VMSSNameSeparator) - if len(split) < 2 { - klog.V(3).Infof("Failed to extract vmssVMName %q", name) - return "", "", ErrorNotVmssInstance - } - - ssName := strings.Join(split[0:len(split)-1], "") - // removing the trailing `vmssNameSeparator` since we used SplitAfter - ssName = ssName[:len(ssName)-1] - instanceID := split[len(split)-1] - return ssName, instanceID, nil -} - func (ss *ScaleSet) getVMSSVMsFromCache(resourceGroup, vmssName string, crt azcache.AzureCacheReadType) (*sync.Map, error) { cacheKey := getVMSSVMCacheKey(resourceGroup, vmssName) entry, err := ss.vmssVMCache.Get(cacheKey, crt) @@ -152,18 +138,12 @@ func (ss *ScaleSet) getVMSSVMsFromCache(resourceGroup, vmssName string, crt azca return virtualMachines, nil } -// gcVMSSVMCache delete stale VMSS VMs caches from deleted VMSSes. -func (ss *ScaleSet) gcVMSSVMCache() error { - return ss.vmssCache.Delete(consts.VMSSKey) -} - // newVMSSVirtualMachinesCache instantiates a new VMs cache for VMs belonging to the provided VMSS. func (ss *ScaleSet) newVMSSVirtualMachinesCache() (*azcache.TimedCache, error) { vmssVirtualMachinesCacheTTL := time.Duration(ss.Config.VmssVirtualMachinesCacheTTLInSeconds) * time.Second getter := func(cacheKey string) (interface{}, error) { localCache := &sync.Map{} // [nodeName]*VMSSVirtualMachineEntry - oldCache := make(map[string]*VMSSVirtualMachineEntry) entry, exists, err := ss.vmssVMCache.Store.GetByKey(cacheKey) @@ -210,13 +190,13 @@ func (ss *ScaleSet) newVMSSVirtualMachinesCache() (*azcache.TimedCache, error) { vmssVMCacheEntry := &VMSSVirtualMachineEntry{ ResourceGroup: resourceGroupName, VMSSName: vmssName, - InstanceID: to.String(vm.InstanceID), + InstanceID: pointer.StringDeref(vm.InstanceID, ""), VirtualMachine: &vm, LastUpdate: time.Now().UTC(), } // set cache entry to nil when the VM is under deleting. if vm.VirtualMachineScaleSetVMProperties != nil && - strings.EqualFold(to.String(vm.VirtualMachineScaleSetVMProperties.ProvisioningState), string(compute.ProvisioningStateDeleting)) { + strings.EqualFold(pointer.StringDeref(vm.VirtualMachineScaleSetVMProperties.ProvisioningState, ""), string(compute.ProvisioningStateDeleting)) { klog.V(4).Infof("VMSS virtualMachine %q is under deleting, setting its cache to nil", computerName) vmssVMCacheEntry.VirtualMachine = nil } @@ -261,7 +241,7 @@ func (ss *ScaleSet) newVMSSVirtualMachinesCache() (*azcache.TimedCache, error) { func (ss *ScaleSet) DeleteCacheForNode(nodeName string) error { vmManagementType, err := ss.getVMManagementTypeByNodeName(nodeName, azcache.CacheReadTypeUnsafe) if err != nil { - klog.Errorf("Failed to check VM management type: %v", err) + klog.Errorf("getVMManagementTypeByNodeName(%s) failed with %v", nodeName, err) return err } @@ -276,24 +256,30 @@ func (ss *ScaleSet) DeleteCacheForNode(nodeName string) error { node, err := ss.getNodeIdentityByNodeName(nodeName, azcache.CacheReadTypeUnsafe) if err != nil { - klog.Errorf("DeleteCacheForNode(%s) failed with error: %v", nodeName, err) + klog.Errorf("getNodeIdentityByNodeName(%s) failed with %v", nodeName, err) return err } + // get sync.Map cache and remove the node from the cache + cacheKey := getVMSSVMCacheKey(node.resourceGroup, node.vmssName) + ss.lockMap.LockEntry(cacheKey) + defer ss.lockMap.UnlockEntry(cacheKey) - err = ss.vmssVMCache.Delete(getVMSSVMCacheKey(node.resourceGroup, node.vmssName)) + virtualMachines, err := ss.getVMSSVMsFromCache(node.resourceGroup, node.vmssName, azcache.CacheReadTypeUnsafe) if err != nil { - klog.Errorf("DeleteCacheForNode(%s) failed to remove from vmssVMCache with error: %v", nodeName, err) + klog.Errorf("getVMSSVMsFromCache(%s, %s) failed with %v", node.resourceGroup, node.vmssName, err) return err } - if err := ss.gcVMSSVMCache(); err != nil { - klog.Errorf("DeleteCacheForNode(%s) failed to gc stale vmss caches: %v", nodeName, err) - } - + virtualMachines.Delete(nodeName) + ss.vmssVMCache.Update(cacheKey, virtualMachines) + klog.V(2).Infof("DeleteCacheForNode(%s, %s, %s) successfully", node.resourceGroup, node.vmssName, nodeName) return nil } func (ss *ScaleSet) updateCache(nodeName, resourceGroupName, vmssName, instanceID string, updatedVM *compute.VirtualMachineScaleSetVM) error { + if ss.common.DisableUpdateCache { + return nil + } // lock the VMSS entry to ensure a consistent view of the VM map when there are concurrent updates. cacheKey := getVMSSVMCacheKey(resourceGroupName, vmssName) ss.lockMap.LockEntry(cacheKey) @@ -301,12 +287,9 @@ func (ss *ScaleSet) updateCache(nodeName, resourceGroupName, vmssName, instanceI virtualMachines, err := ss.getVMSSVMsFromCache(resourceGroupName, vmssName, azcache.CacheReadTypeUnsafe) if err != nil { - err = fmt.Errorf("updateCache(%s, %s, %s) failed getting vmCache with error: %w", vmssName, resourceGroupName, nodeName, err) - return err + return fmt.Errorf("updateCache(%s, %s, %s) failed getting vmCache with error: %w", vmssName, resourceGroupName, nodeName, err) } - localCache := &sync.Map{} - vmssVMCacheEntry := &VMSSVirtualMachineEntry{ ResourceGroup: resourceGroupName, VMSSName: vmssName, @@ -315,8 +298,10 @@ func (ss *ScaleSet) updateCache(nodeName, resourceGroupName, vmssName, instanceI LastUpdate: time.Now().UTC(), } + localCache := &sync.Map{} localCache.Store(nodeName, vmssVMCacheEntry) + // copy all elements except current VM to localCache virtualMachines.Range(func(key, value interface{}) bool { if key.(string) != nodeName { localCache.Store(key.(string), value.(*VMSSVirtualMachineEntry)) @@ -325,23 +310,23 @@ func (ss *ScaleSet) updateCache(nodeName, resourceGroupName, vmssName, instanceI }) ss.vmssVMCache.Update(cacheKey, localCache) - klog.V(4).Infof("updateCache(%s, %s, %s) for cacheKey(%s) updated successfully", vmssName, resourceGroupName, nodeName, cacheKey) + klog.V(2).Infof("updateCache(%s, %s, %s) for cacheKey(%s) updated successfully", vmssName, resourceGroupName, nodeName, cacheKey) return nil } func (ss *ScaleSet) newNonVmssUniformNodesCache() (*azcache.TimedCache, error) { getter := func(key string) (interface{}, error) { - vmssFlexVMNodeNames := sets.NewString() - vmssFlexVMProviderIDs := sets.NewString() - avSetVMNodeNames := sets.NewString() - avSetVMProviderIDs := sets.NewString() + vmssFlexVMNodeNames := sets.New[string]() + vmssFlexVMProviderIDs := sets.New[string]() + avSetVMNodeNames := sets.New[string]() + avSetVMProviderIDs := sets.New[string]() resourceGroups, err := ss.GetResourceGroups() if err != nil { return nil, err } klog.V(2).Infof("refresh the cache of NonVmssUniformNodesCache in rg %v", resourceGroups) - for _, resourceGroup := range resourceGroups.List() { + for _, resourceGroup := range resourceGroups.UnsortedList() { vms, err := ss.Cloud.ListVirtualMachines(resourceGroup) if err != nil { return nil, fmt.Errorf("getter function of nonVmssUniformNodesCache: failed to list vms in the resource group %s: %w", resourceGroup, err) @@ -349,14 +334,14 @@ func (ss *ScaleSet) newNonVmssUniformNodesCache() (*azcache.TimedCache, error) { for _, vm := range vms { if vm.OsProfile != nil && vm.OsProfile.ComputerName != nil { if vm.VirtualMachineScaleSet != nil { - vmssFlexVMNodeNames.Insert(strings.ToLower(to.String(vm.OsProfile.ComputerName))) + vmssFlexVMNodeNames.Insert(strings.ToLower(pointer.StringDeref(vm.OsProfile.ComputerName, ""))) if vm.ID != nil { - vmssFlexVMProviderIDs.Insert(ss.ProviderName() + "://" + to.String(vm.ID)) + vmssFlexVMProviderIDs.Insert(ss.ProviderName() + "://" + pointer.StringDeref(vm.ID, "")) } } else { - avSetVMNodeNames.Insert(strings.ToLower(to.String(vm.OsProfile.ComputerName))) + avSetVMNodeNames.Insert(strings.ToLower(pointer.StringDeref(vm.OsProfile.ComputerName, ""))) if vm.ID != nil { - avSetVMProviderIDs.Insert(ss.ProviderName() + "://" + to.String(vm.ID)) + avSetVMProviderIDs.Insert(ss.ProviderName() + "://" + pointer.StringDeref(vm.ID, "")) } } } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmssflex.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmssflex.go index a2e301d2e3fc..ff55cacb1286 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmssflex.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmssflex.go @@ -25,14 +25,13 @@ import ( "sync" "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" - "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" utilerrors "k8s.io/apimachinery/pkg/util/errors" cloudprovider "k8s.io/cloud-provider" "k8s.io/klog/v2" - utilnet "k8s.io/utils/net" + "k8s.io/utils/pointer" azcache "sigs.k8s.io/cloud-provider-azure/pkg/cache" "sigs.k8s.io/cloud-provider-azure/pkg/consts" @@ -162,7 +161,7 @@ func (fs *FlexScaleSet) GetVMSetNames(service *v1.Service, nodes []*v1.Node) (*[ // providerID example: // azure:///subscriptions/sub/resourceGroups/rg/providers/Microsoft.Compute/virtualMachines/flexprofile-mp-0_df53ee36 // Different from vmas where vm name is always equal to nodeName, we need to further map vmName to actual nodeName in vmssflex. -// Note: nodeName is always equal to strings.ToLower(*vm.OsProfile.ComputerName) +// Note: nodeName is always equal pointer.StringDerefs.ToLower(*vm.OsProfile.ComputerName, "") func (fs *FlexScaleSet) GetNodeNameByProviderID(providerID string) (types.NodeName, error) { // NodeName is part of providerID for standard instances. matches := providerIDRE.FindStringSubmatch(providerID) @@ -231,10 +230,10 @@ func (fs *FlexScaleSet) GetZoneByNodeName(name string) (cloudprovider.Zone, erro return cloudprovider.Zone{}, fmt.Errorf("failed to parse zone %q: %w", zones, err) } - failureDomain = fs.makeZone(to.String(vm.Location), zoneID) + failureDomain = fs.makeZone(pointer.StringDeref(vm.Location, ""), zoneID) } else if vm.VirtualMachineProperties.InstanceView != nil && vm.VirtualMachineProperties.InstanceView.PlatformFaultDomain != nil { // Availability zone is not used for the node, falling back to fault domain. - failureDomain = strconv.Itoa(int(to.Int32(vm.VirtualMachineProperties.InstanceView.PlatformFaultDomain))) + failureDomain = strconv.Itoa(int(pointer.Int32Deref(vm.VirtualMachineProperties.InstanceView.PlatformFaultDomain, 0))) } else { err = fmt.Errorf("failed to get zone info") klog.Errorf("GetZoneByNodeName: got unexpected error %v", err) @@ -243,7 +242,7 @@ func (fs *FlexScaleSet) GetZoneByNodeName(name string) (cloudprovider.Zone, erro zone := cloudprovider.Zone{ FailureDomain: strings.ToLower(failureDomain), - Region: strings.ToLower(to.String(vm.Location)), + Region: strings.ToLower(pointer.StringDeref(vm.Location, "")), } return zone, nil } @@ -259,7 +258,7 @@ func (fs *FlexScaleSet) GetProvisioningStateByNodeName(name string) (provisionin return provisioningState, nil } - return to.String(vm.VirtualMachineProperties.ProvisioningState), nil + return pointer.StringDeref(vm.VirtualMachineProperties.ProvisioningState, ""), nil } // GetPowerStatusByNodeName returns the powerState for the specified node. @@ -272,7 +271,7 @@ func (fs *FlexScaleSet) GetPowerStatusByNodeName(name string) (powerState string if vm.InstanceView != nil && vm.InstanceView.Statuses != nil { statuses := *vm.InstanceView.Statuses for _, status := range statuses { - state := to.String(status.Code) + state := pointer.StringDeref(status.Code, "") if strings.HasPrefix(state, vmPowerStatePrefix) { return strings.TrimPrefix(state, vmPowerStatePrefix), nil } @@ -406,7 +405,7 @@ func (fs *FlexScaleSet) getNodeInformationByIPConfigurationID(ipConfigurationID if nic.InterfacePropertiesFormat == nil || nic.InterfacePropertiesFormat.VirtualMachine == nil || nic.InterfacePropertiesFormat.VirtualMachine.ID == nil { return "", "", "", fmt.Errorf("failed to get vm ID of ip config ID %s", ipConfigurationID) } - vmID := to.String(nic.InterfacePropertiesFormat.VirtualMachine.ID) + vmID := pointer.StringDeref(nic.InterfacePropertiesFormat.VirtualMachine.ID, "") matches = vmIDRE.FindStringSubmatch(vmID) if len(matches) != 2 { return "", "", "", fmt.Errorf("invalid virtual machine ID %s", vmID) @@ -447,15 +446,15 @@ func (fs *FlexScaleSet) GetNodeCIDRMasksByProviderID(providerID string) (int, in var ipv4Mask, ipv6Mask int if v4, ok := vmssFlex.Tags[consts.VMSetCIDRIPV4TagKey]; ok && v4 != nil { - ipv4Mask, err = strconv.Atoi(to.String(v4)) + ipv4Mask, err = strconv.Atoi(pointer.StringDeref(v4, "")) if err != nil { - klog.Errorf("GetNodeCIDRMasksByProviderID: error when paring the value of the ipv4 mask size %s: %v", to.String(v4), err) + klog.Errorf("GetNodeCIDRMasksByProviderID: error when paring the value of the ipv4 mask size %s: %v", pointer.StringDeref(v4, ""), err) } } if v6, ok := vmssFlex.Tags[consts.VMSetCIDRIPV6TagKey]; ok && v6 != nil { - ipv6Mask, err = strconv.Atoi(to.String(v6)) + ipv6Mask, err = strconv.Atoi(pointer.StringDeref(v6, "")) if err != nil { - klog.Errorf("GetNodeCIDRMasksByProviderID: error when paring the value of the ipv6 mask size%s: %v", to.String(v6), err) + klog.Errorf("GetNodeCIDRMasksByProviderID: error when paring the value of the ipv6 mask size%s: %v", pointer.StringDeref(v6, ""), err) } } @@ -511,7 +510,7 @@ func (fs *FlexScaleSet) EnsureHostInPool(service *v1.Service, nodeName types.Nod } var primaryIPConfig *network.InterfaceIPConfiguration - ipv6 := utilnet.IsIPv6String(service.Spec.ClusterIP) + ipv6 := isBackendPoolIPv6(backendPoolID) if !fs.Cloud.ipv6DualStackEnabled && !ipv6 { primaryIPConfig, err = getPrimaryIPConfig(nic) if err != nil { @@ -563,7 +562,7 @@ func (fs *FlexScaleSet) EnsureHostInPool(service *v1.Service, nodeName types.Nod newBackendPools = append(newBackendPools, network.BackendAddressPool{ - ID: to.StringPtr(backendPoolID), + ID: pointer.String(backendPoolID), }) primaryIPConfig.LoadBalancerBackendAddressPools = &newBackendPools @@ -657,24 +656,13 @@ func (fs *FlexScaleSet) ensureVMSSFlexInPool(service *v1.Service, nodes []*v1.No continue } vmssNIC := *vmssFlex.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations - primaryNIC, err := getPrimaryNetworkInterfaceConfigurationForScaleSet(vmssNIC, vmssFlexName) + primaryNIC, err := getPrimaryNetworkInterfaceConfiguration(vmssNIC, vmssFlexName) if err != nil { return err } - var primaryIPConfig *compute.VirtualMachineScaleSetIPConfiguration - ipv6 := utilnet.IsIPv6String(service.Spec.ClusterIP) - // Find primary network interface configuration. - if !fs.Cloud.ipv6DualStackEnabled && !ipv6 { - // Find primary IP configuration. - primaryIPConfig, err = getPrimaryIPConfigFromVMSSNetworkConfig(primaryNIC) - if err != nil { - return err - } - } else { - primaryIPConfig, err = getConfigForScaleSetByIPFamily(primaryNIC, "", ipv6) - if err != nil { - return err - } + primaryIPConfig, err := getPrimaryIPConfigFromVMSSNetworkConfig(primaryNIC, backendPoolID, vmssFlexName) + if err != nil { + return err } loadBalancerBackendAddressPools := []compute.SubResource{} @@ -717,7 +705,7 @@ func (fs *FlexScaleSet) ensureVMSSFlexInPool(service *v1.Service, nodes []*v1.No // Compose a new vmss with added backendPoolID. loadBalancerBackendAddressPools = append(loadBalancerBackendAddressPools, compute.SubResource{ - ID: to.StringPtr(backendPoolID), + ID: pointer.String(backendPoolID), }) primaryIPConfig.LoadBalancerBackendAddressPools = &loadBalancerBackendAddressPools newVMSS := compute.VirtualMachineScaleSet{ @@ -797,7 +785,7 @@ func (fs *FlexScaleSet) EnsureHostsInPool(service *v1.Service, nodes []*v1.Node, return nil } -func (fs *FlexScaleSet) ensureBackendPoolDeletedFromVmssFlex(backendPoolID string, vmSetName string) error { +func (fs *FlexScaleSet) ensureBackendPoolDeletedFromVmssFlex(backendPoolIDs []string, vmSetName string) error { vmssNamesMap := make(map[string]bool) if fs.useStandardLoadBalancer() && !fs.EnableMultipleStandardLoadBalancers { cached, err := fs.vmssFlexCache.Get(consts.VmssFlexKey, azcache.CacheReadTypeDefault) @@ -808,17 +796,17 @@ func (fs *FlexScaleSet) ensureBackendPoolDeletedFromVmssFlex(backendPoolID strin vmssFlexes := cached.(*sync.Map) vmssFlexes.Range(func(key, value interface{}) bool { vmssFlex := value.(*compute.VirtualMachineScaleSet) - vmssNamesMap[to.String(vmssFlex.Name)] = true + vmssNamesMap[pointer.StringDeref(vmssFlex.Name, "")] = true return true }) } else { vmssNamesMap[vmSetName] = true } - return fs.EnsureBackendPoolDeletedFromVMSets(vmssNamesMap, backendPoolID) + return fs.EnsureBackendPoolDeletedFromVMSets(vmssNamesMap, backendPoolIDs) } // EnsureBackendPoolDeletedFromVMSets ensures the loadBalancer backendAddressPools deleted from the specified VMSS Flex -func (fs *FlexScaleSet) EnsureBackendPoolDeletedFromVMSets(vmssNamesMap map[string]bool, backendPoolID string) error { +func (fs *FlexScaleSet) EnsureBackendPoolDeletedFromVMSets(vmssNamesMap map[string]bool, backendPoolIDs []string) error { vmssUpdaters := make([]func() error, 0, len(vmssNamesMap)) errors := make([]error, 0, len(vmssNamesMap)) for vmssName := range vmssNamesMap { @@ -841,40 +829,29 @@ func (fs *FlexScaleSet) EnsureBackendPoolDeletedFromVMSets(vmssNamesMap map[stri continue } vmssNIC := *vmss.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations - primaryNIC, err := getPrimaryNetworkInterfaceConfigurationForScaleSet(vmssNIC, vmssName) + primaryNIC, err := getPrimaryNetworkInterfaceConfiguration(vmssNIC, vmssName) if err != nil { klog.Errorf("fs.EnsureBackendPoolDeletedFromVMSets: failed to get the primary network interface config of the VMSS %s: %v", vmssName, err) errors = append(errors, err) continue } - primaryIPConfig, err := getPrimaryIPConfigFromVMSSNetworkConfig(primaryNIC) - if err != nil { - klog.Errorf("fs.EnsureBackendPoolDeletedFromVMSets: failed to the primary IP config from the VMSS %s's network config : %v", vmssName, err) - errors = append(errors, err) - continue - } - loadBalancerBackendAddressPools := []compute.SubResource{} - if primaryIPConfig.LoadBalancerBackendAddressPools != nil { - loadBalancerBackendAddressPools = *primaryIPConfig.LoadBalancerBackendAddressPools - } - - var found bool - var newBackendPools []compute.SubResource - for i := len(loadBalancerBackendAddressPools) - 1; i >= 0; i-- { - curPool := loadBalancerBackendAddressPools[i] - if strings.EqualFold(backendPoolID, *curPool.ID) { - klog.V(10).Infof("fs.EnsureBackendPoolDeletedFromVMSets gets unwanted backend pool %q for VMSS %s", backendPoolID, vmssName) - found = true - newBackendPools = append(loadBalancerBackendAddressPools[:i], loadBalancerBackendAddressPools[i+1:]...) + foundTotal := false + for _, backendPoolID := range backendPoolIDs { + found, err := deleteBackendPoolFromIPConfig("FlexSet.EnsureBackendPoolDeletedFromVMSets", backendPoolID, vmssName, primaryNIC) + if err != nil { + errors = append(errors, err) + continue + } + if found { + foundTotal = true } } - if !found { + if !foundTotal { continue } vmssUpdaters = append(vmssUpdaters, func() error { // Compose a new vmss with added backendPoolID. - primaryIPConfig.LoadBalancerBackendAddressPools = &newBackendPools newVMSS := compute.VirtualMachineScaleSet{ Location: vmss.Location, VirtualMachineScaleSetProperties: &compute.VirtualMachineScaleSetProperties{ @@ -891,10 +868,10 @@ func (fs *FlexScaleSet) EnsureBackendPoolDeletedFromVMSets(vmssNamesMap map[stri _ = fs.vmssFlexCache.Delete(consts.VmssFlexKey) }() - klog.V(2).Infof("fs.EnsureBackendPoolDeletedFromVMSets begins to delete backendPoolID %s from vmss(%s)", backendPoolID, vmssName) + klog.V(2).Infof("fs.EnsureBackendPoolDeletedFromVMSets begins to delete backendPoolIDs %q from vmss(%s)", backendPoolIDs, vmssName) rerr := fs.CreateOrUpdateVMSS(fs.ResourceGroup, vmssName, newVMSS) if rerr != nil { - klog.Errorf("fs.EnsureBackendPoolDeletedFromVMSets CreateOrUpdateVMSS(%s) for backendPoolID %s, err: %v", vmssName, backendPoolID, rerr) + klog.Errorf("fs.EnsureBackendPoolDeletedFromVMSets CreateOrUpdateVMSS(%s) for backendPoolIDs %q, err: %v", vmssName, backendPoolIDs, rerr) return rerr.Error() } @@ -915,7 +892,7 @@ func (fs *FlexScaleSet) EnsureBackendPoolDeletedFromVMSets(vmssNamesMap map[stri } // EnsureBackendPoolDeleted ensures the loadBalancer backendAddressPools deleted from the specified nodes. -func (fs *FlexScaleSet) EnsureBackendPoolDeleted(service *v1.Service, backendPoolID, vmSetName string, backendAddressPools *[]network.BackendAddressPool, deleteFromVMSet bool) (bool, error) { +func (fs *FlexScaleSet) EnsureBackendPoolDeleted(service *v1.Service, backendPoolIDs []string, vmSetName string, backendAddressPools *[]network.BackendAddressPool, deleteFromVMSet bool) (bool, error) { // Returns nil if backend address pools already deleted. if backendAddressPools == nil { return false, nil @@ -929,13 +906,15 @@ func (fs *FlexScaleSet) EnsureBackendPoolDeleted(service *v1.Service, backendPoo ipConfigurationIDs := []string{} for _, backendPool := range *backendAddressPools { - if strings.EqualFold(to.String(backendPool.ID), backendPoolID) && backendPool.BackendAddressPoolPropertiesFormat != nil && backendPool.BackendIPConfigurations != nil { - for _, ipConf := range *backendPool.BackendIPConfigurations { - if ipConf.ID == nil { - continue - } + for _, backendPoolID := range backendPoolIDs { + if strings.EqualFold(pointer.StringDeref(backendPool.ID, ""), backendPoolID) && backendPool.BackendAddressPoolPropertiesFormat != nil && backendPool.BackendIPConfigurations != nil { + for _, ipConf := range *backendPool.BackendIPConfigurations { + if ipConf.ID == nil { + continue + } - ipConfigurationIDs = append(ipConfigurationIDs, *ipConf.ID) + ipConfigurationIDs = append(ipConfigurationIDs, *ipConf.ID) + } } } } @@ -971,19 +950,17 @@ func (fs *FlexScaleSet) EnsureBackendPoolDeleted(service *v1.Service, backendPoo } } - // 1. Ensure the backendPoolID is deleted from the VMSS. - klog.V(2).Infof("1. Ensure the backendPoolID is deleted from the VMSS.") + klog.V(2).Infof("Ensure backendPoolIDs %q deleted from the VMSS.", backendPoolIDs) if deleteFromVMSet { - err := fs.ensureBackendPoolDeletedFromVmssFlex(backendPoolID, vmSetName) + err := fs.ensureBackendPoolDeletedFromVmssFlex(backendPoolIDs, vmSetName) if err != nil { allErrs = append(allErrs, err) } } - klog.V(2).Infof("2. Ensure the backendPoolID is deleted from the VMSS VMs.") - // 2. Ensure the backendPoolID is deleted from the VMSS VMs. + klog.V(2).Infof("Ensure backendPoolIDs deleted from the VMSS VMs.", backendPoolIDs) klog.V(2).Infof("go into fs.ensureBackendPoolDeletedFromNode, vmssFlexVMNameMap: %s, size: %s", vmssFlexVMNameMap, len(vmssFlexVMNameMap)) - nicUpdated, err := fs.ensureBackendPoolDeletedFromNode(vmssFlexVMNameMap, backendPoolID) + nicUpdated, err := fs.ensureBackendPoolDeletedFromNode(vmssFlexVMNameMap, backendPoolIDs) klog.V(2).Infof("exit from fs.ensureBackendPoolDeletedFromNode") if err != nil { allErrs = append(allErrs, err) @@ -998,14 +975,15 @@ func (fs *FlexScaleSet) EnsureBackendPoolDeleted(service *v1.Service, backendPoo } -func (fs *FlexScaleSet) ensureBackendPoolDeletedFromNode(vmssFlexVMNameMap map[string]string, backendPoolID string) (bool, error) { +func (fs *FlexScaleSet) ensureBackendPoolDeletedFromNode(vmssFlexVMNameMap map[string]string, backendPoolIDs []string) (bool, error) { nicUpdaters := make([]func() error, 0) allErrs := make([]error, 0) - i := 0 var nicUpdated bool + nics := map[string]network.Interface{} // nicName -> nic for nodeName, nicName := range vmssFlexVMNameMap { - i++ - klog.V(2).Infof("i = %s", i) + if _, ok := nics[nicName]; ok { + continue + } ctx, cancel := getContextWithCancel() defer cancel() @@ -1020,40 +998,45 @@ func (fs *FlexScaleSet) ensureBackendPoolDeletedFromNode(vmssFlexVMNameMap map[s } if nic.InterfacePropertiesFormat != nil && nic.InterfacePropertiesFormat.IPConfigurations != nil { - newIPConfigs := *nic.IPConfigurations - for j, ipConf := range newIPConfigs { - if !to.Bool(ipConf.Primary) { - continue - } - // found primary ip configuration - if ipConf.LoadBalancerBackendAddressPools != nil { - newLBAddressPools := *ipConf.LoadBalancerBackendAddressPools - for k := len(newLBAddressPools) - 1; k >= 0; k-- { - pool := newLBAddressPools[k] - if strings.EqualFold(to.String(pool.ID), backendPoolID) { + nicName := pointer.StringDeref(nic.Name, "") + nics[nicName] = nic + } + } + for _, nic := range nics { + newIPConfigs := *nic.IPConfigurations + for j, ipConf := range newIPConfigs { + if !pointer.BoolDeref(ipConf.Primary, false) { + continue + } + // found primary ip configuration + if ipConf.LoadBalancerBackendAddressPools != nil { + newLBAddressPools := *ipConf.LoadBalancerBackendAddressPools + for k := len(newLBAddressPools) - 1; k >= 0; k-- { + pool := newLBAddressPools[k] + for _, backendPoolID := range backendPoolIDs { + if strings.EqualFold(pointer.StringDeref(pool.ID, ""), backendPoolID) { newLBAddressPools = append(newLBAddressPools[:k], newLBAddressPools[k+1:]...) - break } } - newIPConfigs[j].LoadBalancerBackendAddressPools = &newLBAddressPools } + newIPConfigs[j].LoadBalancerBackendAddressPools = &newLBAddressPools } - nic.IPConfigurations = &newIPConfigs - - nicUpdaters = append(nicUpdaters, func() error { - ctx, cancel := getContextWithCancel() - defer cancel() - klog.V(2).Infof("EnsureBackendPoolDeleted begins to CreateOrUpdate for NIC(%s, %s) with backendPoolID %s", fs.resourceGroup, to.String(nic.Name), backendPoolID) - rerr := fs.InterfacesClient.CreateOrUpdate(ctx, fs.ResourceGroup, to.String(nic.Name), nic) - if rerr != nil { - klog.Errorf("EnsureBackendPoolDeleted CreateOrUpdate for NIC(%s, %s) failed with error %v", fs.resourceGroup, to.String(nic.Name), rerr.Error()) - return rerr.Error() - } - nicUpdated = true - klog.V(2).Infof("EnsureBackendPoolDeleted done") - return nil - }) } + nic.IPConfigurations = &newIPConfigs + + nicUpdaters = append(nicUpdaters, func() error { + ctx, cancel := getContextWithCancel() + defer cancel() + klog.V(2).Infof("EnsureBackendPoolDeleted begins to CreateOrUpdate for NIC(%s, %s) with backendPoolIDs %q", fs.ResourceGroup, pointer.StringDeref(nic.Name, ""), backendPoolIDs) + rerr := fs.InterfacesClient.CreateOrUpdate(ctx, fs.ResourceGroup, pointer.StringDeref(nic.Name, ""), nic) + if rerr != nil { + klog.Errorf("EnsureBackendPoolDeleted CreateOrUpdate for NIC(%s, %s) failed with error %v", fs.ResourceGroup, pointer.StringDeref(nic.Name, ""), rerr.Error()) + return rerr.Error() + } + nicUpdated = true + klog.V(2).Infof("EnsureBackendPoolDeleted done") + return nil + }) } klog.V(2).Infof("nicUpdaters size: %s", len(nicUpdaters)) errs := utilerrors.AggregateGoroutines(nicUpdaters...) diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmssflex_cache.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmssflex_cache.go index efca4cb12eaf..126b39503420 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmssflex_cache.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_vmssflex_cache.go @@ -28,6 +28,7 @@ import ( cloudprovider "k8s.io/cloud-provider" "k8s.io/klog/v2" + "k8s.io/utils/pointer" azcache "sigs.k8s.io/cloud-provider-azure/pkg/cache" "sigs.k8s.io/cloud-provider-azure/pkg/consts" @@ -42,7 +43,7 @@ func (fs *FlexScaleSet) newVmssFlexCache(ctx context.Context) (*azcache.TimedCac return nil, err } - for _, resourceGroup := range allResourceGroups.List() { + for _, resourceGroup := range allResourceGroups.UnsortedList() { allScaleSets, rerr := fs.VirtualMachineScaleSetsClient.List(ctx, resourceGroup) if rerr != nil { if rerr.IsNotFound() { @@ -181,18 +182,35 @@ func (fs *FlexScaleSet) getNodeVmssFlexID(nodeName string) (string, error) { } vmssFlexes := cached.(*sync.Map) + var vmssFlexIDs []string vmssFlexes.Range(func(key, value interface{}) bool { vmssFlexID := key.(string) - _, err := fs.vmssFlexVMCache.Get(vmssFlexID, azcache.CacheReadTypeForceRefresh) - if err != nil { - klog.Errorf("failed to refresh vmss flex VM cache for vmssFlexID %s", vmssFlexID) + vmssFlex := value.(*compute.VirtualMachineScaleSet) + vmssPrefix := pointer.StringDeref(vmssFlex.Name, "") + if vmssFlex.VirtualMachineProfile != nil && + vmssFlex.VirtualMachineProfile.OsProfile != nil && + vmssFlex.VirtualMachineProfile.OsProfile.ComputerNamePrefix != nil { + vmssPrefix = pointer.StringDeref(vmssFlex.VirtualMachineProfile.OsProfile.ComputerNamePrefix, "") + } + if strings.EqualFold(vmssPrefix, nodeName[:len(nodeName)-6]) { + // we should check this vmss first since nodeName and vmssFlex.Name or + // ComputerNamePrefix belongs to same vmss, so prepend here + vmssFlexIDs = append([]string{vmssFlexID}, vmssFlexIDs...) + } else { + vmssFlexIDs = append(vmssFlexIDs, vmssFlexID) } return true }) - cachedVmssFlexID, isCached = fs.vmssFlexVMNameToVmssID.Load(nodeName) - if isCached { - return fmt.Sprintf("%v", cachedVmssFlexID), nil + for _, vmssID := range vmssFlexIDs { + if _, err := fs.vmssFlexVMCache.Get(vmssID, azcache.CacheReadTypeForceRefresh); err != nil { + klog.Errorf("failed to refresh vmss flex VM cache for vmssFlexID %s", vmssID) + } + // if the vm is cached stop refreshing + cachedVmssFlexID, isCached = fs.vmssFlexVMNameToVmssID.Load(nodeName) + if isCached { + return fmt.Sprintf("%v", cachedVmssFlexID), nil + } } return "", cloudprovider.InstanceNotFound } @@ -317,17 +335,28 @@ func (fs *FlexScaleSet) getVmssFlexByName(vmssFlexName string) (*compute.Virtual func (fs *FlexScaleSet) DeleteCacheForNode(nodeName string) error { vmssFlexID, err := fs.getNodeVmssFlexID(nodeName) if err != nil { + klog.Errorf("getNodeVmssFlexID(%s) failed with %v", nodeName, err) return err } + fs.lockMap.LockEntry(vmssFlexID) + defer fs.lockMap.UnlockEntry(vmssFlexID) cached, err := fs.vmssFlexVMCache.Get(vmssFlexID, azcache.CacheReadTypeDefault) if err != nil { + klog.Errorf("vmssFlexVMCache.Get(%s, %s) failed with %v", vmssFlexID, nodeName, err) + return err + } + if cached == nil { + err := fmt.Errorf("nil cache returned from %s", vmssFlexID) + klog.Errorf("DeleteCacheForNode(%s, %s) failed with %v", vmssFlexID, nodeName, err) return err } vmMap := cached.(*sync.Map) vmMap.Delete(nodeName) + fs.vmssFlexVMCache.Update(vmssFlexID, vmMap) fs.vmssFlexVMNameToVmssID.Delete(nodeName) + klog.V(2).Infof("DeleteCacheForNode(%s, %s) successfully", vmssFlexID, nodeName) return nil } diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_wrap.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_wrap.go index 05e965ea83d1..3a4277ab622a 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_wrap.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/azure_wrap.go @@ -21,19 +21,21 @@ import ( "net/http" "regexp" "strings" + "sync" "time" "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" - "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2021-08-01/network" - "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2022-07-01/network" "k8s.io/apimachinery/pkg/types" cloudprovider "k8s.io/cloud-provider" "k8s.io/klog/v2" + "k8s.io/utils/pointer" azcache "sigs.k8s.io/cloud-provider-azure/pkg/cache" "sigs.k8s.io/cloud-provider-azure/pkg/consts" "sigs.k8s.io/cloud-provider-azure/pkg/retry" + "sigs.k8s.io/cloud-provider-azure/pkg/util/deepcopy" ) var ( @@ -83,7 +85,7 @@ func (az *Cloud) getVirtualMachine(nodeName types.NodeName, crt azcache.AzureCac func (az *Cloud) getRouteTable(crt azcache.AzureCacheReadType) (routeTable network.RouteTable, exists bool, err error) { if len(az.RouteTableName) == 0 { - return routeTable, false, fmt.Errorf("Route table name is not configured") + return routeTable, false, fmt.Errorf("route table name is not configured") } cachedRt, err := az.rtCache.GetWithDeepCopy(az.RouteTableName, crt) @@ -98,27 +100,44 @@ func (az *Cloud) getRouteTable(crt azcache.AzureCacheReadType) (routeTable netwo return *(cachedRt.(*network.RouteTable)), true, nil } -func (az *Cloud) getPIPCacheKey(pipResourceGroup string, pipName string) string { - resourceGroup := az.ResourceGroup - if pipResourceGroup != "" { - resourceGroup = pipResourceGroup - } - return fmt.Sprintf("%s%s%s", resourceGroup, consts.PIPCacheKeySeparator, pipName) -} - func (az *Cloud) getPublicIPAddress(pipResourceGroup string, pipName string, crt azcache.AzureCacheReadType) (network.PublicIPAddress, bool, error) { - pip := network.PublicIPAddress{} - cacheKey := az.getPIPCacheKey(pipResourceGroup, pipName) - cachedPIP, err := az.pipCache.GetWithDeepCopy(cacheKey, crt) + cached, err := az.pipCache.Get(pipResourceGroup, crt) if err != nil { - return pip, false, err + return network.PublicIPAddress{}, false, err } - if cachedPIP == nil { - return pip, false, nil + pips := cached.(*sync.Map) + pip, ok := pips.Load(pipName) + if !ok { + // pip not found, refresh cache and retry + cached, err = az.pipCache.Get(pipResourceGroup, azcache.CacheReadTypeForceRefresh) + if err != nil { + return network.PublicIPAddress{}, false, err + } + pips = cached.(*sync.Map) + pip, ok = pips.Load(pipName) + if !ok { + return network.PublicIPAddress{}, false, nil + } } - return *(cachedPIP.(*network.PublicIPAddress)), true, nil + pip = pip.(*network.PublicIPAddress) + return *(deepcopy.Copy(pip).(*network.PublicIPAddress)), true, nil +} + +func (az *Cloud) listPIP(pipResourceGroup string, crt azcache.AzureCacheReadType) ([]network.PublicIPAddress, error) { + cached, err := az.pipCache.Get(pipResourceGroup, crt) + if err != nil { + return nil, err + } + pips := cached.(*sync.Map) + var ret []network.PublicIPAddress + pips.Range(func(key, value interface{}) bool { + pip := value.(*network.PublicIPAddress) + ret = append(ret, *pip) + return true + }) + return ret, nil } func (az *Cloud) getSubnet(virtualNetworkName string, subnetName string) (network.Subnet, bool, error) { @@ -212,7 +231,7 @@ func (az *Cloud) newVMCache() (*azcache.TimedCache, error) { } if vm.VirtualMachineProperties != nil && - strings.EqualFold(to.String(vm.VirtualMachineProperties.ProvisioningState), string(compute.ProvisioningStateDeleting)) { + strings.EqualFold(pointer.StringDeref(vm.VirtualMachineProperties.ProvisioningState, ""), string(compute.ProvisioningStateDeleting)) { klog.V(2).Infof("Virtual machine %q is under deleting", key) return nil, nil } @@ -304,24 +323,18 @@ func (az *Cloud) newPIPCache() (*azcache.TimedCache, error) { ctx, cancel := getContextWithCancel() defer cancel() - parsedKey := strings.Split(strings.TrimSpace(key), consts.PIPCacheKeySeparator) - if len(parsedKey) != 2 { - return nil, fmt.Errorf("failed to parse public ip rg and name from cache key %q", key) - } - pipResourceGroup, pipName := strings.TrimSpace(parsedKey[0]), strings.TrimSpace(parsedKey[1]) - - pip, err := az.PublicIPAddressesClient.Get(ctx, pipResourceGroup, pipName, "") - exists, rerr := checkResourceExistsFromError(err) + pipResourceGroup := key + pipList, rerr := az.PublicIPAddressesClient.List(ctx, pipResourceGroup) if rerr != nil { return nil, rerr.Error() } - if !exists { - klog.V(2).Infof("Public IP %q in rg %q not found", pipName, pipResourceGroup) - return nil, nil + pipMap := &sync.Map{} + for _, pip := range pipList { + pip := pip + pipMap.Store(pointer.StringDeref(pip.Name, ""), &pip) } - - return &pip, nil + return pipMap, nil } if az.PublicIPCacheTTLInSeconds == 0 { diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/virtualmachine/virtualmachine.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/virtualmachine/virtualmachine.go index 098bb8dad31b..7e37c7036100 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/virtualmachine/virtualmachine.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/provider/virtualmachine/virtualmachine.go @@ -18,7 +18,7 @@ package virtualmachine import ( "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-03-01/compute" - "github.com/Azure/go-autorest/autorest/to" + "k8s.io/utils/pointer" ) type Variant string @@ -79,12 +79,12 @@ func FromVirtualMachine(vm *compute.VirtualMachine, opt ...ManageOption) *Virtua vm: vm, Variant: VariantVirtualMachine, - ID: to.String(vm.ID), - Name: to.String(vm.Name), - Type: to.String(vm.Type), - Location: to.String(vm.Location), - Tags: to.StringMap(vm.Tags), - Zones: to.StringSlice(vm.Zones), + ID: pointer.StringDeref(vm.ID, ""), + Name: pointer.StringDeref(vm.Name, ""), + Type: pointer.StringDeref(vm.Type, ""), + Location: pointer.StringDeref(vm.Location, ""), + Tags: stringMap(vm.Tags), + Zones: stringSlice(vm.Zones), Plan: vm.Plan, Resources: vm.Resources, @@ -104,17 +104,17 @@ func FromVirtualMachineScaleSetVM(vm *compute.VirtualMachineScaleSetVM, opt Mana Variant: VariantVirtualMachineScaleSetVM, vmssVM: vm, - ID: to.String(vm.ID), - Name: to.String(vm.Name), - Type: to.String(vm.Type), - Location: to.String(vm.Location), - Tags: to.StringMap(vm.Tags), - Zones: to.StringSlice(vm.Zones), + ID: pointer.StringDeref(vm.ID, ""), + Name: pointer.StringDeref(vm.Name, ""), + Type: pointer.StringDeref(vm.Type, ""), + Location: pointer.StringDeref(vm.Location, ""), + Tags: stringMap(vm.Tags), + Zones: stringSlice(vm.Zones), Plan: vm.Plan, Resources: vm.Resources, SKU: vm.Sku, - InstanceID: to.String(vm.InstanceID), + InstanceID: pointer.StringDeref(vm.InstanceID, ""), VirtualMachineScaleSetVMProperties: vm.VirtualMachineScaleSetVMProperties, } @@ -144,3 +144,26 @@ func (vm *VirtualMachine) AsVirtualMachine() *compute.VirtualMachine { func (vm *VirtualMachine) AsVirtualMachineScaleSetVM() *compute.VirtualMachineScaleSetVM { return vm.vmssVM } + +// StringMap returns a map of strings built from the map of string pointers. The empty string is +// used for nil pointers. +func stringMap(msp map[string]*string) map[string]string { + ms := make(map[string]string, len(msp)) + for k, sp := range msp { + if sp != nil { + ms[k] = *sp + } else { + ms[k] = "" + } + } + return ms +} + +// stringSlice returns a string slice value for the passed string slice pointer. It returns a nil +// slice if the pointer is nil. +func stringSlice(s *[]string) []string { + if s != nil { + return *s + } + return nil +} diff --git a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/retry/azure_error.go b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/retry/azure_error.go index d5ddae531ddc..ef47fe476395 100644 --- a/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/retry/azure_error.go +++ b/cluster-autoscaler/vendor/sigs.k8s.io/cloud-provider-azure/pkg/retry/azure_error.go @@ -20,7 +20,7 @@ import ( "bytes" "encoding/json" "fmt" - "io/ioutil" + "io" "net/http" "regexp" "strconv" @@ -64,13 +64,6 @@ type Error struct { RawError error } -// RawErrorContainer is the container of the Error.RawError -type RawErrorContainer struct { - Code string `json:"code"` - Message string `json:"message"` - Details []string `json:"details"` -} - // Error returns the error. // Note that Error doesn't implement error interface because (nil *Error) != (nil error). func (err *Error) Error() error { @@ -198,8 +191,8 @@ func getRawError(resp *http.Response, err error) error { // return the http status if it is unable to get response body. defer resp.Body.Close() - respBody, _ := ioutil.ReadAll(resp.Body) - resp.Body = ioutil.NopCloser(bytes.NewReader(respBody)) + respBody, _ := io.ReadAll(resp.Body) + resp.Body = io.NopCloser(bytes.NewReader(respBody)) if len(respBody) == 0 { return fmt.Errorf("HTTP status code (%d)", resp.StatusCode) } @@ -425,3 +418,16 @@ func getOperationNotAllowedReason(msg string) string { } return OperationNotAllowed } + +// PartialUpdateError implements error interface. It is meant to be returned for errors with http status code of 2xx +type PartialUpdateError struct { + message string +} + +func NewPartialUpdateError(msg string) *PartialUpdateError { + return &PartialUpdateError{message: msg} +} + +func (e *PartialUpdateError) Error() string { + return e.message +}